File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -502,14 +502,21 @@ where
502502 ///
503503 /// This `Connection` should continue to be polled until shutdown
504504 /// can finish.
505+ ///
506+ /// # Note
507+ ///
508+ /// This should only be called while the `Connection` future is still
509+ /// pending. If called after `Connection::poll` has resolved, this does
510+ /// nothing.
505511 pub fn graceful_shutdown ( self : Pin < & mut Self > ) {
506- match self . project ( ) . conn . as_mut ( ) . unwrap ( ) {
507- ProtoServer :: H1 ( ref mut h1) => {
512+ match self . project ( ) . conn {
513+ Some ( ProtoServer :: H1 ( ref mut h1) ) => {
508514 h1. disable_keep_alive ( ) ;
509515 }
510- ProtoServer :: H2 ( ref mut h2) => {
516+ Some ( ProtoServer :: H2 ( ref mut h2) ) => {
511517 h2. graceful_shutdown ( ) ;
512518 }
519+ None => ( ) ,
513520 }
514521 }
515522
You can’t perform that action at this time.
0 commit comments