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

Fix https://github.com/warp-tech/russh/issues/232 #243

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

samuela
Copy link
Contributor

@samuela samuela commented Feb 4, 2024

Upon debugging, I discovered that alive_timeouts is not currently ever reset to 0 anywhere. The diff in server/session.rs remedies this, reseting alive_timeouts to 0 any time we receive data from the client.

Unfortunately, there was additionally the issue that self.common.received_data was not in fact a reliable indicator of whether or not we had actually received data from the client. This turned out to be due to some logic in server/encrypted.rs that overrode the assignment here if the message was not one of the expected format. I have removed this logic in server/encrypted.rs.

self.common.received_data is not documented or defined AFAIK. Looking through the code, I concluded that server/encrypted.rs was in the wrong and should be modified, but some scrutiny on this decision may be warranted. In any case, this fixes #232.

@Eugeny
Copy link
Member

Eugeny commented Feb 4, 2024

@mmirate could you please review this as well? Thanks.

Copy link
Contributor

@mmirate mmirate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the correct way forward. It just needs one specific additional piece of follow-through.

russh/src/server/session.rs Show resolved Hide resolved
@Eugeny Eugeny merged commit 1541fe5 into warp-tech:main Feb 7, 2024
4 checks passed
@samuela samuela deleted the samuela/keepalive branch February 7, 2024 15:54
@samuela
Copy link
Contributor Author

samuela commented Feb 7, 2024

Thanks @Eugeny and @mmirate !

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.

russh::server::run doesn't respect keepalive responses sent by the client
3 participants