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/02/21 11:20:27 UTC

[httpcomponents-client] branch master updated (2471990 -> 1571745)

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

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


 discard 2471990  Remove trailing spaces
 discard 6a78a00  Remove trailing spaces
 discard 79bed1d  test
 discard 22349fa  remove trailing spaces
 discard 8c4777d  Add @since 5.2 tag and make symmetric changes to H2AsyncClientBuilder
 discard 1b5456c  Update HttpAsyncClientBuilder.java
     new 1571745  Added option to set an IOSessionListener on async client builders

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   (2471990)
            \
             N -- N -- N   refs/heads/master (1571745)

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:
 .../main/java/org/apache/hc/client5/http/CircularRedirectException.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

[httpcomponents-client] 01/01: Added option to set an IOSessionListener on async client builders

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

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

commit 157174543fb28cf701937e4a377fc851ad3e0f3a
Author: cda007 <35...@users.noreply.github.com>
AuthorDate: Fri Feb 18 11:32:30 2022 +0100

    Added option to set an IOSessionListener on async client builders
---
 .../hc/client5/http/impl/async/H2AsyncClientBuilder.java   | 14 +++++++++++++-
 .../hc/client5/http/impl/async/HttpAsyncClientBuilder.java | 14 +++++++++++++-
 2 files changed, 26 insertions(+), 2 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 61a73a1..7a5cfba 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
@@ -102,6 +102,7 @@ import org.apache.hc.core5.reactor.DefaultConnectingIOReactor;
 import org.apache.hc.core5.reactor.IOEventHandlerFactory;
 import org.apache.hc.core5.reactor.IOReactorConfig;
 import org.apache.hc.core5.reactor.IOSession;
+import org.apache.hc.core5.reactor.IOSessionListener;
 import org.apache.hc.core5.util.Args;
 import org.apache.hc.core5.util.TimeValue;
 import org.apache.hc.core5.util.VersionInfo;
@@ -171,6 +172,7 @@ public class H2AsyncClientBuilder {
     }
 
     private IOReactorConfig ioReactorConfig;
+    private IOSessionListener ioSessionListener;
     private H2Config h2Config;
     private CharCodingConfig charCodingConfig;
     private SchemePortResolver schemePortResolver;
@@ -240,6 +242,16 @@ public class H2AsyncClientBuilder {
     }
 
     /**
+     * Sets {@link IOSessionListener} listener.
+     *
+     * @since 5.2
+     */
+    public final H2AsyncClientBuilder setIOSessionListener(final IOSessionListener ioSessionListener) {
+        this.ioSessionListener = ioSessionListener;
+        return this;
+    }
+
+    /**
      * Sets {@link CharCodingConfig} configuration.
      */
     public final H2AsyncClientBuilder setCharCodingConfig(final CharCodingConfig charCodingConfig) {
@@ -764,7 +776,7 @@ public class H2AsyncClientBuilder {
                 threadFactory != null ? threadFactory : new DefaultThreadFactory("httpclient-dispatch", true),
                 ioSessionDecorator != null ? ioSessionDecorator : LoggingIOSessionDecorator.INSTANCE,
                 ioReactorExceptionCallback != null ? ioReactorExceptionCallback : LoggingExceptionCallback.INSTANCE,
-                null,
+                ioSessionListener,
                 ioSession -> ioSession.enqueue(new ShutdownCommand(CloseMode.GRACEFUL), Command.Priority.IMMEDIATE));
 
         if (execInterceptors != null) {
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 20a1a37..5851087 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
@@ -112,6 +112,7 @@ import org.apache.hc.core5.reactor.DefaultConnectingIOReactor;
 import org.apache.hc.core5.reactor.IOEventHandlerFactory;
 import org.apache.hc.core5.reactor.IOReactorConfig;
 import org.apache.hc.core5.reactor.IOSession;
+import org.apache.hc.core5.reactor.IOSessionListener;
 import org.apache.hc.core5.util.Args;
 import org.apache.hc.core5.util.TimeValue;
 import org.apache.hc.core5.util.VersionInfo;
@@ -207,6 +208,7 @@ public class HttpAsyncClientBuilder {
     private AsyncClientConnectionManager connManager;
     private boolean connManagerShared;
     private IOReactorConfig ioReactorConfig;
+    private IOSessionListener ioSessionListener;
     private Callback<Exception> ioReactorExceptionCallback;
     private Http1Config h1Config;
     private H2Config h2Config;
@@ -320,6 +322,16 @@ public class HttpAsyncClientBuilder {
     }
 
     /**
+     * Sets {@link IOSessionListener} listener.
+     *
+     * @since 5.2
+     */
+    public final HttpAsyncClientBuilder setIOSessionListener(final IOSessionListener ioSessionListener) {
+        this.ioSessionListener = ioSessionListener;
+        return this;
+    }
+
+    /**
      * Sets the callback that will be invoked when the client's IOReactor encounters an uncaught exception.
      *
      * @since 5.1
@@ -934,7 +946,7 @@ public class HttpAsyncClientBuilder {
                 threadFactory != null ? threadFactory : new DefaultThreadFactory("httpclient-dispatch", true),
                 ioSessionDecorator != null ? ioSessionDecorator : LoggingIOSessionDecorator.INSTANCE,
                 ioReactorExceptionCallback != null ? ioReactorExceptionCallback : LoggingExceptionCallback.INSTANCE,
-                null,
+                ioSessionListener,
                 ioSession -> ioSession.enqueue(new ShutdownCommand(CloseMode.GRACEFUL), Command.Priority.IMMEDIATE));
 
         if (execInterceptors != null) {