Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session error: early eof, when trying to close ssh session #253

Open
zim32 opened this issue Feb 17, 2024 · 1 comment
Open

Session error: early eof, when trying to close ssh session #253

zim32 opened this issue Feb 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@zim32
Copy link

zim32 commented Feb 17, 2024

I'm trying to close ssh session after client sends EOF, using this sequence:

log::debug!("sending exit_status_request");
session.exit_status_request(channel, 0);

log::debug!("sending eof");
session.eof(channel);

log::debug!("sending close channel");
session.close(channel);

Session is closed but I got Session error: early eof error. Seems like you are using tokio read_exact, passing buffer, and when read_exact can not read exact number of bytes to fill entire buffer it returns eof error and this library just forwards this error to client code.

I don't know is it a bug or feature, but in my opinion this library should handle https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html#variant.UnexpectedEof error and shutdown session gracefully.

@wiktor-k
Copy link
Contributor

FWIW, I'm also affected by this: the handle_session_error is complaining about early EOFs but everything else works correctly. It'd be cool to have that slight issue fixed.

@Eugeny Eugeny added the bug Something isn't working label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants