mirror of https://github.com/fafhrd91/actix-web
make sure buf length equals # of initialized bytes
This commit is contained in:
parent
0b4954ed79
commit
00240f9482
|
@ -447,6 +447,7 @@ impl Stream for ChunkedReadFile {
|
||||||
if nbytes == 0 {
|
if nbytes == 0 {
|
||||||
return Err(io::ErrorKind::UnexpectedEof.into());
|
return Err(io::ErrorKind::UnexpectedEof.into());
|
||||||
}
|
}
|
||||||
|
unsafe { buf.set_len(nbytes); }
|
||||||
Ok((file, Bytes::from(buf)))
|
Ok((file, Bytes::from(buf)))
|
||||||
}));
|
}));
|
||||||
self.poll()
|
self.poll()
|
||||||
|
|
Loading…
Reference in New Issue