hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hahn <a...@adap.tv>
Subject Re: ContentEncodingHttpClient throws IOException when reading chunked gzip response
Date Tue, 29 Mar 2011 20:23:17 GMT
Thanks, Oleg. Interestingly, when I use the following code snippet, it works
without throwing an exception:

    String url = "
http://173.193.248.156:8080/x/brs1013?aid=eedcd7b2-001a-4388-9415-f2cd697d7608&buid=&ip=209.117.114.63&ua=Mozilla/5.0+(Windows;+U;+Windows+NT+6.1;+en-US;+rv:1.9.2.15)+Gecko/20110303+Firefox/3.6.15&lang=en_US&url=http://minifb-parking.mindjolt.com/fb/game_iframehtmlad.jsp?gkey=FRZ7GJK9OLYE2VMS&gcat=action&gtitle=Parking+Mania&gdesc=Park+the+car+without+crashing+it.&ts=1299189609250&ad_duration=30&top=true&site=mindjolt.com&pid=9234&frmts=linear15:300x250,linear15&cat=games:casual_games&qual=
";
    HttpClient httpClient = new ContentEncodingHttpClient();
    HttpGet get = new HttpGet(url);
    HttpResponse response = httpClient.execute(get);
    HttpEntity entity = response.getEntity();
    String content = EntityUtils.toString(entity);

To the best of my knowledge, this should be the equivalent of the prior code
snippet (using BasicResponseHandler). I can get by with this workaround, but
I would like to know if I'm misusing the library, or if is this unexpected
behavior.

Thanks,
Adam

On Tue, Mar 29, 2011 at 11:23 AM, Oleg Kalnichevski <olegk@apache.org>wrote:

> ...
>
>
> > DEBUG| Connection can be kept alive indefinitely
> >
> |DefaultRequestDirector.java:477|org.apache.http.impl.client.ContentEncodingHttpClient|main|
> > DEBUG| Releasing connection
> > org.apache.http.impl.conn.SingleClientConnManager$ConnAdapter@306e7a5b
> |SingleClientConnManager.java:267|org.apache.http.impl.conn.SingleClientConnManager|main|
>
> ...
>
> > It looks very similar to yours. Were you able to consume the response
> > without throwing an exception? This run did throw the same exception
> noted
> > previously.
> >
>
> As you can see the connection was kept alive and released back to the
> connection manager. That could not have been done unless the response
> content has been fully consumed.
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message