fix bug for MAPREDUCE-7392 bug for GzipCodec in native task

This commit is contained in:
cfg1234 2022-06-22 15:56:18 +08:00 committed by GitHub
parent e8fd914c58
commit ca83e4f662
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -167,6 +167,12 @@ int32_t GzipDecompressStream::read(void * buff, uint32_t length) {
} }
int ret = inflate(zstream, Z_NO_FLUSH); int ret = inflate(zstream, Z_NO_FLUSH);
if (ret == Z_OK || ret == Z_STREAM_END) { if (ret == Z_OK || ret == Z_STREAM_END) {
if (ret == Z_STREAM_END) {
int resetRet = inflateReset(zstream);
if (resetRet != Z_OK) {
return resetRet;
}
}
if (zstream->avail_out == 0) { if (zstream->avail_out == 0) {
return length; return length;
} }