diff --git a/src/oatpp-zlib/Processor.cpp b/src/oatpp-zlib/Processor.cpp index cf76201..8994f2b 100644 --- a/src/oatpp-zlib/Processor.cpp +++ b/src/oatpp-zlib/Processor.cpp @@ -53,8 +53,14 @@ DeflateEncoder::DeflateEncoder(v_buff_size bufferSize, bool gzip, v_int32 compre 15 | 16, 8 /* default memory */, Z_DEFAULT_STRATEGY); + if(res != Z_OK) { + OATPP_LOGE("[oatpp::zlib::DeflateEncoder::DeflateEncoder()]", "Error. Failed call to 'deflateInit2()'. Result %d", res) + } } else { res = deflateInit(&m_zStream, compressionLevel); + if(res != Z_OK) { + OATPP_LOGE("[oatpp::zlib::DeflateEncoder::DeflateEncoder()]", "Error. Failed call to 'deflateInit()'. Result %d", res) + } } if(res != Z_OK) { @@ -66,7 +72,7 @@ DeflateEncoder::DeflateEncoder(v_buff_size bufferSize, bool gzip, v_int32 compre DeflateEncoder::~DeflateEncoder() { v_int32 res = deflateEnd(&m_zStream); if(res != Z_OK) { - OATPP_LOGE("[oatpp::zlib::DeflateEncoder::~DeflateEncoder()]", "Error. Failed call to 'deflateEnd()'.") + OATPP_LOGE("[oatpp::zlib::DeflateEncoder::~DeflateEncoder()]", "Error. Failed call to 'deflateEnd()'. Result %d", res) } } @@ -185,8 +191,14 @@ DeflateDecoder::DeflateDecoder(v_buff_size bufferSize, bool gzip) if(gzip) { res = inflateInit2(&m_zStream, 15 | 16); + if(res != Z_OK) { + OATPP_LOGE("[oatpp::zlib::DeflateDecoder::DeflateDecoder()]", "Error. Failed call to 'inflateInit2()'. Result %d", res) + } } else { res = inflateInit(&m_zStream); + if(res != Z_OK) { + OATPP_LOGE("[oatpp::zlib::DeflateDecoder::DeflateDecoder()]", "Error. Failed call to 'inflateInit()'. Result %d", res) + } } if(res != Z_OK) { @@ -198,7 +210,7 @@ DeflateDecoder::DeflateDecoder(v_buff_size bufferSize, bool gzip) DeflateDecoder::~DeflateDecoder() { v_int32 res = inflateEnd(&m_zStream); if(res != Z_OK) { - OATPP_LOGE("[oatpp::zlib::DeflateDecoder::~DeflateDecoder()]", "Error. Failed call to 'inflateEnd()'.") + OATPP_LOGE("[oatpp::zlib::DeflateDecoder::~DeflateDecoder()]", "Error. Failed call to 'inflateEnd()'. Result %d", res) } }