We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85c6bec commit d6da3f7Copy full SHA for d6da3f7
src/http/conn.rs
@@ -269,6 +269,10 @@ where I: AsyncRead + AsyncWrite,
269
return Ok(AsyncSink::NotReady(chunk));
270
}
271
if let Some(chunk) = chunk {
272
+ if chunk.as_ref().is_empty() {
273
+ return Ok(AsyncSink::Ready);
274
+ }
275
+
276
let mut cursor = Cursor::new(chunk);
277
match encoder.encode(&mut self.io, cursor.buf()) {
278
Ok(n) => {
src/http/h1/encode.rs
@@ -63,7 +63,7 @@ impl Encoder {
63
};
64
65
if n == 0 {
66
- return Err(io::Error::new(io::ErrorKind::WouldBlock, "would block"));
+ return Err(io::Error::new(io::ErrorKind::WriteZero, "write zero"));
67
68
69
*remaining -= n as u64;
0 commit comments