henry...@gmail.com
unread,Apr 8, 2013, 11:51:58 AM4/8/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi, all.
to decode responses from web-servers, I am using GzipReader class to read it.
HEADERS = {
'Accept-Encoding' => 'gzip,deflate',
'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Keep-Alive' => '300',
'Connection' => 'keep-alive',
'Cache-Control' => 'max-age=0'
}
response = open(@url, HEADERS).read
contents = Zlib::GzipReader.new(StringIO.new(response)).read
json = JSON.load contents
but, sometimes, when I got 'crc error' caused by GzipRader.new().
line from zlib.rb
...
raise CRCError, 'invalid compressed data -- crc error' unless @crc == crc
...
the programs is under multi-threads.
using jruby 1.7.3
is this library having concurrency problems?