-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
C-bugCategory: bug. Something is wrong. This is bad!Category: bug. Something is wrong. This is bad!
Description
Version
Encountered with 1.x
Platform
Doesn't matter
Description
Attempt to call graceful_shutdown
for H1 connection which is upgraded (=> Poll::Ready
) leads to panic:
panic was raised: panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.2.0/src/server/conn/http1.rs:483:38:
called `Option::unwrap()` on a `None` value
The reason is this line:
Pin::new(self.inner.as_mut().unwrap()).graceful_shutdown()
When connection is Upgraded (& future is Ready
), it's None
hyper/src/server/conn/http1.rs
Lines 502 to 506 in bc9a86f
Ok(proto::Dispatched::Upgrade(pending)) => { | |
let (io, buf, _) = self.inner.take().unwrap().conn.into_inner(); | |
pending.fulfill(Upgraded::new(io, buf)); | |
Poll::Ready(Ok(())) | |
} |
So we should avoid unwrapping
Metadata
Metadata
Assignees
Labels
C-bugCategory: bug. Something is wrong. This is bad!Category: bug. Something is wrong. This is bad!