fix(http1): return error if user body ends prematurely
- update proto::h1::end_body to return Result<()> - update Encoder::end to return Error(NotEof) only when there's Content-length left to be addressed Closes #2263
This commit is contained in:
		| @@ -338,7 +338,7 @@ where | ||||
|                             *clear_body = true; | ||||
|                             if chunk.remaining() == 0 { | ||||
|                                 trace!("discarding empty chunk"); | ||||
|                                 self.conn.end_body(); | ||||
|                                 self.conn.end_body()?; | ||||
|                             } else { | ||||
|                                 self.conn.write_body_and_end(chunk); | ||||
|                             } | ||||
| @@ -351,7 +351,7 @@ where | ||||
|                         } | ||||
|                     } else { | ||||
|                         *clear_body = true; | ||||
|                         self.conn.end_body(); | ||||
|                         self.conn.end_body()?; | ||||
|                     } | ||||
|                 } else { | ||||
|                     return Poll::Pending; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user