This commit is contained in:
parent
47d0aee9f8
commit
b3b0b20d72
1 changed files with 8 additions and 2 deletions
|
@ -302,8 +302,14 @@ impl BodyChunker {
|
||||||
if self.buf.len() == 0 {
|
if self.buf.len() == 0 {
|
||||||
Ok(None)
|
Ok(None)
|
||||||
} else {
|
} else {
|
||||||
let mut iter = FastCDC::with_eof(self.buf.make_contiguous(), self.min_block_size, self.avg_block_size, self.max_block_size, self.read_all);
|
let mut iter = FastCDC::with_eof(
|
||||||
if let Some(Chunk {length, ..}) = iter.next() {
|
self.buf.make_contiguous(),
|
||||||
|
self.min_block_size,
|
||||||
|
self.avg_block_size,
|
||||||
|
self.max_block_size,
|
||||||
|
self.read_all,
|
||||||
|
);
|
||||||
|
if let Some(Chunk { length, .. }) = iter.next() {
|
||||||
let block = self.buf.drain(..length).collect::<Vec<u8>>();
|
let block = self.buf.drain(..length).collect::<Vec<u8>>();
|
||||||
Ok(Some(block))
|
Ok(Some(block))
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue