[SCM] httpcomponents-client: HTTP/1.1 compliant HTTP agent Java implementation branch, master, updated. debian/4.2.1-2-13-g22568d1

Damien Raude-Morvan drazzib at debian.org
Wed May 8 11:05:06 UTC 2013


The following commit has been merged in the master branch:
commit 09c188d06ed10632e7eb54c19fa5d49b7a81cc27
Merge: 72049538c185d2245f2c5480bbb2a66cbfd5a03a 0f496ea3c0b46b382b3dd5c1d4cb0bcc39292975
Author: Damien Raude-Morvan <drazzib at debian.org>
Date:   Wed May 8 00:13:42 2013 +0200

    Merge tag 'upstream/4.2.5'
    
    Upstream version 4.2.5
    
    Conflicts:
    	RELEASE_NOTES.txt
    	fluent-hc/pom.xml
    	fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java
    	fluent-hc/src/main/java/org/apache/http/client/fluent/Response.java
    	httpclient-benchmark/pom.xml
    	httpclient-cache/pom.xml
    	httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java
    	httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntity.java
    	httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheInvalidator.java
    	httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
    	httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidator.java
    	httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheInvalidator.java
    	httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingHttpClient.java
    	httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java
    	httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java
    	httpclient-contrib/pom.xml
    	httpclient-osgi/pom.xml
    	httpclient/pom.xml
    	httpclient/src/main/java/org/apache/http/client/entity/DecompressingEntity.java
    	httpclient/src/main/java/org/apache/http/client/entity/DeflateDecompressingEntity.java
    	httpclient/src/main/java/org/apache/http/client/entity/GzipDecompressingEntity.java
    	httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
    	httpclient/src/main/java/org/apache/http/client/protocol/ResponseAuthCache.java
    	httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java
    	httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
    	httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java
    	httpclient/src/main/java/org/apache/http/conn/ssl/AbstractVerifier.java
    	httpclient/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
    	httpclient/src/main/java/org/apache/http/impl/auth/DigestScheme.java
    	httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java
    	httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java
    	httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java
    	httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java
    	httpclient/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java
    	httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
    	httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java
    	httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java
    	httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java
    	httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java
    	httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java
    	httpclient/src/test/java/org/apache/http/client/entity/TestDecompressingEntity.java
    	httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java
    	httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java
    	httpclient/src/test/java/org/apache/http/conn/ssl/TestHostnameVerifier.java
    	httpclient/src/test/java/org/apache/http/impl/client/TestClientAuthentication.java
    	httpclient/src/test/java/org/apache/http/impl/client/TestClientReauthentication.java
    	httpclient/src/test/java/org/apache/http/impl/client/TestDefaultClientRequestDirector.java
    	httpclient/src/test/java/org/apache/http/impl/client/TestDefaultRedirectStrategy.java
    	httpclient/src/test/java/org/apache/http/impl/conn/ConnPoolBench.java
    	httpclient/src/test/java/org/apache/http/impl/conn/TestAbortHandling.java
    	httpmime/pom.xml
    	pom.xml
    	src/site/apt/download.apt
    	src/site/apt/ntlm.apt

