Repository navigation
v0.0.16 — Transfers that outlive the clock
v0.0.16 — Transfers that outlive the clock
One bug, found on real Windows, and one protocol answer that was lying.
The 30-second wall
The HTTP client bounded the whole request with .timeout(30s). Any transfer
that needed longer than half a minute died mid-flight — 300 MB at 5 MB/s over
Tailscale is a full minute, which is exactly the VPS-to-laptop case zapsend is
for.
What it looked like on the wire, from a 300 MB upload out of a WinPE guest:
upload failed for big.bin: operation timed out ← 217 MB already stored
↻ big.bin — receiver already has 217.1 MiB, resuming
! upload rejected for big.bin (500): incomplete: 227618816 of 314572800 bytes
stored — resume at offset 227618816
! big.bin changed since the last attempt — starting over
Three things were wrong in a row. The receiver kept draining the body after the
client gave up, so the offset it reported next time was ahead of the one the
client resumed from. That mismatch looked like a different file, so the client
restarted from zero — and hit the same wall again. A big file could never
finish.
connect_timeout(10s) still fails fast when a peer is down. read_timeout(60s)
is per-read inactivity: a peer that stops sending still fails, a slow one is
allowed to finish. There is no longer any limit on how long a transfer may take.
A short body is 409, not 500
A body that arrived short of its declared size used to be answered with 500 Internal Server Error. Any peer reads 500 as the server is broken, so it
retries from zero. The receiver was fine — the transfer simply was not finished.
It now answers 409 Conflict with the offset to continue from:
incomplete: 227618816 of 314572800 bytes stored — resume at offset 227618816
Clearer words when the kept partial is not this file
When the receiver holds bytes that are not a prefix of the file being sent, the
client throws them away and starts over (safe — splicing two files would be
worse). It used to say big.bin changed since the last attempt, which blames
the file. It now says what actually happened:
! big.bin — the partial the receiver kept is not this file, starting over
Verified
The exact artefacts in this release ran on a real Windows kernel — WinPE
10.0.26100.1742 under QEMU, -cpu max:
zapsend 0.0.16
trust wbox --ip 10.0.2.2:53485 --pin 4242 --json → fingerprint pinned
receive --dir C:\inbox --port 53486 --pin 4242 → → incoming: 1 file(s)
✓ saved C:\inbox\laporan akhir.txt
pull --to wbox --dir "C:\pulled dir" --json → {"ok":true,"bytes":314572817}
send "C:\pulled dir\big.bin" --to wbox --json → {"ok":true,"bytes":314572800}
The 300 MB file was pulled out of a Linux peer and pushed back, then compared on
the Linux side:
original 314572800 B sha e6ab3bb898cc0a49dbd7bf872659daf2711c54b968482e3039af0aae6a748c48
returned 314572800 B sha e6ab3bb898cc0a49dbd7bf872659daf2711c54b968482e3039af0aae6a748c48
Byte-for-byte identical, through the Windows build, in both directions.
Host suites unchanged: 15 unit, 31 compat, 28 json, 21 pull-resume, 29 hosts,
19 pull, 17 resume.
What this release does not prove
- A push into the WinPE guest from another machine. QEMU's slirp accepts
the host-side TCP connection, but the guest never answers, and WinPE cannot be
told to allow it:wpeutil DisableFirewallfails with0x8007007e,netsh
has noadvfirewallcontext, andsc.exeis absent. The receiving side
itself is proven by the loopback transfer above. On a normal Windows install
one command opens the port:
New-NetFirewallRule -DisplayName zapsend -Direction Inbound -Protocol TCP -LocalPort 53317 -Action Allow - The resume-upload path when the receiver's partial is not a prefix of the
file. There is no endpoint to drop a stale.part, so the client starts the
file over. Safe, but blunt. "bytes"inpull --jsonis the sum of the file sizes, not bytes on the wire.
Wire format is unchanged from v0.0.15; 409 and the incomplete: body are
zapsend extensions alongside /resume and /verify-download, and a peer that
does not know them just sees a failed request.