aboutsummaryrefslogtreecommitdiff
path: root/src/proto.rs
diff options
context:
space:
mode:
authortrinity-1686a <trinity@deuxfleurs.fr>2022-06-08 00:30:56 +0200
committertrinity-1686a <trinity@deuxfleurs.fr>2022-06-08 09:54:38 +0200
commit4745e7c4ba5665d3303ae567087781778cec9c34 (patch)
tree667effc91ab5674360ef0211ab32b533a35f36af /src/proto.rs
parentfb5462ecdb6b5731a63a902519d3ec9b1061b8dd (diff)
downloadnetapp-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.rs5
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)))
}
}
}