- if ( (Z_OK == (status = deflateInit2(&Z, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY))) &&
- (Z_STREAM_END == (status = deflate(&Z, Z_FINISH))) &&
- (Z_OK == (status = deflateEnd(&Z)))) {
- *encoded_len = http_finish_gzencode_buffer(&Z, data, data_len, encoded);
- return SUCCESS;
+ if (Z_OK == (status = deflateInit2(&Z, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY))) {
+ status = deflate(&Z, Z_FINISH);
+ deflateEnd(&Z);
+
+ if (Z_STREAM_END == status) {
+ *encoded_len = http_finish_gzencode_buffer(&Z, data, data_len, encoded);
+ return SUCCESS;
+ }