diff --combined RELEASE_NOTES.txt
index 9113002,cbb1baf..8abdb41
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@@ -1,3 -1,212 +1,215 @@@
++<<<<<<< HEAD
++=======
+ Release 4.2.5
+ -------------------
+ 
+ HttpClient 4.2.5 (GA) is a maintenance release that addresses a number of issues reported since 
+ release 4.2.3 including a major bug that can lead to re-use of persistent connections in 
+  a inconsistent state.
+ 
+ All users of HttpClient 4.2 are strongly advised to upgrade.
+   
+ 
+ Changelog
+ -------------------
+ 
+ * [HTTPCLIENT-1341] DeflateDecompressingEntity does not call Inflater#end.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1299] (regression) cache incorrectly disposes of the underlying cache resource 
+   when storing variant entry.
+   Contributed by James Leigh <james at 3roundstones.com> 
+ 
+ * [HTTPCLIENT-1342] Redirects with underscore character in the location hostname cause
+   "java.lang.IllegalArgumentException: Host name may not be null".  
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1338] (regression) Invalidated / stale DIGEST schemes do not get evicted from
+   the auth cache. 
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1340] Connection re-used in a inconsistent state despite presence of 
+   'Connection: close' response header immediately after a successful authentication exchange. 
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ 
+ Release 4.2.4
+ -------------------
+ 
+ HttpClient 4.2.4 (GA) is a maintenance release that addresses a number of issues reported since 
+ release 4.2.3. 
+ 
+ Changelog
+ -------------------
+ 
+ * [HTTPCLIENT-1319] InetAddressUtils.isIPv6HexCompressedAddress does not detect excess groups 
+   Contributed Sebastian Bazley <sebb at apache.org>.
+ 
+ * [HTTPCLIENT-1299] (regression) cache incorrectly disposes of the underlying cache resource 
+   when storing variant entry.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1320] Leverage javax.net.ssl.SSLSocketFactory#getDefault() to initialize SSL context 
+   based on system defaults instead of using an internal custom routine.
+   Contributed by Abe Backus <abraham at backus.com> and Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1315] NTLM support did not work properly when the target (as returned
+   in the Type 2 message) differed from the domain as supplied by the user.
+   Contributed by Karl Wright <kwright at apache.org>
+ 
+ * PoolingClientConnectionManager does not use ClientConnectionOperator#createConnection() 
+   method to create new connections.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1311] Interrupt flag is not preserved where InterruptedException is caught.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1312] Zero length content entities with a Content-Encoding header cause 
+   an I/O error when an attempt is made to consume such entity.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1305] Ensure chunking is disabled when applying Base64 encoding.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ 
+ 
+ Release 4.2.3
+ -------------------
+ 
+ HttpClient 4.2.3 (GA) is a bug fix release that addresses a number of issues reported since 
+ release 4.2.2. This release also includes a thoroughly reworked NTLM authentication engine 
+ which should result in a better compatibility with the newest Microsoft products. 
+ 
+ Users of HttpClient 4.x are advised to upgrade.
+ 
+ Changelog
+ -------------------
+ 
+ * [HTTPCLIENT-1296] NPE gets thrown if you combine a default host with a virtual host
+   that has a -1 value for the port.
+   Contributed by Karl Wright <daddywri at gmail.com>
+ 
+ * [HTTPCLIENT-1290] 304 cached response never reused with If-modified-since conditional 
+   requests. 
+   Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net>
+ 
+ * [HTTPCLIENT-1291] Absolute request URIs without an explicitly specified path are rewritten 
+   to have "/" path).  
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1286] Request URI rewriting is inconsistent - URI fragments are not removed 
+   from absolute request URIs.  
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1284] HttpClient incorrectly generates Host header when physical connection
+   route differs from the host name specified in the request URI. 
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1293] Kerberos and SPNego auth schemes use incorrect authorization header name 
+   when authenticating with a proxy.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1283] NTLM needs to use Locale-independent form of
+   toUpperCase().
+   Contributed by Karl Wright <DaddyWri at gmail.com>  
+ 
+ * [HTTPCLIENT-1279] Target host responding with status 407 (proxy authentication required) 
+   causes an NPE. 
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1281] GzipDecompressingEntity does not release InputStream when an IOException 
+   occurs while reading the Gzip header 
+   Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net> 
+ 
+ * [HTTPCLIENT-1277] Caching client sends a 304 to an unconditional request.
+   Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net>
+ 
+ * [HTTPCLIENT-1278] Update NTLM documentation.
+   Contributed by Karl Wright <DaddyWri at gmail.com>  
+ 
+ * SystemDefaultHttpClient misinterprets 'http.keepAlive' default value and disables
+   connection persistence if the system property is not set. This causes connection
+   based authentication schemes such as NTLM to fail.
+ 
+ * [HTTPCLIENT-1276] cache update on a 304 response causes NPE. 
+   Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net> 
+ 
+ * [HTTPCLIENT-1273] DecompressingHttpClient does not automatically consume response 
+   content in case of an i/o, HTTP or runtime exception thrown by the decompressing 
+   protocol interceptor leading to a potential connection leak. 
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1268] NTLM engine refactor fix, to correct a buffer overrun, and get NTLMv2
+   flags right.
+   Contributed by Karl Wright <DaddyWri at gmail.com>  
+ 
+ * [HTTPCLIENT-1266] NTLM engine refactoring and compatibility improvements.
+   Contributed by Karl Wright <DaddyWri at gmail.com>  
+ 
+ * [HTTPCLIENT-1263] BrowserCompatSpec: attribute values containing spaces or special characters 
+   should be enclosed with quotes marks for version 1 cookies.
+   Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net> 
+ 
+ * [HTTPCLIENT-1263] CachingHttpClient fails to release connections back to the connection
+   manager for some type of HTTP response messages when used together with DecompressingHttpClient.  
+   Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net> 
+ 
+ * [HTTPCLIENT-1258] Fixed NullPointerException in NTLMEngineImpl caused by null NT domain
+   attribute.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1254] Redirect with underscore in hostname causes ProtocolException.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1255] AbstractVerifier incorrectly parses certificate CN containing wildcard.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ 
+ 
+ Release 4.2.2 
+ -------------------
+ 
+ HttpClient 4.2.2 (GA) is a bug fix release that addresses a number of issues reported since 
+ release 4.2.1.
+ 
+ Users of HttpClient 4.2 are advised to upgrade.
+ 
+ Changelog
+ -------------------
+ 
+ * [HTTPCLIENT-1248] Default and lax redirect strategies should not convert requests redirected
+   with 307 status to GET method.  
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1215] BasicAuthCache does not take default ports into consideration when
+   looking up cached authentication details by HttpHost key.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1241] (regression) Preemptive BASIC authentication failure should be considered 
+   final and no further attempts to re-authenticate using the same credentials should be made. 
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1229] Fixed NPE in BasicClientConnectionManager that can be triggered by releasing
+   connection after the connection manager has already been shut down. 
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1227] Date parsing in DateUtils made more efficient.
+   Contributed by Patrick Linskey <pcl at apache.org>
+ 
+ * [HTTPCLIENT-1224] (regression) NTLM auth not retried after a redirect over a non-persistent 
+   connection.
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ * [HTTPCLIENT-1223] Cache could be more aggressive on cache invalidations
+   from Content-Location. Contributed by Jon Moore <jonm at apache.org>.
+   Contributed by Jon Moore <jonm at apache.org>
+ 
+ * [HTTPCLIENT-1217] AutoRetryHttpClient does not release connection used by the previous response 
+   when request is retried
+   Contributed by Oleg Kalnichevski <olegk at apache.org>
+ 
+ 
++>>>>>>> upstream/4.2.5
  Release 4.2.1 
  -------------------
  
