@@ -171,13 +171,8 @@ where
171171 for _ in 0 ..16 {
172172 let _ = self . poll_read ( cx) ?;
173173 let _ = self . poll_write ( cx) ?;
174- let conn_ready = self . poll_flush ( cx) ?. is_ready ( ) ;
174+ let _ = self . poll_flush ( cx) ?;
175175
176- // If we can write more body and the connection is ready, we should
177- // write again. If we return `Ready(Ok(())` here, we will yield
178- // without a guaranteed wakeup from the write side of the connection.
179- // This would lead to a deadlock if we also don't expect reads.
180- let wants_write_again = self . can_write_again ( ) && conn_ready;
181176 // This could happen if reading paused before blocking on IO,
182177 // such as getting to the end of a framed message, but then
183178 // writing/flushing set the state back to Init. In that case,
@@ -186,10 +181,7 @@ where
186181 //
187182 // Using this instead of task::current() and notify() inside
188183 // the Conn is noticeably faster in pipelined benchmarks.
189- let wants_read_again = self . conn . wants_read_again ( ) ;
190- // If we cannot write or read again, we yield and rely on the
191- // wakeup from the connection futures.
192- if !( wants_write_again || wants_read_again) {
184+ if !self . conn . wants_read_again ( ) {
193185 //break;
194186 return Poll :: Ready ( Ok ( ( ) ) ) ;
195187 }
@@ -441,11 +433,6 @@ where
441433 self . conn . close_write ( ) ;
442434 }
443435
444- /// If there is pending data in body_rx, we can make progress writing if the connection is ready.
445- fn can_write_again ( & mut self ) -> bool {
446- self . body_rx . is_some ( )
447- }
448-
449436 fn is_done ( & self ) -> bool {
450437 if self . is_closing {
451438 return true ;
0 commit comments