-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
channel_open_session
not returning
#100
Comments
Could you please show your |
pub struct Handler;
#[async_trait]
impl client::Handler for Handler {
type Error = eyre::Error;
async fn check_server_key(
self,
server_public_key: &key::PublicKey,
) -> Result<(Self, bool), Self::Error> {
info!(
"Got public key from server: {}",
server_public_key.fingerprint()
);
Ok((self, true))
}
async fn channel_open_confirmation(
self,
channel: ChannelId,
_max_packet_size: u32,
_window_size: u32,
session: client::Session,
) -> Result<(Self, client::Session), Self::Error> {
debug!("Got channel open confirmation for channel {channel:?}");
Ok((self, session))
}
async fn data(
self,
channel: ChannelId,
data: &[u8],
session: client::Session,
) -> Result<(Self, client::Session), Self::Error> {
debug!(
"Received data on channel {channel:?}: {:?}",
std::str::from_utf8(data)
);
Ok((self, session))
}
} |
Make sure to call the original implementation ( |
Not quite sure what you mean, where would I call that? |
Copy-pasting exactly the implementation from the docs leads to the same issue. |
You can keep your custom implementation and add a call to the original like this: async fn channel_open_confirmation(
self,
channel: ChannelId,
max_packet_size: u32,
window_size: u32,
session: client::Session,
) -> Result<(Self, client::Session), Self::Error> {
let (self, session) = Handler::channel_open_confirmation(self, channel, max_packet_size, window_size, session).await?;
debug!("Got channel open confirmation for channel {channel:?}");
Ok((self, session))
} Thanks for pointing out the docs! A lot of these are inherited from |
Even if explicitly specifying |
I am also getting an infinite recursion on something like this. Is there a way to call the overridden method in russh::server::Handler ? |
This will cause recursion and stackoverflow in runtime because this line: |
In |
I have the following code for a
Client
:When running
the
"a"
gets printed, but the"b"
does not.I have implemented the method in the Handler for printing out the channel open confirmation, with the logs containing this:
After this the program seems to freeze.
I tried connecting to both a remote Debian server as well as a local
linuxserver/openssh-server
docker container.Anyone know what might be going wrong here?
The text was updated successfully, but these errors were encountered: