Skip to content

Commit

Permalink
Do not use read_max().
Browse files Browse the repository at this point in the history
This function is a bad idea.
See rwf2#509

This makes Chunked Transfer Encoding to not work with
streaming of small sets of data.
  • Loading branch information
gfriloux committed Mar 29, 2018
1 parent 8b623b2 commit 16720a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/rocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl Rocket {
let mut buffer = vec![0; chunk_size as usize];
let mut stream = hyp_res.start()?;
loop {
match body.read_max(&mut buffer)? {
match body.read(&mut buffer)? {
0 => break,
n => stream.write_all(&buffer[..n])?,
}
Expand Down

0 comments on commit 16720a6

Please sign in to comment.