mirror of https://github.com/fafhrd91/actix-web
fix broken pipe for h2 when client is instantly dropped
This commit is contained in:
parent
3188ef5731
commit
79f8480432
|
@ -174,7 +174,13 @@ impl H2ConnectionInner {
|
||||||
/// Cancel spawned connection task on drop.
|
/// Cancel spawned connection task on drop.
|
||||||
impl Drop for H2ConnectionInner {
|
impl Drop for H2ConnectionInner {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
self.handle.abort();
|
if self
|
||||||
|
.sender
|
||||||
|
.send_request(http::Request::new(()), true)
|
||||||
|
.is_err()
|
||||||
|
{
|
||||||
|
self.handle.abort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue