You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2022/09/04 10:46:27 UTC

[httpcomponents-client] branch HTTPCLIENT-2232 updated (bfb8ec2d7 -> 517ebf4e7)

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a change to branch HTTPCLIENT-2232
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git


 discard bfb8ec2d7 HTTPCLIENT-2232: last protocol interceptrs moved at the end of the H2 protocol processing pipeline
     new 517ebf4e7 HTTPCLIENT-2232: last protocol interceptrs moved at the end of the H2 protocol processing pipeline

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (bfb8ec2d7)
            \
             N -- N -- N   refs/heads/HTTPCLIENT-2232 (517ebf4e7)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../http/impl/async/H2AsyncClientBuilder.java      | 22 +++++++++++-----------
 .../http/impl/async/HttpAsyncClientBuilder.java    | 22 +++++++++++-----------
 2 files changed, 22 insertions(+), 22 deletions(-)


[httpcomponents-client] 01/01: HTTPCLIENT-2232: last protocol interceptrs moved at the end of the H2 protocol processing pipeline

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch HTTPCLIENT-2232
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit 517ebf4e79f35a3405d13df213f8576a3d8e4b90
Author: Oleg Kalnichevski <Ol...@abraxas.ch>
AuthorDate: Sun Sep 4 12:46:12 2022 +0200

    HTTPCLIENT-2232: last protocol interceptrs moved at the end of the H2 protocol processing pipeline
