[Git][java-team/httpcomponents-client5][upstream] New upstream version 5.1.3

Markus Koschany (@apo) gitlab at salsa.debian.org
Sat Feb 5 23:35:53 GMT 2022



Markus Koschany pushed to branch upstream at Debian Java Maintainers / httpcomponents-client5


Commits:
dc24fb37 by Markus Koschany at 2022-02-06T00:30:53+01:00
New upstream version 5.1.3
- - - - -


15 changed files:

- NOTICE.txt
- RELEASE_NOTES.txt
- httpclient5-cache/pom.xml
- httpclient5-fluent/pom.xml
- httpclient5-testing/pom.xml
- httpclient5-win/pom.xml
- httpclient5/pom.xml
- httpclient5/src/main/java/org/apache/hc/client5/http/impl/DefaultHttpRequestRetryStrategy.java
- httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncHttpRequestRetryExec.java
- httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicScheme.java
- httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ConnectExec.java
- httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java
- httpclient5/src/main/java/org/apache/hc/client5/http/utils/ByteArrayBuilder.java
- httpclient5/src/test/java/org/apache/hc/client5/http/utils/TestByteArrayBuilder.java
- pom.xml


Changes:

=====================================
NOTICE.txt
=====================================
@@ -1,5 +1,5 @@
 Apache HttpComponents Client
-Copyright 1999-2021 The Apache Software Foundation
+Copyright 1999-2022 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).


