mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
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:
parent
69e75f4a67
commit
3b5bab3308
2 changed files with 45 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue