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 2024/11/06 16:49:32 UTC

(httpcomponents-core) branch master updated (9d72ad392 -> 306de8e8a)

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-core.git


 discard 9d72ad392 Add Javadoc since for NoConnectionReuseStrategy
 discard f110b87aa Add NoConnectionReuseStrategy
 discard 9eb66b108 Polish Javadoc for HttpResponseInterceptor
    omit 0bb2d8d86 Use Map#computeIfAbsent() instead of get(), test, and put()
     new 9c46cd455 Use Map#computeIfAbsent() instead of get(), test, and put()
     new b8ad52f5f Make local variable final
     new 210e8bcce Polish Javadoc for HttpResponseInterceptor
     new 306de8e8a Add NoConnectionReuseStrategy

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   (9d72ad392)
            \
             N -- N -- N   refs/heads/master (306de8e8a)

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 4 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:
 .../testing/framework/ClassicTestClientAdapter.java      |  6 +++---
 .../apache/hc/core5/testing/framework/FrameworkTest.java |  6 +++---
 .../hc/core5/testing/framework/TestingFramework.java     | 10 +++++-----
 .../framework/TestingFrameworkRequestHandler.java        | 16 ++++++++--------
 4 files changed, 19 insertions(+), 19 deletions(-)


(httpcomponents-core) 03/04: Polish Javadoc for HttpResponseInterceptor

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-core.git

commit 210e8bcce79eb261072ff610833965888cb1bd80
Author: Johnny Lim <iz...@naver.com>
AuthorDate: Wed Nov 6 18:45:29 2024 +0900

    Polish Javadoc for HttpResponseInterceptor
---
 .../main/java/org/apache/hc/core5/http/HttpResponseInterceptor.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/HttpResponseInterceptor.java b/httpcore5/src/main/java/org/apache/hc/core5/http/HttpResponseInterceptor.java
index 421011bea..56e0ae61b 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/HttpResponseInterceptor.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/HttpResponseInterceptor.java
@@ -38,9 +38,9 @@ import org.apache.hc.core5.http.protocol.HttpContext;
  * the HTTP protocol. Usually protocol interceptors are expected to act upon
  * one specific header or a group of related headers of the incoming message
  * or populate the outgoing message with one specific header or a group of
- * related headers. Protocol
+ * related headers.
  * <p>
- * Interceptors can also manipulate content entities enclosed with messages.
+ * Protocol interceptors can also manipulate content entities enclosed with messages.
  * Usually this is accomplished by using the 'Decorator' pattern where a wrapper
  * entity class is used to decorate the original entity.
  * <p>


(httpcomponents-core) 04/04: Add NoConnectionReuseStrategy

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-core.git

commit 306de8e8a79deca24fc529a6f6e4b2de1ca67a2b
Author: Johnny Lim <iz...@naver.com>
AuthorDate: Fri Nov 1 22:16:11 2024 +0900

    Add NoConnectionReuseStrategy
---
 .../core5/http/impl/NoConnectionReuseStrategy.java | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/NoConnectionReuseStrategy.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/NoConnectionReuseStrategy.java
new file mode 100644
index 000000000..6e5e85c23
--- /dev/null
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/NoConnectionReuseStrategy.java
@@ -0,0 +1,51 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.hc.core5.http.impl;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.ConnectionReuseStrategy;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.protocol.HttpContext;
+
+/**
+ * A strategy that never reuses a connection.
+ * @since 5.4
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class NoConnectionReuseStrategy implements ConnectionReuseStrategy {
+
+    public static final NoConnectionReuseStrategy INSTANCE = new NoConnectionReuseStrategy();
+
+    @Override
+    public boolean keepAlive(final HttpRequest request, final HttpResponse response, final HttpContext context) {
+        return false;
+    }
+
+}


(httpcomponents-core) 02/04: Make local variable final

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-core.git

commit b8ad52f5fa0d1af34f5bd57c412ca36b6be48b6f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Nov 6 17:40:21 2024 +0100

    Make local variable final
---
 .../src/main/java/org/apache/hc/core5/http2/hpack/StaticTable.java  | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/StaticTable.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/StaticTable.java
index 91b3db39a..c58ee5043 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/StaticTable.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/StaticTable.java
@@ -112,12 +112,10 @@ final class StaticTable {
 
         for (int i = 0; i < headers.length; i++) {
             final HPackHeader header = headers[i];
-
             final String key = header.getName();
-            CopyOnWriteArrayList<HPackEntry> entries = this.mapByName.get(key);
+            final CopyOnWriteArrayList<HPackEntry> entries = this.mapByName.get(key);
             if (entries == null) {
-                entries = new CopyOnWriteArrayList<>(new HPackEntry[] { new InternalEntry(header, i) });
-                this.mapByName.put(key, entries);
+                this.mapByName.put(key, new CopyOnWriteArrayList<>(new HPackEntry[] { new InternalEntry(header, i) }));
             } else {
                 entries.add(new InternalEntry(header, i));
             }


(httpcomponents-core) 01/04: Use Map#computeIfAbsent() instead of get(), test, and put()

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-core.git

commit 9c46cd455ad0014b332c96c5807c90627c30f01d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Nov 6 17:39:44 2024 +0100

    Use Map#computeIfAbsent() instead of get(), test, and put()
---
 .../src/main/java/org/apache/hc/core5/pool/StrictConnPool.java     | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java b/httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java
index 819238b38..0bc0c1b6d 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java
@@ -157,12 +157,7 @@ public class StrictConnPool<T, C extends ModalCloseable> implements ManagedConnP
     }
 
     private PerRoutePool<T, C> getPool(final T route) {
-        PerRoutePool<T, C> pool = this.routeToPool.get(route);
-        if (pool == null) {
-            pool = new PerRoutePool<>(route, this.disposalCallback);
-            this.routeToPool.put(route, pool);
-        }
-        return pool;
+        return this.routeToPool.computeIfAbsent(route, r -> new PerRoutePool<>(route, this.disposalCallback));
     }
 
     @Override