diff --combined httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestBasicHttpCache.java
index 6a61d8b,ab72a39..044c523
--- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestBasicHttpCache.java
+++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestBasicHttpCache.java
@@@ -33,6 -33,9 +33,9 @@@ import static org.junit.Assert.assertNu
  import static org.junit.Assert.assertSame;
  import static org.junit.Assert.assertTrue;
  
+ import java.io.ByteArrayInputStream;
+ import java.io.ByteArrayOutputStream;
+ import java.io.IOException;
  import java.io.InputStream;
  import java.util.Date;
  import java.util.HashMap;
@@@ -48,9 -51,11 +51,11 @@@ import org.apache.http.client.cache.Htt
  import org.apache.http.client.cache.Resource;
  import org.apache.http.client.methods.HttpDelete;
  import org.apache.http.client.methods.HttpGet;
+ import org.apache.http.entity.BasicHttpEntity;
  import org.apache.http.entity.ByteArrayEntity;
  import org.apache.http.impl.cookie.DateUtils;
  import org.apache.http.message.BasicHttpResponse;
+ import org.apache.http.util.EntityUtils;
  import org.junit.Assert;
  import org.junit.Before;
  import org.junit.Test;
@@@ -234,7 -239,7 +239,7 @@@ public class TestBasicHttpCache 
          Date responseReceived = new Date(now.getTime() - 1 * 1000L);
  
          HttpResponse originResponse = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
 -        originResponse.setEntity(HttpTestUtils.makeBody(CacheConfig.DEFAULT_MAX_OBJECT_SIZE_BYTES + 1));
 +        originResponse.setEntity(HttpTestUtils.makeBody((int) CacheConfig.DEFAULT_MAX_OBJECT_SIZE_BYTES + 1));
          originResponse.setHeader("Cache-Control","public, max-age=3600");
          originResponse.setHeader("Date", DateUtils.formatDate(responseGenerated));
          originResponse.setHeader("ETag", "\"etag\"");
