From bce6fadf3b1c237aab4b65d3d99b72520ba79689 Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Wed, 24 Aug 2011 00:22:30 +0000 Subject: [PATCH] THRIFT-1282. java: Upgrade httpclient to 4.1.2 (from 4.0.1) Patch: Aravind Srini git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1160941 13f79535-47bb-0310-9956-ffa450edef68 --- lib/java/build.xml | 19 ++++++++++++++----- .../apache/thrift/transport/THttpClient.java | 3 ++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/java/build.xml b/lib/java/build.xml index 7b4e8dda..51df768f 100644 --- a/lib/java/build.xml +++ b/lib/java/build.xml @@ -92,7 +92,9 @@ + debug="true" classpathref="compile.classpath" includeantruntime="false"> + + @@ -146,9 +148,15 @@ - - - + + + + + + + + + @@ -290,7 +298,8 @@ - + + diff --git a/lib/java/src/org/apache/thrift/transport/THttpClient.java b/lib/java/src/org/apache/thrift/transport/THttpClient.java index b16da685..30f59eee 100644 --- a/lib/java/src/org/apache/thrift/transport/THttpClient.java +++ b/lib/java/src/org/apache/thrift/transport/THttpClient.java @@ -36,6 +36,7 @@ import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.params.CoreConnectionPNames; +import org.apache.http.util.EntityUtils; /** * HTTP implementation of the TTransport interface. Used for working with a @@ -265,7 +266,7 @@ public class THttpClient extends TTransport { try { // Indicate we're done with the content. - response.getEntity().consumeContent(); + EntityUtils.consume(response.getEntity()); } catch (IOException ioe) { // We ignore this exception, it might only mean the server has no // keep-alive capability. -- 2.17.1