=====================================
RELEASE_NOTES.txt
=====================================
@@ -1,4 +1,38 @@
-Release 5.1.2
+Release 5.1.3
+-----------
+
+This release upgrades HttpCore to the latest 5.1 version and fixes a number of issues found
+since release 5.1.2.
+
+Change Log
+-------------------
+
+* Fixed incompatibility with older versions of Android shipping with Commons Codec < 1.4.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* Bug fix: ByteArrayBuilder incorrectly handles empty strings.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* HTTPCLIENT-2195, regression: classic ConnectExec incorrectly discards the proxy response body
+  even if the request cannot be executed and the response is final.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* HTTPCLIENT-2194: async retries not including body (#343).
+  Contributed by Jason Mathison <JasonMathison at users.noreply.github.com>
+
+* Automatically retry requests that failed with RequestNotExecutedException.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* Bug fix: Incorrect connection validity check in the async connection manager can cause
+  an IllegalStateException and lead to a connection leak. Treat closed connections as valid
+  due to the connection open check being inherently racy.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* Bump log4j to 2.12.3
+  Contributed by mxd4 <maxime_droy at ultimatesoftware.com>
+
+
+Release 5.1.2
 -----------
 
 This is an emergency release that fixes a regression introduced in the previous release


=====================================
httpclient5-cache/pom.xml
=====================================
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.httpcomponents.client5</groupId>
     <artifactId>httpclient5-parent</artifactId>
-    <version>5.1.2</version>
+    <version>5.1.3</version>
   </parent>
   <artifactId>httpclient5-cache</artifactId>
   <name>Apache HttpClient Cache</name>


=====================================
httpclient5-fluent/pom.xml
=====================================
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.httpcomponents.client5</groupId>
     <artifactId>httpclient5-parent</artifactId>
-    <version>5.1.2</version>
+    <version>5.1.3</version>
   </parent>
   <artifactId>httpclient5-fluent</artifactId>
   <name>Apache HttpClient Fluent</name>


=====================================
httpclient5-testing/pom.xml
=====================================
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.httpcomponents.client5</groupId>
     <artifactId>httpclient5-parent</artifactId>
-    <version>5.1.2</version>
+    <version>5.1.3</version>
   </parent>
   <artifactId>httpclient5-testing</artifactId>
   <name>Apache HttpClient Integration Tests</name>


=====================================
httpclient5-win/pom.xml
=====================================
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.httpcomponents.client5</groupId>
     <artifactId>httpclient5-parent</artifactId>
-    <version>5.1.2</version>
+    <version>5.1.3</version>
   </parent>
   <artifactId>httpclient5-win</artifactId>
   <name>Apache HttpClient Windows features</name>


=====================================
httpclient5/pom.xml
=====================================
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.httpcomponents.client5</groupId>
     <artifactId>httpclient5-parent</artifactId>
-    <version>5.1.2</version>
+    <version>5.1.3</version>
   </parent>
   <artifactId>httpclient5</artifactId>
   <name>Apache HttpClient</name>


=====================================
httpclient5/src/main/java/org/apache/hc/client5/http/impl/DefaultHttpRequestRetryStrategy.java
=====================================
@@ -52,6 +52,7 @@
 import org.apache.hc.core5.http.HttpResponse;
 import org.apache.hc.core5.http.HttpStatus;
 import org.apache.hc.core5.http.Method;
+import org.apache.hc.core5.http.RequestNotExecutedException;
 import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.hc.core5.util.Args;
 import org.apache.hc.core5.util.TimeValue;
@@ -176,6 +177,9 @@ public boolean retryRequest(
         if (this.nonRetriableIOExceptionClasses.contains(exception.getClass())) {
             return false;
         } else {
+            if (exception instanceof RequestNotExecutedException) {
+                return true;
+            }
             for (final Class<? extends IOException> rejectException : this.nonRetriableIOExceptionClasses) {
                 if (rejectException.isInstance(exception)) {
                     return false;


=====================================
httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncHttpRequestRetryExec.java
=====================================
@@ -128,6 +128,9 @@ public void handleInformationResponse(final HttpResponse response) throws HttpEx
             public void completed() {
                 if (state.retrying) {
                     scope.execCount.incrementAndGet();
+                    if (entityProducer != null) {
+                       entityProducer.releaseResources();
+                    }
                     scope.scheduler.scheduleExecution(request, entityProducer, scope, asyncExecCallback, state.delay);
                 } else {
                     asyncExecCallback.completed();


=====================================
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicScheme.java
=====================================
@@ -182,7 +182,7 @@ public String generateAuthResponse(
         }
         this.buffer.append(this.username).append(":").append(this.password);
         if (this.base64codec == null) {
-            this.base64codec = new Base64(0);
+            this.base64codec = new Base64();
         }
         final byte[] encodedCreds = this.base64codec.encode(this.buffer.toByteArray());
         this.buffer.reset();


=====================================
httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ConnectExec.java
=====================================
@@ -227,23 +227,22 @@ private boolean createTunnelToTarget(
                 throw new HttpException("Unexpected response to CONNECT request: " + new StatusLine(response));
             }
 
-            if (this.reuseStrategy.keepAlive(connect, response, context)) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("{} connection kept alive", exchangeId);
-                }
-                // Consume response content
-                final HttpEntity entity = response.getEntity();
-                EntityUtils.consume(entity);
-            } else {
-                execRuntime.disconnectEndpoint();
-            }
-
             if (config.isAuthenticationEnabled()) {
                 if (this.authenticator.isChallenged(proxy, ChallengeType.PROXY, response,
                         proxyAuthExchange, context)) {
                     if (this.authenticator.updateAuthState(proxy, ChallengeType.PROXY, response,
                             this.proxyAuthStrategy, proxyAuthExchange, context)) {
                         // Retry request
+                        if (this.reuseStrategy.keepAlive(connect, response, context)) {
+                            if (LOG.isDebugEnabled()) {
+                                LOG.debug("{} connection kept alive", exchangeId);
+                            }
+                            // Consume response content
+                            final HttpEntity entity = response.getEntity();
+                            EntityUtils.consume(entity);
+                        } else {
+                            execRuntime.disconnectEndpoint();
+                        }
                         response = null;
                     }
                 }


=====================================
httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java
=====================================
@@ -79,7 +79,6 @@
 import org.apache.hc.core5.reactor.Command;
 import org.apache.hc.core5.reactor.ConnectionInitiator;
 import org.apache.hc.core5.util.Args;
-import org.apache.hc.core5.util.Asserts;
 import org.apache.hc.core5.util.Identifiable;
 import org.apache.hc.core5.util.TimeValue;
 import org.apache.hc.core5.util.Timeout;
@@ -545,8 +544,9 @@ public String getId() {
 
         PoolEntry<HttpRoute, ManagedAsyncClientConnection> getValidatedPoolEntry() {
             final PoolEntry<HttpRoute, ManagedAsyncClientConnection> poolEntry = getPoolEntry();
-            final ManagedAsyncClientConnection connection = poolEntry.getConnection();
-            Asserts.check(connection != null && connection.isOpen(), "Endpoint is not connected");
+            if (poolEntry.getConnection() == null) {
+                throw new ConnectionShutdownException();
+            }
             return poolEntry;
         }
 


=====================================
httpclient5/src/main/java/org/apache/hc/client5/http/utils/ByteArrayBuilder.java
=====================================
@@ -74,8 +74,8 @@ static ByteBuffer encode(
 
         final int capacity = (int) (in.remaining() * encoder.averageBytesPerChar());
         ByteBuffer out = ensureFreeCapacity(buffer, capacity);
-        for (;;) {
-            CoderResult result = in.hasRemaining() ? encoder.encode(in, out, true) : CoderResult.UNDERFLOW;
+        while (in.hasRemaining()) {
+            CoderResult result = encoder.encode(in, out, true);
             if (result.isError()) {
                 result.throwException();
             }


=====================================
httpclient5/src/test/java/org/apache/hc/client5/http/utils/TestByteArrayBuilder.java
=====================================
@@ -121,6 +121,7 @@ public void testAppendText() throws Exception {
         buffer.append("bcd");
         buffer.append("e");
         buffer.append("f");
+        buffer.append("");
         buffer.append((String) null);
         buffer.append((char[]) null);
 


=====================================
pom.xml
=====================================
@@ -33,7 +33,7 @@
   <groupId>org.apache.httpcomponents.client5</groupId>
   <artifactId>httpclient5-parent</artifactId>
   <name>Apache HttpComponents Client Parent</name>
-  <version>5.1.2</version>
+  <version>5.1.3</version>
   <description>Apache HttpComponents Client is a library of components for building client side HTTP services</description>
   <url>https://hc.apache.org/httpcomponents-client-5.0.x/${project.version}/</url>
   <inceptionYear>1999</inceptionYear>
@@ -48,7 +48,7 @@
     <connection>scm:git:https://gitbox.apache.org/repos/asf/httpcomponents-client.git</connection>
     <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/httpcomponents-client.git</developerConnection>
     <url>https://github.com/apache/httpcomponents-client/tree/${project.scm.tag}</url>
-    <tag>5.1.2</tag>
+    <tag>5.1.3</tag>
   </scm>
 
  <distributionManagement>
@@ -62,8 +62,8 @@
   <properties>
     <maven.compiler.source>1.7</maven.compiler.source>
     <maven.compiler.target>1.7</maven.compiler.target>
-    <httpcore.version>5.1.2</httpcore.version>
-    <log4j.version>2.9.1</log4j.version>
+    <httpcore.version>5.1.3</httpcore.version>
+    <log4j.version>2.12.3</log4j.version>
     <commons-codec.version>1.15</commons-codec.version>
     <conscrypt.version>2.2.1</conscrypt.version>
     <ehcache.version>3.4.0</ehcache.version>



View it on GitLab: https://salsa.debian.org/java-team/httpcomponents-client5/-/commit/dc24fb37ba64ffc9e67e0f9924500567ee6d7e4d

-- 
View it on GitLab: https://salsa.debian.org/java-team/httpcomponents-client5/-/commit/dc24fb37ba64ffc9e67e0f9924500567ee6d7e4d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20220205/d9eeb492/attachment.htm>


More information about the pkg-java-commits mailing list