thruster-rs / Thruster

A fast, middleware based, web framework written in Rust
MIT License
1.06k stars 47 forks source link

bug: Fix multiple packets for a single request #115

Closed trezm closed 5 years ago

trezm commented 5 years ago

Problem: Currently, if a stream sends the headers and then doesn't immediately send the rest of the data, the connection drops the client (because Thruster panics since it doesn't have the right amount of data.)

Solution: If the buffer size doesn't equal the content-length, then we return Ok(None) so that we wait for more data in the stream.