We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc9a86f commit 3d796d1Copy full SHA for 3d796d1
src/server/conn/http1.rs
@@ -482,7 +482,11 @@ where
482
/// This `Connection` should continue to be polled until shutdown
483
/// can finish.
484
pub fn graceful_shutdown(mut self: Pin<&mut Self>) {
485
- Pin::new(self.inner.as_mut().unwrap()).graceful_shutdown()
+ // Connection (`inner`) is `None` if it was upgraded (and `poll` is `Ready`).
486
+ // In that case, we don't need to call `graceful_shutdown`.
487
+ if let Some(conn) = self.inner.as_mut() {
488
+ Pin::new(conn).graceful_shutdown()
489
+ }
490
}
491
492
0 commit comments