@@ -148,9 +148,15 @@ where
148148 //
149149 // 16 was chosen arbitrarily, as that is number of pipelined requests
150150 // benchmarks often use. Perhaps it should be a config option instead.
151+ trace ! ( "poll_loop" ) ;
151152 for _ in 0 ..16 {
152- let _ = self . poll_read ( cx) ?;
153+ trace ! ( "poll_read >" ) ;
154+ let ret = self . poll_read ( cx) ;
155+ trace ! ( "poll_read < {:?}" , ret) ;
156+ let _ = ret?;
157+ trace ! ( "poll_write >" ) ;
153158 let _ = self . poll_write ( cx) ?;
159+ trace ! ( "poll_write <" ) ;
154160 let _ = self . poll_flush ( cx) ?;
155161
156162 // This could happen if reading paused before blocking on IO,
@@ -163,6 +169,7 @@ where
163169 // the Conn is noticeably faster in pipelined benchmarks.
164170 if !self . conn . wants_read_again ( ) {
165171 //break;
172+ trace ! ( "! wants_read_again()" ) ;
166173 return Poll :: Ready ( Ok ( ( ) ) ) ;
167174 }
168175 }
@@ -173,7 +180,9 @@ where
173180 }
174181
175182 fn poll_read ( & mut self , cx : & mut task:: Context < ' _ > ) -> Poll < crate :: Result < ( ) > > {
183+ trace ! ( "poll_read >>" ) ;
176184 loop {
185+ trace ! ( "poll_read; loop" ) ;
177186 if self . is_closing {
178187 return Poll :: Ready ( Ok ( ( ) ) ) ;
179188 } else if self . conn . can_read_head ( ) {
@@ -276,6 +285,7 @@ where
276285 }
277286
278287 fn poll_write ( & mut self , cx : & mut task:: Context < ' _ > ) -> Poll < crate :: Result < ( ) > > {
288+ trace ! ( "poll_write" ) ;
279289 loop {
280290 if self . is_closing {
281291 return Poll :: Ready ( Ok ( ( ) ) ) ;
@@ -475,8 +485,11 @@ where
475485 cx : & mut task:: Context < ' _ > ,
476486 ) -> Poll < Option < Result < ( Self :: PollItem , Self :: PollBody ) , Self :: PollError > > > {
477487 let mut this = self . as_mut ( ) ;
488+ trace ! ( "Server::poll_msg ->" ) ;
478489 let ret = if let Some ( ref mut fut) = this. in_flight . as_mut ( ) . as_pin_mut ( ) {
490+ trace ! ( "Server::poll_msg -> polling fut" ) ;
479491 let resp = ready ! ( fut. as_mut( ) . poll( cx) ?) ;
492+ trace ! ( "Server::poll_msg -> response!" ) ;
480493 let ( parts, body) = resp. into_parts ( ) ;
481494 let head = MessageHead {
482495 version : parts. version ,
@@ -495,12 +508,14 @@ where
495508
496509 fn recv_msg ( & mut self , msg : crate :: Result < ( Self :: RecvItem , Body ) > ) -> crate :: Result < ( ) > {
497510 let ( msg, body) = msg?;
511+ trace ! ( "recv_msg; req!" ) ;
498512 let mut req = Request :: new ( body) ;
499513 * req. method_mut ( ) = msg. subject . 0 ;
500514 * req. uri_mut ( ) = msg. subject . 1 ;
501515 * req. headers_mut ( ) = msg. headers ;
502516 * req. version_mut ( ) = msg. version ;
503517 let fut = self . service . call ( req) ;
518+ trace ! ( "recv_msg; service called" ) ;
504519 self . in_flight . set ( Some ( fut) ) ;
505520 Ok ( ( ) )
506521 }
0 commit comments