hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1550) "deflate" encoding issue : java.util.zip.ZipException: invalid stored block lengths
Date Wed, 03 Sep 2014 15:40:53 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14119980#comment-14119980
] 

Oleg Kalnichevski commented on HTTPCLIENT-1550:
-----------------------------------------------

The body sent by the server does not appear to be a valid Zlib or Deflate compressed content.
I am not sure what I can do about it. 

{noformat}
[DEBUG] wire - http-outgoing-0 >> "GET /download/72441827/BackTrack5R3.Gnome.iSO.32bit-LiNUX-0171-bt5r2gis32.par2.nzb
HTTP/1.1[\r][\n]"
[DEBUG] wire - http-outgoing-0 >> "Host: nzbindex.nl[\r][\n]"
[DEBUG] wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.3.5 (java 1.5)[\r][\n]"
[DEBUG] wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
[DEBUG] wire - http-outgoing-0 >> "[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "Server: nginx[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "Date: Wed, 03 Sep 2014 15:38:04 GMT[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "Content-Type: application/x-nzb[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "Transfer-Encoding: chunked[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "Connection: close[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "Pragma: cache[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "Content-Disposition: attachment; filename="bt5r2gis32.par2.nzb"[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "Content-Encoding: deflate[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "Expires: Thu, 04 Sep 2014 15:38:04 GMT[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "Cache-Control: max-age=86400[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "1f5d[\r][\n]"
[DEBUG] wire - http-outgoing-0 << "x[0x9c][0xbc][0xbd][[0xaf]`Iv[0x9c][0xf7][0xae]_[0xd1][0xee][0x7][0xc3]~[0x98][0xd3]y[y[0xb1]I[0xca][0xa0]$[0x8][0x2][0x4]I[0xb0])[0xc0][0x17][0xf8]a[0x86]l[0xd3]c[0x93]=[0xf4][0xf4][0xd0][0x94][0xf4][0xeb][0xbd]b[0x97][0x8c][0x89][0x90]w[0xc2][0xaa][0xa8][0xae][0xe2]CuKC[0xc6][0x9c][0xda]g[0xe7][0xce][0xcc][0xf5][0xad][0x15][0xf1]'[0xff][0xf8][0xdf][0xfd][0xed][0xdf]|[0xf7][0xff][0xf8][0xfb][0x9f][0xfb][0xbb][0x9f][0xfe][0xf4][0xfb][0xfa]Q[0xbe][0xff][0xee][0xc7][0x9f][0xfe][0xf2]w[0xf5][0xdb][0x9f][0xfe][0xfa]O[0xbf][0xff][0xed][0xcf][0xbf][0xfb][0xd5][0xde]q~U[0xbf][0xff][0xee][0x1f][0xff][0xd9]?[0xfa][0x93][0xff][0xe2][0x9f][0xfe][0xeb][0xf2][0x17][0xff][0xd3][0xbf][0xf9]g[0xdf][0xfd][0xf4][0x1f]~[0xf3][0xdd][0xbf][0xf9][0xb7][0xfe]/[0xff][0xc5]?[0xf9][0xee][0xfb]_[0xfd][0xf0][0xc3]O?[0xfe][0xc3][0xf8][0xf3][0xdf][0xfe][0xf4][0xc3][0xf][0xff][0xf4]/[0xfe][0xe9]w[0xff][0xea][0xfe][0xf3][0xef]R[0xe7][0x87][0x1f][0xfe][0xd9][0xbf][0xfa][0xfe][0xbb][0xef][0xff][0xf7]?[0xfc][0xe1][0xef][0xfe][0x9b][0x1f]~[0xf8][0x87][0xf8][0x87][0x8f][0xfc]?[0xfa][0xed]O[0xf5][0xe3][0xbf][0xfb][0xf8][0xcb][0xdf][0xfd][0xed][0xf][0xf9][0xff][0xf8]U[0xfe]o}[0xfc][0xd5][0x1f][0xfe][0xea]{([0xff][0xea]W[0xcf][0xff][0xe1]?[0xff][0xf1][0xa7][0x1f][0xff][0xeb]?[0xfc][0xf8]W[0xdf][0xfd][0xe6][0xdf][0xe3][0xff][0xe3]_[0xe0][0xff][0xe0][0xbb]_[0xfd]*[0xff]W[0xf0][0xdf][0x99]?[0xec]O?[0xff][0xa9][0x88][0xe6]u[0xca]>[0x9a][0xf9][0xdf][0xfe]C+[0xa5]C[0x1c][0xa2][0xff][0xdb]o[0xff][0xe6][0xc7][0xef][0xfe][0xee]w?[0xff][0xe1][0xc7][0xdf][0xff][0xe9][0xf7][0xf3][0xdb][0x9f][0xfe][0xfe][0xdf][0xfd][0xed][0xaf][0xfa][0xfe][0xbb][0xbf]J[0xfd][0xfc][0xab][0xf6][0x11][0xa5][0xaf][0x88][0xfe][0xfd]w?[0xff][0xfd]o[0xfe][0x8f][0x1f][0xff][0xf2][0xf][0xfa][0xfd][0x9f][0xff][0xfa]/[0xff][0xcf][0xbf][0xf8]}[0xfe][0x11][0xff]}[0xff][0xf8][0xe7]?[0xfd][0xee]o[0xfc][0xf8][0xed][0xff][0xf0][0xaf]?z[0xfb][0xcd]o[0xff][0xf0][0xab][0xf9][0xdb][0xf5]o[0xff][0xc7][0xef][0xfe][0x97]RX[0xf5][0xfd][0xee]W[0xdf][0xfd][0x97][0xff][0xd7][0xdf][0xff][0xee][0xf][0xff][0xed]o[0xfe][0x10][0xbf]o[0xfd][0xdb][0x9f]{[0xfb][0xf8][0xbb]_[0xff][0xbe]}[0xfa][0xff][0xfc][0xee][0xdf][0xff][0xb3][0x9f][0xfe][0xf2][0xbb][0xff][0xaa][0xfe]P[0xff]k[0xfc]
[0xfd][0xfb][0xdf][0xfd][0xfd][0xdf][0xfd][0xfc][0xff][0xfe][0xcb][0x9f][0xfd][0xfa]o[0xfe][0xf0][0x91]?[0xf3][0xaf][0xff][0xdb][0x1f][0xfe][0xf8][0xcd][0xef]~[0xfa][0xf1]o~[0xfc][0xf9][0xe7]?[0xf9][0xe1][0xd3][0xf8][0x8f][0xfe][0xe3][0xbf][0xe0][0xfd][0xe7][0x1f][0xff][0xfa]o[0xfc][0xe9][0xf][0xf4][0xaf][0xf9]X[0xfe][0xf0]c>[0x81][0x98][0xbb][0x8e][0xef][0xbf][0xfb][0xe9][0xef][0xff][0xf6]7[0xf8][0xcb][0xd5][0xef][0xff][0xec][0xd3][0xdf]g[0xcf]:>Z[0xab][0xa5]|[0xd4][0xff][0xee][0xef][0xc6][0xe3][0xf9][0xf9][0xe3][0xd7]?[0xff][0xe1][0xf7][0xbf][0xfe][0x87][0x1f][0x83][0x87][0xf4]'?[0xfc]G%[0xfc][0x17][0x91][0xfe][0xf]xX[0xff][0xd9][0xcf]l}[0xee]3k[0xb7]g[0xf6][0xfb]R[0xfe][0x93]G6[0xcf]Wzf[0xeb][0xf4][0xd1][0xe7][0xf5][0xa1][0xe1][0xdf][0xfe]3[0x1e][0xda][0xff]Wt[0x16][0xfa]M4[0x15]=e[0xd7][0x8f]f[0x88][0x8e][0xb6][0xfe]([0xda]E[0xb4][0xb7]v[0xfa]G7D[0xa3][0xc4][0x1f]E[0x87][0x8a]F[0xdd][0xed]c[0x18][0xa2][0xbd][0x9e]?[0x8a][0x86][0x8a][0xae]~[0xc6]G8[0xfd][0xd2][0xfe](:U[0xf4][0xec][0xb6]>[0xa6]#[0xba][0xeb][0x1f]E[0x97][0x88][0x8e][0x16]#>[0x96][0xf3][0xdb][0xdf][0xfb][0x8f][0xa2][E[0xc7][0x89][0xf5][0xb1][0x9d]g[0x1a][0xf4]J[0x1d][0x15]]}[0xac][0x8f][0xe3][0xfc][0xf5][0x7]1[0x8a][0xaa][0x9e][0xb1][0xd7]G-[0xce][0xcf][0xda]xM[0xe9][0xa2][0x8a][0x9a][0x1f][0xaa][0x8f][0xea][0xac][0xaa]Q[0xe9][0xb9]V]V[0xd1]7>p[0xce][0xba][0x8a]N[0xef]@[0xd5][0x85][0x15]k[0xf4]|[0x8][0xce][0xca]j[0xf2]lui[0xcd][0x9e][0xef][0xc1]Gu[0xd6]VlZ[U[0x17][0xd7][0xcc]?[0xf2]!8[0xab]k[0xca]C[0xd0][0xe5]5O[0x8d][0xfa]Q[0xad][0xf5][0xb5][\n]"

{noformat}

> "deflate" encoding issue : java.util.zip.ZipException: invalid stored block lengths
> -----------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1550
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1550
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.3.5
>         Environment: Windows
>            Reporter: Guillaume Serre
>            Priority: Minor
>
> When trying to GET any nzb files from http://nzbindex.nl with a httpclient request, a
ZipException is raised.
> {code:title=JunitTestFailing.java}
> 	@Test
> 	public void testDeflateIssueFailing() throws ClientProtocolException, IOException {
> 		HttpGet httpget = new HttpGet("http://nzbindex.nl/download/72441827/BackTrack5R3.Gnome.iSO.32bit-LiNUX-0171-bt5r2gis32.par2.nzb");
> 		HttpClient client = HttpClientBuilder.create().build();
> 		HttpResponse response = client.execute(httpget);
> 		HttpEntity entity = response.getEntity();
> 		byte[] data = EntityUtils.toByteArray( entity );
> 		Assert.assertEquals( data.length, 423548 );
> 	}
> {code}
> The complete stack trace I get is this:
> {code}
> java.util.zip.ZipException: invalid stored block lengths
> 	at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
> 	at java.io.FilterInputStream.read(FilterInputStream.java:107)
> 	at org.apache.http.client.entity.DeflateInputStream.read(DeflateInputStream.java:144)
> 	at org.apache.http.client.entity.LazyDecompressingInputStream.read(LazyDecompressingInputStream.java:68)
> 	at org.apache.http.util.EntityUtils.toByteArray(EntityUtils.java:136)
> 	at hclient.HTTPClientTest.testDeflateIssueFailing(HTTPClientTest.java:39)
> {code}
> A workaround I found is to set the Accept-Encoding header to only accept gzip, as follows:
> {code:title=JunitTestWorking.java}
> 	
> 	@Test
> 	public void testDeflateIssueWorking() throws ClientProtocolException, IOException {
> 		HttpGet httpget = new HttpGet("http://nzbindex.nl/download/72441827/BackTrack5R3.Gnome.iSO.32bit-LiNUX-0171-bt5r2gis32.par2.nzb");
> 		httpget.setHeader("Accept-Encoding", "gzip");
> 		HttpClient client = HttpClientBuilder.create().build();
> 		HttpResponse response = client.execute(httpget);
> 		HttpEntity entity = response.getEntity();
> 		byte[] data = EntityUtils.toByteArray( entity );
> 		Assert.assertEquals( data.length, 423548 );
> 	}
> {code}
> Thanks



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message