Revert "MAPREDUCE-7388. Remove unused variable _eof in GzipCodec.cc (#4429)"

This reverts commit fac895828f.
This commit is contained in:
Akira Ajisaka 2022-07-09 03:05:42 +09:00
parent fac895828f
commit 9b1d3579b4
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
2 changed files with 3 additions and 0 deletions

View File

@ -135,6 +135,7 @@ GzipDecompressStream::GzipDecompressStream(InputStream * stream, uint32_t buffer
} }
zstream->next_in = NULL; zstream->next_in = NULL;
zstream->avail_in = 0; zstream->avail_in = 0;
_eof = false;
} }
GzipDecompressStream::~GzipDecompressStream() { GzipDecompressStream::~GzipDecompressStream() {
@ -155,6 +156,7 @@ int32_t GzipDecompressStream::read(void * buff, uint32_t length) {
if (zstream->avail_in == 0) { if (zstream->avail_in == 0) {
int32_t rd = _stream->read(_buffer, _capacity); int32_t rd = _stream->read(_buffer, _capacity);
if (rd <= 0) { if (rd <= 0) {
_eof = true;
size_t wt = zstream->next_out - (Bytef*)buff; size_t wt = zstream->next_out - (Bytef*)buff;
return wt > 0 ? wt : -1; return wt > 0 ? wt : -1;
} else { } else {

View File

@ -60,6 +60,7 @@ protected:
char * _buffer; char * _buffer;
uint32_t _capacity; uint32_t _capacity;
void * _zstream; void * _zstream;
bool _eof;
public: public:
GzipDecompressStream(InputStream * stream, uint32_t bufferSizeHint); GzipDecompressStream(InputStream * stream, uint32_t bufferSizeHint);