1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-09-30 15:22:02 +00:00

fix extra branch in h1 dispatcher timer (#1882)

This commit is contained in:
fakeshadow 2021-01-08 04:42:09 +08:00 committed by GitHub
parent c09186a2c0
commit a4c9aaf337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -687,15 +687,11 @@ where
if let Some(deadline) =
this.codec.config().client_disconnect_timer()
{
if let Some(timer) = this.ka_timer.as_mut().as_pin_mut()
if let Some(mut timer) =
this.ka_timer.as_mut().as_pin_mut()
{
timer.reset(deadline);
let _ = this
.ka_timer
.as_mut()
.as_pin_mut()
.unwrap()
.poll(cx);
timer.as_mut().reset(deadline);
let _ = timer.poll(cx);
}
} else {
// no shutdown timeout, drop socket
@ -720,15 +716,14 @@ where
} else if let Some(deadline) =
this.codec.config().keep_alive_expire()
{
if let Some(timer) = this.ka_timer.as_mut().as_pin_mut() {
timer.reset(deadline);
let _ =
this.ka_timer.as_mut().as_pin_mut().unwrap().poll(cx);
if let Some(mut timer) = this.ka_timer.as_mut().as_pin_mut() {
timer.as_mut().reset(deadline);
let _ = timer.poll(cx);
}
}
} else if let Some(timer) = this.ka_timer.as_mut().as_pin_mut() {
timer.reset(*this.ka_expire);
let _ = this.ka_timer.as_mut().as_pin_mut().unwrap().poll(cx);
} else if let Some(mut timer) = this.ka_timer.as_mut().as_pin_mut() {
timer.as_mut().reset(*this.ka_expire);
let _ = timer.poll(cx);
}
}
Poll::Pending => {}