H
henry.jykim
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?
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?