4813885: RFE: GZIPOutputStream should implement flush using Z_SYNC_FLUSH

Xueming Shen xueming.shen at ORACLE.COM
Thu May 13 07:11:30 UTC 2010

Martin Buchholz wrote:
> On Wed, May 12, 2010 at 23:46, Xueming Shen <xueming.shen at oracle.com> wrote:
>> Thanks for the review.
>> The Z_SYNC_FLUSH is supposed to fully replace the Z_PARTIAL_FLUSH.
>> We concluded last round that Z_SYNC_FLUSH is enough for the "high-level"
>> DOS, as well as the GZIPOS, use Deflater directly if  more needed. I hope
>> you
>> are not suggesting we go back to redo the flush to int.
> Maybe we should.
> http://www.jcraft.com/jzlib/
> """
> To implement this functionality, the Z_PARTIAL_FLUSH mode of zlib must
> be used, however JDK does not permit us to do so. It seems that this
> problem has been well known and some people have already reported to
> JavaSoft's BugParade(for example, BugId:4255743), but any positive
> response has not been returned from JavaSoft, so this problem will not
> be solved forever. This is our motivation to hack JZlib.
> """
I thought I had closed this one (#4255743) as the dup of #4206909.

This is actually why we did 4206909 and now doing #4813885. With the fix 
for #4206909, you no
longer need jzlib:-) Yes, we use Z_SYNC_FLUSH, not Z_PARTIAL_FLUSH 
because the later is going
away, replaced by Z_SYNC_FLUSH. They are the same thing.

So with #4206909 and #4813885 you can now  sync_flush the 
GZIPOutputStream and
DeflaterOutputStream, as needed by the "functionality" mentioned in jzlib.


More information about the core-libs-dev mailing list