File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -344,13 +344,13 @@ where
344344
345345 #[ inline]
346346 fn poll_shutdown ( & self , cx : & mut Context < ' _ > , is_error : bool ) -> Poll < ( ) > {
347- let ready = self . tcp_pool . poll_shutdown ( cx, is_error) . is_ready ( ) ;
348- let ready = if let Some ( ref ssl_pool ) = self . ssl_pool {
349- ssl_pool . poll_shutdown ( cx , is_error ) . is_ready ( ) && ready
350- } else {
351- ready
352- } ;
353- if ready {
347+ let tcp_ready = self . tcp_pool . poll_shutdown ( cx, is_error) . is_ready ( ) ;
348+ let ssl_ready = self
349+ . ssl_pool
350+ . as_ref ( )
351+ . map ( |pool| pool . poll_shutdown ( cx , is_error ) . is_ready ( ) )
352+ . unwrap_or ( true ) ;
353+ if tcp_ready && ssl_ready {
354354 Poll :: Ready ( ( ) )
355355 } else {
356356 Poll :: Pending
Original file line number Diff line number Diff line change @@ -666,5 +666,8 @@ mod tests {
666666 delay_for ( Duration :: from_millis ( 50 ) ) . await ;
667667 pool. 1 . borrow_mut ( ) . check_availibility ( ) ;
668668 assert ! ( pool. 1 . borrow( ) . waiters. is_empty( ) ) ;
669+
670+ assert ! ( lazy( |cx| pool. poll_ready( cx) ) . await . is_ready( ) ) ;
671+ assert ! ( lazy( |cx| pool. poll_shutdown( cx, false ) ) . await . is_ready( ) ) ;
669672 }
670673}
You can’t perform that action at this time.
0 commit comments