hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Moore, Jonathan (CIM)" <Jonathan_Mo...@Comcast.com>
Subject Re: HttpClient-Cache release that works against HttpClient 4.0?
Date Mon, 07 Nov 2011 14:25:50 GMT
Is that really the only change that would be necessary to work with 4.0? I
think it might be worth double-checking that all the tests pass with this
change and when compiled against 4.0.

While I agree that it would be better for Google to be upgrading the
version of HttpClient they're using, at the same time, there are a lot of
Android developers and users that would benefit from having the caching
module. I'm willing to spend a little time to investigate further and
perhaps make a change like this if it's not going to compromise the
codebase going forwards.

At the same time, Craig: couldn't you just apply that diff yourself and
run with a patched version of httpclient-cache in your apps, then wait
until Google upgrades the HttpClient that's embedded in Android?

Jon
........
Jon Moore
Comcast Interactive Media






On 11/3/11 2:32 PM, "candrews" <candrews@integralblue.com> wrote:

>
>HttpClient-Cache doesn't work against HttpClient 4.0 because it uses
>org.apache.http.util.EntityUtils.consume(org.apache.http.HttpEntity) which
>wasn't introduced until HttpClient 4.1.
>
>Since Android uses HttpClient 4.0 (yes, it sucks that they won't upgrade,
>and I don't understand their reasons for not upgrading, but anyways), this
>means you can't use HttpClient-Cache on Android - and IMHO, it would be
>really useful.
>
>Could HttpClient-Cache simply not use
>org.apache.http.util.EntityUtils.consume and therefore set the minimum
>HttpClient version to 4.0? The change seems quite simple - in
>ResponseProtocolCompliance, use this method body instead of the existing
>one:
>
>    private void consumeBody(HttpResponse response) throws IOException {
>        HttpEntity body = response.getEntity();
>        if (body != null){
>         if (body.isStreaming()) {
>             InputStream instream = body.getContent();
>             if (instream != null) {
>                 instream.close();
>             }
>         }
>    }
>
>Thank you,
>~Craig
>-- 
>View this message in context:
>http://old.nabble.com/HttpClient-Cache-release-that-works-against-HttpClie
>nt-4.0--tp32775131p32775131.html
>Sent from the HttpClient-User mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>For additional commands, e-mail: httpclient-users-help@hc.apache.org
>


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


Mime
View raw message