File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -211,12 +211,12 @@ where I: AsyncRead + AsyncWrite,
211211 //
212212 // When writing finishes, we need to wake the task up in case there
213213 // is more reading that can be done, to start a new message.
214- match self . state . reading {
214+ let wants_read = match self . state . reading {
215215 Reading :: Body ( ..) |
216216 Reading :: KeepAlive => return ,
217- Reading :: Init |
218- Reading :: Closed => ( ) ,
219- }
217+ Reading :: Init => true ,
218+ Reading :: Closed => false ,
219+ } ;
220220
221221 match self . state . writing {
222222 Writing :: Continue ( ..) |
@@ -228,10 +228,13 @@ where I: AsyncRead + AsyncWrite,
228228 }
229229
230230 if !self . io . is_read_blocked ( ) {
231- if self . io . read_buf ( ) . is_empty ( ) {
231+ if wants_read && self . io . read_buf ( ) . is_empty ( ) {
232232 match self . io . read_from_io ( ) {
233233 Ok ( Async :: Ready ( _) ) => ( ) ,
234- Ok ( Async :: NotReady ) => return ,
234+ Ok ( Async :: NotReady ) => {
235+ trace ! ( "maybe_notify; read_from_io blocked" ) ;
236+ return
237+ } ,
235238 Err ( e) => {
236239 trace ! ( "maybe_notify read_from_io error: {}" , e) ;
237240 self . state . close ( ) ;
You can’t perform that action at this time.
0 commit comments