Repository navigation
async: Don't reply to a channel EOF with our own EOF - #85
Merged
Merged
Conversation
Contributor
Author
mkj
reviewed
Nov 29, 2026
Receiving CHANNEL_EOF made sunset send its own EOF right away. EOF only ends the peer's direction (RFC 4254 5.3), so anything the application wrote after reading to EOF was sent after our EOF: OpenSSH discards it. That loses the output of `ssh host cmd < /dev/null`, `cat f | ssh host cmd`, or any command that reads stdin to EOF before answering. Writes were also still accepted after our EOF, putting data on the wire that the peer must ignore. Since f3fd0a5 closing a channel or dropping all its handles sends EOF and Close, so channels still terminate without the automatic reply.
dpeckett
force-pushed
the
fix/channel-eof
branch
from
November 29, 2026 09:24
93b13b1 to
2cf26e5
Compare
Owner
|
Thanks for these fixes. The channel EOF handling here resolves part of #22 |
Contributor
Author
|
Thanks so much for all your prompt reviews, that's the last of my patch series for now 👋. Inter-operating with sunset-sftp via openssh's scp client should now be possible. |
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.
Receiving CHANNEL_EOF made sunset send its own EOF right away. EOF only ends the peer's direction (RFC 4254 5.3), so anything the application wrote after reading to EOF was sent after our EOF: OpenSSH discards it. That loses the output of
ssh host cmd < /dev/null,cat f | ssh host cmd, or any command that reads stdin to EOF before answering. Writes were also still accepted after our EOF, putting data on the wire that the peer must ignore.Since f3fd0a5 closing a channel or dropping all its handles sends EOF and Close, so channels still terminate without the automatic reply.