Skip to content

Commit

Permalink
added missing channel success messages - fixes #349, fixes #364 - Ter…
Browse files Browse the repository at this point in the history
…mius, WinSCP and Filezilla access
  • Loading branch information
Eugeny committed Sep 26, 2022
1 parent 06c0a3d commit 773bf19
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions warpgate-protocol-ssh/src/server/russh_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl russh::server::Handler for ServerHandler {
self,
channel: ChannelId,
name: &str,
session: Session,
mut session: Session,
) -> Self::FutureUnit {
let name = name.to_string();
async move {
Expand All @@ -132,6 +132,7 @@ impl russh::server::Handler for ServerHandler {
))?;

let _ = rx.await;
session.channel_success(channel);
Ok((self, session))
}
.boxed()
Expand All @@ -146,7 +147,7 @@ impl russh::server::Handler for ServerHandler {
pix_width: u32,
pix_height: u32,
modes: &[(Pty, u32)],
session: Session,
mut session: Session,
) -> Self::FutureUnit {
let term = term.to_string();
let modes = modes
Expand All @@ -172,12 +173,13 @@ impl russh::server::Handler for ServerHandler {
))?;

let _ = rx.await;
session.channel_success(channel);
Ok((self, session))
}
.boxed()
}

fn shell_request(self, channel: ChannelId, session: Session) -> Self::FutureUnit {
fn shell_request(self, channel: ChannelId, mut session: Session) -> Self::FutureUnit {
async move {
let (tx, rx) = oneshot::channel();

Expand All @@ -187,6 +189,7 @@ impl russh::server::Handler for ServerHandler {
))?;

let _ = rx.await;
session.channel_success(channel);
Ok((self, session))
}
.boxed()
Expand Down Expand Up @@ -355,7 +358,12 @@ impl russh::server::Handler for ServerHandler {
.boxed()
}

fn exec_request(self, channel: ChannelId, data: &[u8], session: Session) -> Self::FutureUnit {
fn exec_request(
self,
channel: ChannelId,
data: &[u8],
mut session: Session,
) -> Self::FutureUnit {
let data = Bytes::from(data.to_vec());
async move {
let (tx, rx) = oneshot::channel();
Expand All @@ -365,6 +373,7 @@ impl russh::server::Handler for ServerHandler {
tx,
))?;
let _ = rx.await;
session.channel_success(channel);
Ok((self, session))
}
.boxed()
Expand Down

0 comments on commit 773bf19

Please sign in to comment.