@@@ -256,7 -261,7 +261,7 @@@
          Date responseReceived = new Date(now.getTime() - 1 * 1000L);
  
          HttpResponse originResponse = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
 -        originResponse.setEntity(HttpTestUtils.makeBody(CacheConfig.DEFAULT_MAX_OBJECT_SIZE_BYTES - 1));
 +        originResponse.setEntity(HttpTestUtils.makeBody((int) CacheConfig.DEFAULT_MAX_OBJECT_SIZE_BYTES - 1));
          originResponse.setHeader("Cache-Control","public, max-age=3600");
          originResponse.setHeader("Date", DateUtils.formatDate(responseGenerated));
          originResponse.setHeader("ETag", "\"etag\"");
@@@ -379,4 -384,95 +384,95 @@@
  
      }
  
+     @Test
+     public void testOriginalResponseWithNoContentSizeHeaderIsReleased() throws Exception {
+         HttpHost host = new HttpHost("foo.example.com");
+         HttpRequest request = new HttpGet("http://foo.example.com/bar");
+ 
+         Date now = new Date();
+         Date requestSent = new Date(now.getTime() - 3 * 1000L);
+         Date responseGenerated = new Date(now.getTime() - 2 * 1000L);
+         Date responseReceived = new Date(now.getTime() - 1 * 1000L);
+ 
+         HttpResponse originResponse = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
+         BasicHttpEntity entity = new BasicHttpEntity();
+         ConsumableInputStream inputStream = new ConsumableInputStream(new ByteArrayInputStream(HttpTestUtils.getRandomBytes(CacheConfig.DEFAULT_MAX_OBJECT_SIZE_BYTES - 1)));
+         entity.setContent(inputStream);
+         originResponse.setEntity(entity);
+         originResponse.setHeader("Cache-Control","public, max-age=3600");
+         originResponse.setHeader("Date", DateUtils.formatDate(responseGenerated));
+         originResponse.setHeader("ETag", "\"etag\"");
+ 
+         HttpResponse result = impl.cacheAndReturnResponse(host, request, originResponse, requestSent, responseReceived);
+         EntityUtils.consume(result.getEntity());
+         assertTrue(inputStream.wasClosed());
+     }
+ 
+     static class DisposableResource implements Resource {
+ 
+         private static final long serialVersionUID = 1L;
+ 
+         private final byte[] b;
+         private boolean dispoased;
+ 
+         public DisposableResource(final byte[] b) {
+             super();
+             this.b = b;
+         }
+ 
+         byte[] getByteArray() {
+             return this.b;
+         }
+ 
+         public InputStream getInputStream() throws IOException {
+             if (dispoased) {
+                 throw new IOException("Already dispoased");
+             }
+             return new ByteArrayInputStream(this.b);
+         }
+ 
+         public long length() {
+             return this.b.length;
+         }
+ 
+         public void dispose() {
+             this.dispoased = true;
+         }
+ 
+     }
+ 
+     @Test
+     public void testEntryUpdate() throws Exception {
+ 
+         HeapResourceFactory rf = new HeapResourceFactory() {
+ 
+             @Override
+             Resource createResource(byte[] buf) {
+                 return new DisposableResource(buf);
+             }
+ 
+         };
+ 
+         impl = new BasicHttpCache(rf, backing, new CacheConfig());
+ 
+         HttpHost host = new HttpHost("foo.example.com");
+ 
+         HttpRequest origRequest = new HttpGet("http://foo.example.com/bar");
+         origRequest.setHeader("Accept-Encoding","gzip");
+ 
+         HttpResponse origResponse = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
+         origResponse.setEntity(HttpTestUtils.makeBody(128));
+         origResponse.setHeader("Date", DateUtils.formatDate(new Date()));
+         origResponse.setHeader("Cache-Control", "max-age=3600, public");
+         origResponse.setHeader("ETag", "\"etag\"");
+         origResponse.setHeader("Vary", "Accept-Encoding");
+         origResponse.setHeader("Content-Encoding","gzip");
+ 
+         HttpResponse response = impl.cacheAndReturnResponse(
+                 host, origRequest, origResponse, new Date(), new Date());
+         HttpEntity entity = response.getEntity();
+         Assert.assertNotNull(entity);
+         IOUtils.copyAndClose(entity.getContent(), new ByteArrayOutputStream());
+     }
+ 
  }

-- 
httpcomponents-client: HTTP/1.1 compliant HTTP agent Java implementation



More information about the pkg-java-commits mailing list