aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--oxish-proto/src/channels.rs23
-rw-r--r--oxish/src/session/connections.rs2
2 files changed, 12 insertions, 13 deletions
diff --git a/oxish-proto/src/channels.rs b/oxish-proto/src/channels.rs
index 917945d..c910378 100644
--- a/oxish-proto/src/channels.rs
+++ b/oxish-proto/src/channels.rs
@@ -243,18 +243,15 @@ impl<'a> TryFrom<IncomingPacket<'a>> for ChannelRequest<'a> {
}
}
b"[email protected]" => ChannelRequestType::AuthAgentReq,
- _ => {
- return Err(match str::from_utf8(r#type) {
- Ok(r#type) => {
- warn!(%r#type, "unknown channel request type");
- ProtoError::InvalidChannelType(r#type.to_owned())
- }
- Err(_) => {
- warn!(?r#type, "unknown channel request type");
- ProtoError::InvalidPacket("unknown channel request type (invalid UTF-8)")
- }
- });
- }
+ _ => match str::from_utf8(r#type) {
+ Ok(r#type) => ChannelRequestType::Unknown(r#type),
+ Err(_) => {
+ warn!(?r#type, "unknown channel request type");
+ return Err(ProtoError::InvalidPacket(
+ "unknown channel request type (invalid UTF-8)",
+ ));
+ }
+ },
};
Ok(ChannelRequest {
@@ -288,6 +285,8 @@ pub enum ChannelRequestType<'a> {
///
/// As defined in <https://www.rfc-editor.org/rfc/rfc4254#section-6.7>.
WindowChange(WindowChange),
+ /// Unknown channel request type; the string is the request type name
+ Unknown(&'a str),
}
/// Type-specific data for the `window-change` channel request
diff --git a/oxish/src/session/connections.rs b/oxish/src/session/connections.rs
index 6f9d23b..fa79014 100644
--- a/oxish/src/session/connections.rs
+++ b/oxish/src/session/connections.rs
@@ -117,7 +117,7 @@ impl Channels {
_ => warn!("window-change request without running terminal"),
},
// Agent forwarding is not supported -- only reply when asked
- ChannelRequestType::AuthAgentReq => {
+ ChannelRequestType::AuthAgentReq | ChannelRequestType::Unknown(_) => {
if request.want_reply {
encoder.enqueue(&channel.failure())?;
}