mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-19 11:19:36 +00:00
Treat a zero payload limit as none when decompressing a stream
set_payload_max_length(0) means no limit, but StreamHandle compared the decompressed size against 0, so every compressed response read through the streaming API failed.
This commit is contained in:
1 parent
d41d5586cf
commit
194f392417
2 files changed
+13
-4
No files matched your search
@@ -15598,10 +15598,8 @@ inline ssize_t ClientImpl::StreamHandle::read_with_decompression(char *buf,
|
||||
[this](const char *data, size_t data_len) {
|
||||
decompress_buffer_.append(data, data_len);
|
||||
auto limit = body_reader_.payload_max_length;
|
||||
if (decompressed_bytes_read_ + decompress_buffer_.size() > limit) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return limit == 0 ||
|
||||
decompressed_bytes_read_ + decompress_buffer_.size() <= limit;
|
||||
});
|
||||
|
||||
if (!decompress_ok) {
|
||||
|
||||
Reference in new issue
Block a user