---
 .../http/impl/async/H2AsyncClientBuilder.java      | 39 +++++++++++-----------
 .../http/impl/async/HttpAsyncClientBuilder.java    | 38 +++++++++++----------
 2 files changed, 40 insertions(+), 37 deletions(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java
index 8a0f82afa..28435d4ec 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java
@@ -44,8 +44,8 @@ import org.apache.hc.client5.http.HttpRequestRetryStrategy;
 import org.apache.hc.client5.http.SchemePortResolver;
 import org.apache.hc.client5.http.async.AsyncExecChainHandler;
 import org.apache.hc.client5.http.auth.AuthSchemeFactory;
-import org.apache.hc.client5.http.auth.StandardAuthScheme;
 import org.apache.hc.client5.http.auth.CredentialsProvider;
+import org.apache.hc.client5.http.auth.StandardAuthScheme;
 import org.apache.hc.client5.http.config.RequestConfig;
 import org.apache.hc.client5.http.cookie.BasicCookieStore;
 import org.apache.hc.client5.http.cookie.CookieSpecFactory;
@@ -93,7 +93,6 @@ import org.apache.hc.core5.http.nio.command.ShutdownCommand;
 import org.apache.hc.core5.http.nio.ssl.TlsStrategy;
 import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
 import org.apache.hc.core5.http.protocol.HttpContext;
-import org.apache.hc.core5.http.protocol.HttpProcessor;
 import org.apache.hc.core5.http.protocol.HttpProcessorBuilder;
 import org.apache.hc.core5.http.protocol.RequestTargetHost;
 import org.apache.hc.core5.http.protocol.RequestUserAgent;
@@ -656,24 +655,9 @@ public class H2AsyncClientBuilder {
         if (!cookieManagementDisabled) {
             b.add(new ResponseProcessCookies());
         }
-        if (requestInterceptors != null) {
-            for (final RequestInterceptorEntry entry: requestInterceptors) {
-                if (entry.position == RequestInterceptorEntry.Position.LAST) {
-                    b.addLast(entry.interceptor);
-                }
-            }
-        }
-        if (responseInterceptors != null) {
-            for (final ResponseInterceptorEntry entry: responseInterceptors) {
-                if (entry.position == ResponseInterceptorEntry.Position.LAST) {
-                    b.addLast(entry.interceptor);
-                }
-            }
-        }
 
-        final HttpProcessor httpProcessor = b.build();
         execChainDefinition.addFirst(
-                new AsyncProtocolExec(httpProcessor, targetAuthStrategyCopy, proxyAuthStrategyCopy, schemePortResolver),
+                new AsyncProtocolExec(b.build(), targetAuthStrategyCopy, proxyAuthStrategyCopy, schemePortResolver),
                 ChainElement.PROTOCOL.name());
 
         // Add request retry executor, if not disabled
@@ -707,9 +691,26 @@ public class H2AsyncClientBuilder {
                     ChainElement.REDIRECT.name());
         }
 
+        final HttpProcessorBuilder b2 = HttpProcessorBuilder.create();
+        b2.addAll(new H2RequestContent(), new H2RequestTargetHost(), new H2RequestConnControl());
+        if (requestInterceptors != null) {
+            for (final RequestInterceptorEntry entry: requestInterceptors) {
+                if (entry.position == RequestInterceptorEntry.Position.LAST) {
+                    b2.addLast(entry.interceptor);
+                }
+            }
+        }
+        if (responseInterceptors != null) {
+            for (final ResponseInterceptorEntry entry: responseInterceptors) {
+                if (entry.position == ResponseInterceptorEntry.Position.LAST) {
+                    b2.addLast(entry.interceptor);
+                }
+            }
+        }
+
         final AsyncPushConsumerRegistry pushConsumerRegistry = new AsyncPushConsumerRegistry();
         final IOEventHandlerFactory ioEventHandlerFactory = new H2AsyncClientEventHandlerFactory(
-                new DefaultHttpProcessor(new H2RequestContent(), new H2RequestTargetHost(), new H2RequestConnControl()),
+                b2.build(),
                 new HandlerFactory<AsyncPushConsumer>() {
 
                     @Override
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java
index 6a8384916..a665f24ae 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java
@@ -102,7 +102,6 @@ import org.apache.hc.core5.http.nio.HandlerFactory;
 import org.apache.hc.core5.http.nio.command.ShutdownCommand;
 import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
 import org.apache.hc.core5.http.protocol.HttpContext;
-import org.apache.hc.core5.http.protocol.HttpProcessor;
 import org.apache.hc.core5.http.protocol.HttpProcessorBuilder;
 import org.apache.hc.core5.http.protocol.RequestTargetHost;
 import org.apache.hc.core5.http.protocol.RequestUserAgent;
@@ -817,24 +816,9 @@ public class HttpAsyncClientBuilder {
         if (!cookieManagementDisabled) {
             b.add(new ResponseProcessCookies());
         }
-        if (requestInterceptors != null) {
-            for (final RequestInterceptorEntry entry: requestInterceptors) {
-                if (entry.position == RequestInterceptorEntry.Position.LAST) {
-                    b.addLast(entry.interceptor);
-                }
-            }
-        }
-        if (responseInterceptors != null) {
-            for (final ResponseInterceptorEntry entry: responseInterceptors) {
-                if (entry.position == ResponseInterceptorEntry.Position.LAST) {
-                    b.addLast(entry.interceptor);
-                }
-            }
-        }
 
-        final HttpProcessor httpProcessor = b.build();
         execChainDefinition.addFirst(
-                new AsyncProtocolExec(httpProcessor, targetAuthStrategyCopy, proxyAuthStrategyCopy, schemePortResolver),
+                new AsyncProtocolExec(b.build(), targetAuthStrategyCopy, proxyAuthStrategyCopy, schemePortResolver),
                 ChainElement.PROTOCOL.name());
 
         // Add request retry executor, if not disabled
@@ -922,9 +906,27 @@ public class HttpAsyncClientBuilder {
                 reuseStrategyCopy = DefaultClientConnectionReuseStrategy.INSTANCE;
             }
         }
+
+        final HttpProcessorBuilder b2 = HttpProcessorBuilder.create();
+        b2.addAll(new H2RequestContent(), new H2RequestTargetHost(), new H2RequestConnControl());
+        if (requestInterceptors != null) {
+            for (final RequestInterceptorEntry entry: requestInterceptors) {
+                if (entry.position == RequestInterceptorEntry.Position.LAST) {
+                    b2.addLast(entry.interceptor);
+                }
+            }
+        }
+        if (responseInterceptors != null) {
+            for (final ResponseInterceptorEntry entry: responseInterceptors) {
+                if (entry.position == ResponseInterceptorEntry.Position.LAST) {
+                    b2.addLast(entry.interceptor);
+                }
+            }
+        }
+
         final AsyncPushConsumerRegistry pushConsumerRegistry = new AsyncPushConsumerRegistry();
         final IOEventHandlerFactory ioEventHandlerFactory = new HttpAsyncClientEventHandlerFactory(
-                new DefaultHttpProcessor(new H2RequestContent(), new H2RequestTargetHost(), new H2RequestConnControl()),
+                b2.build(),
                 new HandlerFactory<AsyncPushConsumer>() {
 
                     @Override