From 4ba981ab6d027ff522883fc4896c96425b72939c Mon Sep 17 00:00:00 2001 From: Greedwolf DSS Date: Mon, 15 Jan 2018 12:27:19 +0800 Subject: [PATCH] Guarantee file unchanged! --- examples/send_file.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/send_file.rs b/examples/send_file.rs index 68bc11976a..c085ec106b 100644 --- a/examples/send_file.rs +++ b/examples/send_file.rs @@ -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; }