mirror of https://github.com/fafhrd91/actix-web
fix(awc): prevent panics in pool drop for h1 connections
This commit is contained in:
parent
538c1bea34
commit
c057605eb7
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Prevent panics on connection pool drop when Tokio runtime is shutdown early.
|
||||||
|
|
||||||
## 3.5.1
|
## 3.5.1
|
||||||
|
|
||||||
- Fix WebSocket `Host` request header value when using a non-default port.
|
- Fix WebSocket `Host` request header value when using a non-default port.
|
||||||
|
|
|
@ -76,7 +76,9 @@ where
|
||||||
fn close(&self, conn: ConnectionInnerType<Io>) {
|
fn close(&self, conn: ConnectionInnerType<Io>) {
|
||||||
if let Some(timeout) = self.config.disconnect_timeout {
|
if let Some(timeout) = self.config.disconnect_timeout {
|
||||||
if let ConnectionInnerType::H1(io) = conn {
|
if let ConnectionInnerType::H1(io) = conn {
|
||||||
actix_rt::spawn(CloseConnection::new(io, timeout));
|
if tokio::runtime::Handle::try_current().is_ok() {
|
||||||
|
actix_rt::spawn(CloseConnection::new(io, timeout));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue