@@ -1633,25 +1633,40 @@ pub trait Handler: Sized + Send {
16331633 #[ allow( unused_variables) ]
16341634 async fn server_channel_open_agent_forward (
16351635 & mut self ,
1636- channel : ChannelId ,
1636+ channel : Channel < Msg > ,
16371637 session : & mut Session ,
16381638 ) -> Result < ( ) , Self :: Error > {
16391639 Ok ( ( ) )
16401640 }
16411641
1642- /// Called when the server gets an unknown channel. It may return `true`,
1643- /// if the channel of unknown type should be handled. If it returns `false`,
1644- /// the channel will not be created and an error will be sent to the server.
1642+ /// Called when the server attempts to open a channel of unknown type. It may return `true`,
1643+ /// if the channel of unknown type should be accepted. In this case,
1644+ /// [Handler::server_channel_open_unknown] will be called soon after. If it returns `false`,
1645+ /// the channel will not be created and a rejection message will be sent to the server.
16451646 #[ allow( unused_variables) ]
1646- fn server_channel_handle_unknown ( & self , channel : ChannelId , channel_type : & [ u8 ] ) -> bool {
1647+ async fn should_accept_unknown_server_channel (
1648+ & mut self ,
1649+ id : ChannelId ,
1650+ channel_type : & [ u8 ] ,
1651+ ) -> bool {
16471652 false
16481653 }
16491654
1655+ /// Called when the server opens an unknown channel.
1656+ #[ allow( unused_variables) ]
1657+ async fn server_channel_open_unknown (
1658+ & mut self ,
1659+ channel : Channel < Msg > ,
1660+ session : & mut Session ,
1661+ ) -> Result < ( ) , Self :: Error > {
1662+ Ok ( ( ) )
1663+ }
1664+
16501665 /// Called when the server opens a session channel.
16511666 #[ allow( unused_variables) ]
16521667 async fn server_channel_open_session (
16531668 & mut self ,
1654- channel : ChannelId ,
1669+ channel : Channel < Msg > ,
16551670 session : & mut Session ,
16561671 ) -> Result < ( ) , Self :: Error > {
16571672 Ok ( ( ) )
@@ -1661,7 +1676,7 @@ pub trait Handler: Sized + Send {
16611676 #[ allow( unused_variables) ]
16621677 async fn server_channel_open_direct_tcpip (
16631678 & mut self ,
1664- channel : ChannelId ,
1679+ channel : Channel < Msg > ,
16651680 host_to_connect : & str ,
16661681 port_to_connect : u32 ,
16671682 originator_address : & str ,
0 commit comments