lidavidm commented on a change in pull request #9680:
URL: https://github.com/apache/arrow/pull/9680#discussion_r594361470



##########
File path: cpp/src/arrow/util/compression_zlib.cc
##########
@@ -246,7 +246,7 @@ class GZipCompressor : public Compressor {
     //  again with the same value of the flush parameter and more output space
     //  (updated avail_out), until the flush is complete (deflate returns
     //  with non-zero avail_out)."
-    return FlushResult{bytes_written, (bytes_written == 0)};
+    return FlushResult{bytes_written, (ret == Z_BUF_ERROR && stream_.avail_out 
== 0)};

Review comment:
       Hmm, looks like it should just be `avail_out == 0` after all, as I also 
see this comment in zlib.h:
   
   ```
     If deflate returns Z_OK and with
     zero avail_out, it must be called again after making room in the output
     buffer because there might be more output pending
   ```
   Whereas in the comment already cited, there's no mention of the expected 
return code.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to