File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -818,15 +818,15 @@ impl Session {
818818 ( ) = & mut keepalive_timer => {
819819 if self . common. config. keepalive_max != 0 && self . common. alive_timeouts > self . common. config. keepalive_max {
820820 debug!( "Timeout, server not responding to keepalives" ) ;
821- break
821+ return Err ( crate :: Error :: KeepaliveTimeout ) ;
822822 }
823823 self . common. alive_timeouts = self . common. alive_timeouts. saturating_add( 1 ) ;
824824 self . send_keepalive( true ) ;
825825 sent_keepalive = true ;
826826 }
827827 ( ) = & mut inactivity_timer => {
828828 debug!( "timeout" ) ;
829- break
829+ return Err ( crate :: Error :: InactivityTimeout ) ;
830830 }
831831 msg = self . receiver. recv( ) , if !self . is_rekeying( ) => {
832832 match msg {
Original file line number Diff line number Diff line change @@ -249,6 +249,14 @@ pub enum Error {
249249 #[ error( "Connection timeout" ) ]
250250 ConnectionTimeout ,
251251
252+ /// Keepalive timeout.
253+ #[ error( "Keepalive timeout" ) ]
254+ KeepaliveTimeout ,
255+
256+ /// Inactivity timeout.
257+ #[ error( "Inactivity timeout" ) ]
258+ InactivityTimeout ,
259+
252260 /// Missing authentication method.
253261 #[ error( "No authentication method" ) ]
254262 NoAuthMethod ,
Original file line number Diff line number Diff line change @@ -447,15 +447,15 @@ impl Session {
447447 ( ) = & mut keepalive_timer => {
448448 if self . common. config. keepalive_max != 0 && self . common. alive_timeouts > self . common. config. keepalive_max {
449449 debug!( "Timeout, client not responding to keepalives" ) ;
450- break
450+ return Err ( crate :: Error :: KeepaliveTimeout ) ;
451451 }
452452 self . common. alive_timeouts = self . common. alive_timeouts. saturating_add( 1 ) ;
453453 sent_keepalive = true ;
454454 self . keepalive_request( ) ;
455455 }
456456 ( ) = & mut inactivity_timer => {
457457 debug!( "timeout" ) ;
458- break
458+ return Err ( crate :: Error :: InactivityTimeout ) ;
459459 }
460460 msg = self . receiver. recv( ) , if !self . is_rekeying( ) => {
461461 match msg {
You can’t perform that action at this time.
0 commit comments