@@ -79,9 +79,6 @@ pub struct Handler {
7979 /// List of active inbound substreams with the state they are in.
8080 inbound_substreams : SelectAll < InboundSubstreamState > ,
8181
82- /// Until when to keep the connection alive.
83- keep_alive : KeepAlive ,
84-
8582 /// The connected endpoint of the connection that the handler
8683 /// is associated with.
8784 endpoint : ConnectedPoint ,
@@ -491,8 +488,6 @@ impl Handler {
491488 }
492489 }
493490
494- let keep_alive = KeepAlive :: Until ( Instant :: now ( ) + idle_timeout) ;
495-
496491 Handler {
497492 protocol_config,
498493 mode,
@@ -504,7 +499,6 @@ impl Handler {
504499 outbound_substreams : Default :: default ( ) ,
505500 num_requested_outbound_streams : 0 ,
506501 pending_messages : Default :: default ( ) ,
507- keep_alive,
508502 protocol_status : ProtocolStatus :: Unknown ,
509503 remote_supported_protocols : Default :: default ( ) ,
510504 connection_id,
@@ -718,7 +712,7 @@ impl ConnectionHandler for Handler {
718712 }
719713
720714 fn connection_keep_alive ( & self ) -> KeepAlive {
721- self . keep_alive
715+ KeepAlive :: No
722716 }
723717
724718 fn poll (
@@ -760,16 +754,6 @@ impl ConnectionHandler for Handler {
760754 } ) ;
761755 }
762756
763- let no_streams = self . outbound_substreams . is_empty ( ) && self . inbound_substreams . is_empty ( ) ;
764- self . keep_alive = match ( no_streams, self . keep_alive ) {
765- // No open streams. Preserve the existing idle timeout.
766- ( true , k @ KeepAlive :: Until ( _) ) => k,
767- // No open streams. Set idle timeout.
768- ( true , _) => KeepAlive :: Until ( Instant :: now ( ) + self . idle_timeout ) ,
769- // Keep alive for open streams.
770- ( false , _) => KeepAlive :: Yes ,
771- } ;
772-
773757 Poll :: Pending
774758 }
775759
0 commit comments