docs(example): fix send file to only send range of buffer read into

This commit is contained in:
Greedwolf DSS
2018-01-17 03:52:56 +08:00
committed by Sean McArthur
parent 586993fb2f
commit 73511ac8be

View File

@@ -103,7 +103,7 @@ impl Service for ResponseExamples {
tx_body.close().expect("panic closing");
break;
} else {
let chunk: Chunk = buf.to_vec().into();
let chunk: Chunk = buf[0..n].to_vec().into();
match tx_body.send(Ok(chunk)).wait() {
Ok(t) => { tx_body = t; },
Err(_) => { break; }