@@ -509,26 +509,28 @@ where
509
509
message : Ok ( RPCReceived :: Request ( request) ) ,
510
510
} ) ) ;
511
511
}
512
- HandlerEvent :: Ok ( rpc) => {
513
- // Inform the limiter that a response has been received.
514
- match & rpc {
515
- RPCReceived :: Request ( _) => unreachable ! ( ) ,
516
- RPCReceived :: Response ( _id, response) => {
517
- if response. protocol ( ) . terminator ( ) . is_none ( ) {
518
- self . outbound_request_limiter
519
- . request_completed ( & peer_id, response. protocol ( ) ) ;
520
- }
521
- }
522
- RPCReceived :: EndOfStream ( _id, response_termination) => {
523
- self . outbound_request_limiter
524
- . request_completed ( & peer_id, response_termination. as_protocol ( ) ) ;
525
- }
512
+ HandlerEvent :: Ok ( RPCReceived :: Response ( id, response) ) => {
513
+ if response. protocol ( ) . terminator ( ) . is_none ( ) {
514
+ // Inform the limiter that a response has been received.
515
+ self . outbound_request_limiter
516
+ . request_completed ( & peer_id, response. protocol ( ) ) ;
526
517
}
527
518
528
519
self . events . push ( ToSwarm :: GenerateEvent ( RPCMessage {
529
520
peer_id,
530
521
conn_id,
531
- message : Ok ( rpc) ,
522
+ message : Ok ( RPCReceived :: Response ( id, response) ) ,
523
+ } ) ) ;
524
+ }
525
+ HandlerEvent :: Ok ( RPCReceived :: EndOfStream ( id, response_termination) ) => {
526
+ // Inform the limiter that a response has been received.
527
+ self . outbound_request_limiter
528
+ . request_completed ( & peer_id, response_termination. as_protocol ( ) ) ;
529
+
530
+ self . events . push ( ToSwarm :: GenerateEvent ( RPCMessage {
531
+ peer_id,
532
+ conn_id,
533
+ message : Ok ( RPCReceived :: EndOfStream ( id, response_termination) ) ,
532
534
} ) ) ;
533
535
}
534
536
HandlerEvent :: Err ( err) => {
0 commit comments