diff options
author | lloyd <[email protected]> | 2015-05-13 03:00:10 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-05-13 03:00:10 +0000 |
commit | cb2b4498d2a0c8a15e2a66aa3c5f0d7ffa4cf058 (patch) | |
tree | c002be7e34bd0c6973b9d49f92ee7973c5152e59 /src/lib/compression/zlib/zlib.cpp | |
parent | a1524df3c1b7bee3bfd7cab3309f763b3e9599a7 (diff) |
Add tests for compression and SRP.
Fix zlib decompression which was not ignoring Z_BUF_ERROR which is
harmless in this context as process is already checking avail_in
and avail_out after run returns.
Bump version to 1.11.17
Diffstat (limited to 'src/lib/compression/zlib/zlib.cpp')
-rw-r--r-- | src/lib/compression/zlib/zlib.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/compression/zlib/zlib.cpp b/src/lib/compression/zlib/zlib.cpp index 415bbccac..a6a724754 100644 --- a/src/lib/compression/zlib/zlib.cpp +++ b/src/lib/compression/zlib/zlib.cpp @@ -67,8 +67,8 @@ class Zlib_Compression_Stream : public Zlib_Stream if(rc == Z_MEM_ERROR) throw std::bad_alloc(); - else if(rc != Z_OK && rc != Z_STREAM_END) - throw std::runtime_error("zlib deflate error"); + else if(rc != Z_OK && rc != Z_STREAM_END && rc != Z_BUF_ERROR) + throw std::runtime_error("zlib deflate error " + std::to_string(rc)); return (rc == Z_STREAM_END); } @@ -98,8 +98,8 @@ class Zlib_Decompression_Stream : public Zlib_Stream if(rc == Z_MEM_ERROR) throw std::bad_alloc(); - else if(rc != Z_OK && rc != Z_STREAM_END) - throw std::runtime_error("zlib deflate error"); + else if(rc != Z_OK && rc != Z_STREAM_END && rc != Z_BUF_ERROR) + throw std::runtime_error("zlib inflate error " + std::to_string(rc)); return (rc == Z_STREAM_END); } |