diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.cc b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.cc index b0b985296c8..c84197a8b26 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.cc +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.cc @@ -167,6 +167,12 @@ int32_t GzipDecompressStream::read(void * buff, uint32_t length) { } int ret = inflate(zstream, Z_NO_FLUSH); 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) { return length; }