@@ -454,10 +454,12 @@ impl DhtDriver {
454454 }
455455
456456 fn dispatch_rpc_response ( & mut self , inbound_id : InboundId , response : DhtResponse ) {
457+ let self_id = self . endpoint . id ( ) ;
457458 let maybe_send = self . inbound_contexts . remove ( & inbound_id) ;
458459 let io_tx = self . io_tx . clone ( ) ;
459460 tokio:: spawn ( async move {
460461 if let Some ( ( _conn, mut send) ) = maybe_send {
462+ trace ! ( "RPC RESPONSE: from {} to {:?}" , self_id, _conn. to_info( ) ) ;
461463 let _ = write_response_to_stream ( & mut send, & response) . await ;
462464 }
463465 let _ = io_tx. send ( DhtIo :: InboundDropped { inbound_id } ) . await ;
@@ -687,12 +689,14 @@ async fn rpc_request(
687689 peer : NodeId ,
688690 request : DhtRequest ,
689691) -> Result < DhtResponse , DhtIoError > {
692+ trace ! ( "RPC_REQUEST: Connection to {} from {}" , peer, endpoint. id( ) ) ;
690693 let conn = tokio:: time:: timeout ( RPC_TIMEOUT , endpoint. connect ( peer, DHT_ALPN ) )
691694 . await ?
692695 . map_err ( DhtIoError :: network) ?;
693696
694697 let ( mut send, mut recv) = conn. open_bi ( ) . await . map_err ( DhtIoError :: network) ?;
695698
699+ trace ! ( "RPC_REQUEST: Sending request" ) ;
696700 let request_bytes = encode_request ( & request) ?;
697701 let len = ( request_bytes. len ( ) as u32 ) . to_be_bytes ( ) ;
698702 send. write_all ( & len) . await . map_err ( DhtIoError :: network) ?;
@@ -702,6 +706,8 @@ async fn rpc_request(
702706 send. finish ( ) . map_err ( DhtIoError :: network) ?;
703707
704708 let mut len_buf = [ 0u8 ; 4 ] ;
709+
710+ trace ! ( "RPC_REQUEST: Receiving response" ) ;
705711 tokio:: time:: timeout ( RPC_TIMEOUT , recv. read_exact ( & mut len_buf) )
706712 . await ?
707713 . map_err ( DhtIoError :: network) ?;
0 commit comments