fix(protocol): handle zero-size requests (fixes #10709) (#10710)

- Allow zero-sized requests since they are sent by all current versions
of Syncthing.
- Stop sending zero-sized requests since that's stupid.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
Jakob Borg
2026-05-25 15:22:07 +02:00
committed by GitHub
parent 3ec73403c1
commit 6be1ff8480
4 changed files with 44 additions and 3 deletions
+1 -1
View File
@@ -891,7 +891,7 @@ func TestPullCtxCancel(t *testing.T) {
emptyState := func() pullBlockState {
return pullBlockState{
sharedPullerState: newSharedPullerState(protocol.FileInfo{}, nil, f.folderID, "", nil, nil, false, false, protocol.FileInfo{}, false, false),
block: protocol.BlockInfo{},
block: protocol.BlockInfo{Size: 42},
}
}