File tree 2 files changed +16
-4
lines changed
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -447,6 +447,20 @@ where I: AsyncRead + AsyncWrite,
447
447
448
448
}
449
449
450
+ pub fn shutdown ( & mut self ) -> Poll < ( ) , io:: Error > {
451
+ match self . io . io_mut ( ) . shutdown ( ) {
452
+ Ok ( Async :: NotReady ) => Ok ( Async :: NotReady ) ,
453
+ Ok ( Async :: Ready ( ( ) ) ) => {
454
+ trace ! ( "shut down IO" ) ;
455
+ Ok ( Async :: Ready ( ( ) ) )
456
+ }
457
+ Err ( e) => {
458
+ debug ! ( "error shutting down IO: {}" , e) ;
459
+ Err ( e)
460
+ }
461
+ }
462
+ }
463
+
450
464
pub fn close_read ( & mut self ) {
451
465
self . state . close_read ( ) ;
452
466
}
@@ -540,10 +554,7 @@ where I: AsyncRead + AsyncWrite,
540
554
#[ inline]
541
555
fn close( & mut self ) -> Poll < ( ) , Self :: SinkError > {
542
556
try_ready ! ( self . poll_complete( ) ) ;
543
- self . io. io_mut( ) . shutdown( ) . map_err( |err| {
544
- debug ! ( "error closing: {}" , err) ;
545
- err
546
- } )
557
+ self . shutdown( )
547
558
}
548
559
}
549
560
Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ where
210
210
self . poll_flush ( ) ?;
211
211
212
212
if self . is_done ( ) {
213
+ try_ready ! ( self . conn. shutdown( ) ) ;
213
214
trace ! ( "Dispatch::poll done" ) ;
214
215
Ok ( Async :: Ready ( ( ) ) )
215
216
} else {
You can’t perform that action at this time.
0 commit comments