Skip to content

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

@zim32

Description

@zim32

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions