1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-02 21:39:26 +00:00

fix dispatcher panic when conbining pipelining and keepalive

fixes #2678
This commit is contained in:
Rob Ede 2022-03-04 03:12:38 +00:00
parent 955c3ac0c4
commit 49cd303c3b
No known key found for this signature in database
GPG key ID: 97C636207D3EF933

View file

@ -375,8 +375,6 @@ where
DispatchError::Io(err)
})?;
this.flags.set(Flags::KEEP_ALIVE, this.codec.keep_alive());
Ok(size)
}
@ -459,7 +457,12 @@ where
}
// all messages are dealt with
None => return Ok(PollResponse::DoNothing),
None => {
// start keep-alive if last request allowed it
this.flags.set(Flags::KEEP_ALIVE, this.codec.keep_alive());
return Ok(PollResponse::DoNothing);
}
},
StateProj::ServiceCall { fut } => {
@ -757,6 +760,7 @@ where
let mut updated = false;
// decode from read buf as many full requests as possible
loop {
match this.codec.decode(this.read_buf) {
Ok(Some(msg)) => {