Repository navigation
Conversation
RFC 4254 5.3: EOF only ends the sender's direction. Replying to the
peer's EOF with an EOF straight away ended our direction too, so a
server could no longer send output after the client's stdin ended.
Seen with OpenSSH: `ssh host cmd < /dev/null` sends EOF right after
the exec request, sunset replied with EOF, and the client dropped the
command's output that followed ("rcvd eof" in ssh -vvv right after
"exec request accepted").
Contributor
|
I added point 2 in - #75 (isolated) |
The 1000-byte window and packet sizes made a client wait for a window adjustment after every packet. With `alloc` the packet buffers hold SSH_MAX_PACKET (35000), so use 32 KiB packets and a 256 KiB window. Measured on a sunset-based server (seOS, an seL4 OS) receiving with OpenSSH scp 9.9: 15 MB/s before, 24 MB/s after. Without `alloc` the sizes are unchanged.
neit-16
force-pushed
the
eof-exit-window
branch
from
November 20, 2026 18:41
9cc08f9 to
76d354f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small changes found while running a sunset server (seOS, an OS on seL4) against OpenSSH 9.9. Each is its own commit.
Don't answer a channel EOF with our own EOF. RFC 4254 5.3: EOF ends only the sender's direction.
handle_eof()replied with an EOF straight away, ending our direction too. Withssh host cmd < /dev/null, OpenSSH sends EOF right after the exec request, sunset replied with EOF, and OpenSSH dropped the command's output that followed: inssh -vvv, "rcvd eof" comes right after "exec request accepted". Our side now stays open until the application closes the channel;close_channel()already sends EOF then.Larger channel window and packets with
alloc. The 1000-byte window made the client wait for a window adjustment after every packet. Withalloc, packet buffers holdSSH_MAX_PACKET, so this uses 32 KiB packets and a 256 KiB window.scpto the server went from 15 MB/s to 24 MB/s. Withoutallocthe sizes are unchanged. If you would rather make these configurable, I can rework it.The exit status change this PR first had is dropped: it is in #75.
Tests:
cargo test --lib,cargo test --lib --all-features,cargo test --features std,tokioinasync/,cargo clippy --all-targetsclean,cargo fmtapplied.