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 2019/06/16 13:16:25 UTC

[httpcomponents-core] branch bug-fixes updated (6e23373 -> f8d3f7c)

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

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


 discard 6e23373  Improved protocol I/O logging
 discard f82290e  Improved exception handling in the async HTTP protocol negotiators
     add 5c28eb2  Improved exception handling in the async HTTP protocol negotiators
     add d8cf074  Improved protocol I/O logging
     add 4305837  Better HttpVersion and ProtocolVersion. (#131)
     new 1ba0b99  Code cleanup
     new f8d3f7c  An attempt at fixing a flaky test case

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   (6e23373)
            \
             N -- N -- N   refs/heads/bug-fixes (f8d3f7c)

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 2 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:
 .../Http2ServerAndMultiplexingRequesterTest.java   | 27 +++++++---
 .../java/org/apache/hc/core5/http/HttpVersion.java | 50 +++++++----------
 .../org/apache/hc/core5/http/ProtocolVersion.java  | 63 ++++++++++------------
 .../hc/core5/http/message/BasicLineFormatter.java  | 16 +++---
 .../hc/core5/http/message/BasicLineParser.java     |  2 +-
 .../java/org/apache/hc/core5/pool/PoolEntry.java   |  5 +-
 .../org/apache/hc/core5/http/TestHttpVersion.java  | 46 +++++++++++++---
 .../apache/hc/core5/http/TestProtocolVersion.java  | 19 ++++---
 8 files changed, 127 insertions(+), 101 deletions(-)
 copy httpcore5-h2/src/test/java/org/apache/hc/core5/http2/frame/TestFrameFlag.java => httpcore5/src/test/java/org/apache/hc/core5/http/TestProtocolVersion.java (65%)


[httpcomponents-core] 01/02: Code cleanup

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

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

commit 1ba0b996393fab033cbf785b97bdbb8e104feaee
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sun Jun 16 13:23:39 2019 +0200

    Code cleanup
---
 httpcore5/src/main/java/org/apache/hc/core5/pool/PoolEntry.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/pool/PoolEntry.java b/httpcore5/src/main/java/org/apache/hc/core5/pool/PoolEntry.java
index fee02f3..60c11d7 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/pool/PoolEntry.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/pool/PoolEntry.java
@@ -52,13 +52,13 @@ public final class PoolEntry<T, C extends ModalCloseable> {
     private final T route;
     private final TimeValue timeToLive;
     private final AtomicReference<C> connRef;
+    private final Supplier<Long> currentTimeSupplier;
 
     private volatile Object state;
     private volatile long created;
     private volatile long updated;
     private volatile Deadline expiryDeadline = Deadline.MIN_VALUE;
     private volatile Deadline validityDeadline = Deadline.MIN_VALUE;
-    private Supplier<Long> currentTimeSupplier;
 
     PoolEntry(final T route, final TimeValue timeToLive, final Supplier<Long> currentTimeSupplier) {
         super();
@@ -96,8 +96,7 @@ public final class PoolEntry<T, C extends ModalCloseable> {
     }
 
     /**
-     * @since 4.4
-     * @since 5.0 return value is Deadline.
+     * @since 5.0
      */
     public Deadline getValidityDeadline() {
         return this.validityDeadline;


[httpcomponents-core] 02/02: An attempt at fixing a flaky test case

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

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

commit f8d3f7cf2030962b13a8c28652c6b1eaa9b8fe2c
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sun Jun 16 15:12:57 2019 +0200

    An attempt at fixing a flaky test case
---
 .../Http2ServerAndMultiplexingRequesterTest.java   | 27 ++++++++++++++++------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndMultiplexingRequesterTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndMultiplexingRequesterTest.java
index e547878..4cc704b 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndMultiplexingRequesterTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndMultiplexingRequesterTest.java
@@ -38,6 +38,7 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Future;
 
 import org.apache.hc.core5.concurrent.Cancellable;
+import org.apache.hc.core5.concurrent.FutureCallback;
 import org.apache.hc.core5.function.Supplier;
 import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.HttpHost;
@@ -48,11 +49,11 @@ import org.apache.hc.core5.http.Methods;
 import org.apache.hc.core5.http.URIScheme;
 import org.apache.hc.core5.http.impl.bootstrap.HttpAsyncServer;
 import org.apache.hc.core5.http.nio.AsyncServerExchangeHandler;
-import org.apache.hc.core5.http.nio.support.BasicRequestProducer;
-import org.apache.hc.core5.http.nio.support.BasicResponseConsumer;
 import org.apache.hc.core5.http.nio.entity.StringAsyncEntityConsumer;
 import org.apache.hc.core5.http.nio.entity.StringAsyncEntityProducer;
 import org.apache.hc.core5.http.nio.support.BasicClientExchangeHandler;
+import org.apache.hc.core5.http.nio.support.BasicRequestProducer;
+import org.apache.hc.core5.http.nio.support.BasicResponseConsumer;
 import org.apache.hc.core5.http.protocol.HttpCoreContext;
 import org.apache.hc.core5.http2.impl.nio.bootstrap.H2ServerBootstrap;
 import org.apache.hc.core5.http2.impl.nio.bootstrap.Http2MultiplexingRequester;
@@ -348,19 +349,31 @@ public class Http2ServerAndMultiplexingRequesterTest {
             final Cancellable cancellable = requester.execute(
                     new BasicClientExchangeHandler<>(new BasicRequestProducer(Methods.POST, target, "/stuff",
                             new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
-                            new BasicResponseConsumer<>(new StringAsyncEntityConsumer() {
+                            new BasicResponseConsumer<>(new StringAsyncEntityConsumer()),
+                            new FutureCallback<Message<HttpResponse, String>>() {
 
                                 @Override
-                                public void releaseResources() {
-                                    super.releaseResources();
+                                public void completed(final Message<HttpResponse, String> result) {
                                     countDownLatch.countDown();
                                 }
-                            }), null), TIMEOUT, HttpCoreContext.create());
+
+                                @Override
+                                public void failed(final Exception ex) {
+                                    countDownLatch.countDown();
+                                }
+
+                                @Override
+                                public void cancelled() {
+                                    countDownLatch.countDown();
+                                }
+
+                            }),
+                    TIMEOUT,
+                    HttpCoreContext.create());
             Thread.sleep(random.nextInt(10));
             cancellable.cancel();
         }
         Assert.assertThat(countDownLatch.await(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit()), CoreMatchers.equalTo(true));
-        Thread.sleep(1500);
     }
 
 }