File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -436,8 +436,7 @@ impl WebSocketConnection {
436436 } )
437437 }
438438
439- /// Start connection event loop.
440- pub ( crate ) async fn start ( mut self ) -> crate :: Result < ( ) > {
439+ async fn start_inner ( mut self ) -> crate :: Result < ( ) > {
441440 self . protocol_set
442441 . report_connection_established ( self . peer , self . endpoint )
443442 . await ?;
@@ -602,4 +601,14 @@ impl WebSocketConnection {
602601 }
603602 }
604603 }
604+
605+ /// Start connection event loop.
606+ pub ( crate ) async fn start ( mut self ) -> crate :: Result < ( ) > {
607+ self . start_inner ( ) . await . inspect_err ( |_| {
608+ if let Some ( metrics) = & self . metrics {
609+ // All pending substreams must be decremented because the connection is closing.
610+ metrics. pending_substreams_num . sub ( self . pending_substreams . len ( ) as u64 ) ;
611+ }
612+ } )
613+ }
605614}
You can’t perform that action at this time.
0 commit comments