File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
src/protocol/notification Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -435,18 +435,30 @@ impl NotificationProtocol {
435435 } ,
436436 ) ;
437437 }
438+ ( OutboundState :: OutboundInitiated { substream } , _) => {
439+ tracing:: debug!(
440+ target: LOG_TARGET ,
441+ ?peer,
442+ protocol = %self . protocol,
443+ "connection closed outbound substream initiated " ,
444+ ) ;
445+ // We need to remove this state to avoid a memory leak.
446+ self . pending_outbound . remove ( & substream) ;
447+
448+ self . event_handle
449+ . report_notification_stream_open_failure (
450+ peer,
451+ NotificationError :: Rejected ,
452+ )
453+ . await ;
454+ }
438455 // user either initiated an outbound substream or an outbound substream was
439456 // opened/being opened as a result of an accepted inbound substream but was not
440457 // yet fully open
441458 //
442459 // to have consistent state tracking in the user protocol, substream rejection
443460 // must be reported to the user
444- (
445- OutboundState :: OutboundInitiated { .. }
446- | OutboundState :: Negotiating
447- | OutboundState :: Open { .. } ,
448- _,
449- ) => {
461+ ( OutboundState :: Negotiating | OutboundState :: Open { .. } , _) => {
450462 tracing:: debug!(
451463 target: LOG_TARGET ,
452464 ?peer,
You can’t perform that action at this time.
0 commit comments