-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
The problem with PuTTY Client #156
Comments
After analyzing the PuTTY logs, I found that PuTTY does not start transferring data until it receives the With the following fixes, the echoserver example worked as expected with the PuTTY client: diff --git a/russh/examples/echoserver.rs b/russh/examples/echoserver.rs
index 356f1b3..16e294d 100644
--- a/russh/examples/echoserver.rs
+++ b/russh/examples/echoserver.rs
@@ -80,6 +80,30 @@ impl server::Handler for Server {
Ok((self, server::Auth::Accept))
}
+ async fn pty_request(
+ self,
+ channel: ChannelId,
+ _term: &str,
+ _col_width: u32,
+ _row_height: u32,
+ _pix_width: u32,
+ _pix_height: u32,
+ _modes: &[(Pty, u32)],
+ mut session: Session,
+ ) -> Result<(Self, Session), Self::Error> {
+ session.channel_window_adjust(channel);
+ Ok((self, session))
+ }
+
async fn data(
mut self,
channel: ChannelId,
diff --git a/russh/src/server/session.rs b/russh/src/server/session.rs
index 9bb2025..dc72df5 100644
--- a/russh/src/server/session.rs
+++ b/russh/src/server/session.rs
@@ -605,6 +605,23 @@ impl Session {
}
}
+ pub fn channel_window_adjust(&mut self, channel: ChannelId) {
+ if let Some(ref mut enc) = self.common.encrypted {
+ if let Some(channel) = enc.channels.get_mut(&channel) {
+ assert!(channel.confirmed);
+ if channel.wants_reply {
+ channel.wants_reply = false;
+ debug!("channel_window_adjust {:?}", channel);
+ push_packet!(enc.write, {
+ enc.write.push(msg::CHANNEL_WINDOW_ADJUST);
+ enc.write.push_u32_be(0x100);
+ enc.write.push_u32_be(0x200000);
+ });
+ }
+ }
+ }
+ }
+
/// Send a "failure" reply to a global request.
pub fn channel_failure(&mut self, channel: ChannelId) {
if let Some(ref mut enc) = self.common.encrypted {
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I run example:
It works as expected using OpenSSH's Client.
However with PuTTY, no data is sent.
Client versions:
The text was updated successfully, but these errors were encountered: