diff --git a/src/h1/client.rs b/src/h1/client.rs index de4d10e1b..851851266 100644 --- a/src/h1/client.rs +++ b/src/h1/client.rs @@ -211,6 +211,7 @@ impl Encoder for ClientCodec { dst, &mut msg, false, + false, inner.version, length, inner.ctype, diff --git a/src/h1/codec.rs b/src/h1/codec.rs index 23feda505..c66364c02 100644 --- a/src/h1/codec.rs +++ b/src/h1/codec.rs @@ -170,6 +170,7 @@ impl Encoder for Codec { dst, &mut res, self.flags.contains(Flags::HEAD), + self.flags.contains(Flags::STREAM), self.version, length, self.ctype, diff --git a/src/h1/dispatcher.rs b/src/h1/dispatcher.rs index 8543aa213..82813a526 100644 --- a/src/h1/dispatcher.rs +++ b/src/h1/dispatcher.rs @@ -323,17 +323,17 @@ where match msg { Message::Item(mut req) => { match self.framed.get_codec().message_type() { - MessageType::Payload => { + MessageType::Payload | MessageType::Stream => { let (ps, pl) = Payload::create(false); let (req1, _) = req.replace_payload(crate::Payload::H1(pl)); req = req1; self.payload = Some(ps); } - MessageType::Stream => { - self.unhandled = Some(req); - return Ok(updated); - } + //MessageType::Stream => { + // self.unhandled = Some(req); + // return Ok(updated); + //} _ => (), } diff --git a/src/h1/encoder.rs b/src/h1/encoder.rs index 9fe5ba69a..712d123eb 100644 --- a/src/h1/encoder.rs +++ b/src/h1/encoder.rs @@ -241,6 +241,7 @@ impl MessageEncoder { dst: &mut BytesMut, message: &mut T, head: bool, + stream: bool, version: Version, length: BodyLength, ctype: ConnectionType, @@ -253,7 +254,7 @@ impl MessageEncoder { BodyLength::Sized(len) => TransferEncoding::length(len as u64), BodyLength::Sized64(len) => TransferEncoding::length(len), BodyLength::Stream => { - if message.chunked() { + if message.chunked() && !stream { TransferEncoding::chunked() } else { TransferEncoding::eof()