Fix gzip_decompressor in case of one chunk being exactly equal to buffer size (#636)

* add larget chunks test

* revert test

* Fix gzip decoder in case of chunk being equal to buffer size

* add test
This commit is contained in:
Ivan Fefer 2020-09-03 19:20:02 +03:00 committed by GitHub
parent 69e75f4a67
commit 3b5bab3308
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 2 deletions

View file

@ -2267,7 +2267,7 @@ public:
strm_.next_in = const_cast<Bytef *>(reinterpret_cast<const Bytef *>(data));
std::array<char, 16384> buff{};
do {
while (strm_.avail_in > 0) {
strm_.avail_out = buff.size();
strm_.next_out = reinterpret_cast<Bytef *>(buff.data());
@ -2282,7 +2282,7 @@ public:
if (!callback(buff.data(), buff.size() - strm_.avail_out)) {
return false;
}
} while (strm_.avail_out == 0);
}
return ret == Z_OK || ret == Z_STREAM_END;
}