Skip to content

Acknowledge received data as it arrives - #95

Open
IntellyCode wants to merge 1 commit into
narrowlink:mainfrom
IntellyCode:local
Open

IntellyCode wants to merge 1 commit into
narrowlink:mainfrom
IntellyCode:local

Conversation

@IntellyCode

Copy link
Copy Markdown
Contributor

Long uploads fail. An scp or rsync transfer into ipstack stalls partway or hangs at the end, and the application never learns the transfer finished.

The cause is the acknowledgement lagging behind the bytes actually received. An earlier commit tied acknowledgement to the handoff of data to the reader, so a reader that drains slowly leaves in-sequence data unacknowledged in the reassembly buffer, the advertised window stays closed, and the peer stops sending.

In-sequence data is now acknowledged on arrival and held in a received queue, which the reader drains through the bounded channel, following RFC 9293. The advertised window counts both the reassembly buffer and that queue, so memory stays bounded and a slow reader still slows the sender. A segment is stored only up to the window's right edge. A FIN arriving in sequence is acknowledged where it lands, and a closing connection hands the reader every stored byte before end-of-stream.

Tested with scp and rsync uploads through a TUN device: ten consecutive 5 MB transfers completed with matching checksums.

In-sequence data is acknowledged on arrival and held in a received
queue, which the reader drains through the bounded handoff channel. The
advertised window counts both the reassembly buffer and the queue, and a
segment is stored only up to the window's right edge. A FIN arriving in
sequence is acknowledged where it lands. A closing connection hands the
reader every stored byte before end-of-stream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant