From ca83e4f6621384e23a14781c45cc0a72e3d29b48 Mon Sep 17 00:00:00 2001 From: cfg1234 <37607013+cfg1234@users.noreply.github.com> Date: Wed, 22 Jun 2022 15:56:18 +0800 Subject: [PATCH] fix bug for MAPREDUCE-7392 bug for GzipCodec in native task --- .../src/main/native/src/codec/GzipCodec.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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; }