Improved fix for multi-stream gz files

Instead of throwing an error when we unexpectedly reach a stream EOS, treat it as regular
stream end. This allows for streams that might different encodings for different sections.
Even though we don't recognize the encoding and continue on with the data, at least we
don't fail when we reach this situation.  This allows us safely to try and continue
parsing the next catted gz stream, knowing that if it fails, we will handle it gracefully.
This commit is contained in:
Phil Hord 2020-12-13 13:37:12 -08:00
parent f10a303f54
commit 7ad40f7263
1 changed files with 2 additions and 2 deletions

View File

@ -215,8 +215,8 @@ int line_buffer::gz_indexed::stream_data(void * buf, size_t size)
// Reached end of stream; re-init for a possible subsequent stream
continue_stream();
} else if (err != Z_OK) {
log_error(" inflate-error: %d", (int)err);
throw error(err); // FIXME: exception wrapper
log_error(" inflate-error: %d %s", (int)err, this->strm.msg ? this->strm.msg : "");
break;
}
if (this->strm.total_in >= last + SYNCPOINT_SIZE &&