diff options
author | trinity-1686a <trinity@deuxfleurs.fr> | 2022-06-08 00:30:56 +0200 |
---|---|---|
committer | trinity-1686a <trinity@deuxfleurs.fr> | 2022-06-08 09:54:38 +0200 |
commit | 4745e7c4ba5665d3303ae567087781778cec9c34 (patch) | |
tree | 667effc91ab5674360ef0211ab32b533a35f36af /src/proto.rs | |
parent | fb5462ecdb6b5731a63a902519d3ec9b1061b8dd (diff) | |
download | netapp-4745e7c4ba5665d3303ae567087781778cec9c34.tar.gz netapp-4745e7c4ba5665d3303ae567087781778cec9c34.zip |
further work on streams
most changes still required are related to error handling
Diffstat (limited to 'src/proto.rs')
-rw-r--r-- | src/proto.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/proto.rs b/src/proto.rs index ca1a3d2..073a317 100644 --- a/src/proto.rs +++ b/src/proto.rs @@ -151,9 +151,10 @@ impl Stream for DataReader { } let mut body = [0; MAX_CHUNK_LENGTH as usize]; - body[..buf.len()].copy_from_slice(&buf); + let len = buf.len(); + body[..len].copy_from_slice(buf); buf.clear(); - Poll::Ready(Some((body, MAX_CHUNK_LENGTH as usize))) + Poll::Ready(Some((body, len))) } } } |