[ruby-cvs:54475] normal:r47327 (trunk): zlib: GzipReader#rewind preserves ZSTREAM_FLAG_GZFILE

normal at ruby-lang.org normal at ruby-lang.org
Sun Aug 31 08:53:29 JST 2014


normal	2014-08-31 08:53:28 +0900 (Sun, 31 Aug 2014)

  New Revision: 47327

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47327

  Log:
    zlib: GzipReader#rewind preserves ZSTREAM_FLAG_GZFILE
    
    * ext/zlib/zlib.c (gzfile_reset): preserve ZSTREAM_FLAG_GZFILE
      [Bug #10101]
    
    * test/zlib/test_zlib.rb (test_rewind): test each_byte
    
    We must preserve the ZSTREAM_FLAG_GZFILE flag to prevent
    zstream_detach_buffer from:
    
    a) returning Qnil and breaking out of the `each_byte' loop
    b) yielding a large string to each_byte
    
    Note: the test case in bug report takes a long time.  I found this
    bug because I noticed the massive time descrepancy between
    `each_byte' and `readbyte' loop before this patch.  With this patch,
    `each_byte' and `readbyte' both take very long.

  Modified files:
    trunk/ChangeLog
    trunk/ext/zlib/zlib.c
    trunk/test/zlib/test_zlib.rb


More information about the ruby-cvs mailing list