Skip to content

Commit

Permalink
Make sure to report compression errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Oct 11, 2015
1 parent 7171d6c commit fce16e9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/output.cpp
Expand Up @@ -110,7 +110,12 @@ void Output::Enqueue(int64_t pos, uint8_t *buffer) {
sector->DisableCompress();
}
sector->Process(pos, buffer, [this, sector, block](bool status, const char *reason) {
if (!status) {
finish_(false, reason);
return;
}
if (blockSize_ != SECTOR_SIZE) {
// Not in progress anymore.
partialSectors_.erase(block);
}
HandleReadySector(sector);
Expand All @@ -126,6 +131,10 @@ void Output::Enqueue(int64_t pos, uint8_t *buffer) {
uint8_t *padBuffer = pool.Alloc();
memset(padBuffer, 0, SECTOR_SIZE);
sector->Process(padPos, padBuffer, [this, sector, block](bool status, const char *reason) {
if (!status) {
finish_(false, reason);
return;
}
partialSectors_.erase(block);
HandleReadySector(sector);
});
Expand Down

0 comments on commit fce16e9

Please sign in to comment.