diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/base/bzip2_filter.cc | 6 | ||||
-rw-r--r-- | net/base/gzip_filter.cc | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/net/base/bzip2_filter.cc b/net/base/bzip2_filter.cc index ac6aa11..ce825a3 100644 --- a/net/base/bzip2_filter.cc +++ b/net/base/bzip2_filter.cc @@ -56,8 +56,10 @@ Filter::FilterStatus BZip2Filter::ReadFilteredData(char* dest_buffer, return status; // Make sure we have valid input data - if (!next_stream_data_ || stream_data_len_ <= 0) - return status; + if (!next_stream_data_ || stream_data_len_ <= 0) { + *dest_len = 0; + return Filter::FILTER_NEED_MORE_DATA; + } // Fill in bzip2 control block int ret, output_len = *dest_len; diff --git a/net/base/gzip_filter.cc b/net/base/gzip_filter.cc index ff7c1f4..3212e89 100644 --- a/net/base/gzip_filter.cc +++ b/net/base/gzip_filter.cc @@ -197,8 +197,10 @@ Filter::FilterStatus GZipFilter::DoInflate(char* dest_buffer, int* dest_len) { if (!dest_buffer || !dest_len || *dest_len <= 0) // output return Filter::FILTER_ERROR; - if (!next_stream_data_ || stream_data_len_ <= 0) // input - return Filter::FILTER_ERROR; + if (!next_stream_data_ || stream_data_len_ <= 0) { // input + *dest_len = 0; + return Filter::FILTER_NEED_MORE_DATA; + } // Fill in zlib control block zlib_stream_.get()->next_in = bit_cast<Bytef*>(next_stream_data_); |