1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-29 08:09:18 +02:00

fix stuck connection when handler doesn't read payload (#2624)

This commit is contained in:
Rob Ede
2022-02-03 07:03:39 +00:00
committed by GitHub
parent fc5ecdc30b
commit 5ca42df89a
6 changed files with 307 additions and 27 deletions

View File

@@ -125,11 +125,13 @@ impl Decoder for Codec {
self.flags.set(Flags::HEAD, head.method == Method::HEAD);
self.version = head.version;
self.conn_type = head.connection_type();
if self.conn_type == ConnectionType::KeepAlive
&& !self.flags.contains(Flags::KEEP_ALIVE_ENABLED)
{
self.conn_type = ConnectionType::Close
}
match payload {
PayloadType::None => self.payload = None,
PayloadType::Payload(pl) => self.payload = Some(pl),