Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
Fixed termination determination
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenldl committed Jul 7, 2019
1 parent 0838781 commit 24799a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/encode_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,6 @@ pub fn encode_file(param: &Param) -> Result<Stats, Error> {
buffer.cancel_slot();
run = false;
break;
} else if read_res.len_read < data_size {
*content_len_exc_header = Some(read_res.len_read);
run = false;
}

if let Err(_) = block_for_seq_num_check.add1_seq_num() {
Expand All @@ -680,6 +677,11 @@ pub fn encode_file(param: &Param) -> Result<Stats, Error> {
if let Some(ref mut hash_ctx) = *hash_ctx {
hash_ctx.update(&slot[..read_res.len_read]);
}

if read_res.len_read < data_size {
*content_len_exc_header = Some(read_res.len_read);
run = false;
}
}
Err(e) => stop_run_forward_error!(run => error_tx_reader => e),
}
Expand Down

0 comments on commit 24799a8

Please sign in to comment.