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/06 12:40:18 UTC

[httpcomponents-core] branch master updated (9dec680 -> 7dfe330)

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.


    from 9dec680  Added Greeting Example
     new c017834  Removed deprecated methods
     new 75f913e  Fixed generics
     new 7dfe330  Updated release notes for HttpCore 5.0-beta8 release

The 3 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:
 RELEASE_NOTES.txt                                  | 73 ++++++++++++++++++++--
 .../apache/hc/core5/benchmark/HttpBenchmark.java   |  5 --
 .../core5/testing/framework/TestingFramework.java  |  3 +-
 .../hc/core5/testing/nio/LoggingIOSession.java     |  5 --
 .../testing/nio/Http2ServerAndRequesterTest.java   |  6 +-
 .../hc/core5/http/protocol/HttpDateGenerator.java  |  6 +-
 .../hc/core5/http/protocol/UriPatternType.java     |  6 --
 .../org/apache/hc/core5/reactor/IOSession.java     | 10 ---
 .../org/apache/hc/core5/reactor/IOSessionImpl.java |  5 --
 .../hc/core5/reactor/InternalDataChannel.java      |  5 --
 .../apache/hc/core5/reactor/ssl/SSLIOSession.java  |  5 --
 .../java/org/apache/hc/core5/util/Deadline.java    | 11 ----
 .../java/org/apache/hc/core5/util/TimeValue.java   |  8 ---
 .../java/org/apache/hc/core5/util/Timeout.java     | 12 ----
 .../hc/core5/http/protocol/TestUriPatternType.java |  7 ---
 15 files changed, 74 insertions(+), 93 deletions(-)


[httpcomponents-core] 02/03: Fixed generics

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 75f913eb3582f7352fd35c192c119ea646babc8b
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Jun 5 12:15:47 2019 +0200

    Fixed generics
---
 .../org/apache/hc/core5/testing/framework/TestingFramework.java     | 3 ++-
 .../apache/hc/core5/testing/nio/Http2ServerAndRequesterTest.java    | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/framework/TestingFramework.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/framework/TestingFramework.java
index 7c2f9f8..b9ac33e 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/framework/TestingFramework.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/framework/TestingFramework.java
@@ -52,6 +52,7 @@ import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.ProtocolVersion;
 import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
 import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
+import org.apache.hc.core5.http.io.HttpRequestHandler;
 import org.apache.hc.core5.http.io.SocketConfig;
 import org.apache.hc.core5.http.protocol.UriPatternMatcher;
 import org.apache.hc.core5.io.CloseMode;
@@ -232,7 +233,7 @@ public class TestingFramework {
                                           .build();
 
         final ServerBootstrap serverBootstrap = ServerBootstrap.bootstrap()
-                                          .setLookupRegistry(new UriPatternMatcher())
+                                          .setLookupRegistry(new UriPatternMatcher<HttpRequestHandler>())
                                           .setSocketConfig(socketConfig)
                                           .register("/*", requestHandler);
 
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndRequesterTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndRequesterTest.java
index 9bcd1b6..f0f6b0f 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndRequesterTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndRequesterTest.java
@@ -47,10 +47,10 @@ import org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester;
 import org.apache.hc.core5.http.impl.bootstrap.HttpAsyncServer;
 import org.apache.hc.core5.http.nio.AsyncClientEndpoint;
 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.BasicRequestProducer;
+import org.apache.hc.core5.http.nio.support.BasicResponseConsumer;
 import org.apache.hc.core5.http.protocol.UriPatternMatcher;
 import org.apache.hc.core5.http2.HttpVersionPolicy;
 import org.apache.hc.core5.http2.impl.nio.bootstrap.H2RequesterBootstrap;
@@ -107,7 +107,7 @@ public class Http2ServerAndRequesterTest {
         protected void before() throws Throwable {
             log.debug("Starting up test server");
             server = H2ServerBootstrap.bootstrap()
-                    .setLookupRegistry(new UriPatternMatcher())
+                    .setLookupRegistry(new UriPatternMatcher<Supplier<AsyncServerExchangeHandler>>())
                     .setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
                     .setIOReactorConfig(
                             IOReactorConfig.custom()


[httpcomponents-core] 03/03: Updated release notes for HttpCore 5.0-beta8 release

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 7dfe33022c0071733b136a21f607ff48dae8df3c
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Tue Jun 4 10:56:22 2019 +0200

    Updated release notes for HttpCore 5.0-beta8 release
---
 RELEASE_NOTES.txt | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 68 insertions(+), 5 deletions(-)

diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 1594cdd..61e5529 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,21 +1,83 @@
 Release 5.0-BETA8
 -------------------
 
+This BETA fixes a number of defects found since the last release and adds several
+convenience factory and builder classes, mainly for TLS configuration and HTTP
+message construction.
+
+As of this version all server and requester implementations exclude weak TLS protocol
+versions and ciphers.
+
+Please note that the following interfaces have changed: ResponseChannel,
+AsyncRequestConsumer, AsyncResponseConsumer, HttpContentProducer, SSLServerSetupHandler.
+
+IMPORTANT: This release is expected to be the last BETA version. If no major
+design flaws are found the actual 5.0 API will be frozen and the next version will be
+promoted to GA.
+
+
+Change Log
+-------------------
+
+* Classic and async message builders.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* Improved classic and async entity factory methods.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* HTTPCORE-578: Incorrect serialization of HeaderGroup.
+  Contributed by Gary Gregory <garydgregory at gmail.com>
+
+* HTTPCORE-577: Server side HTTP protocol negotiator to propagate exceptions
+  to the i/o event handler associated with the i/o session.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* HTTPCLIENT-1986: URIBuilder#isPathEmpty method to verify if encodedPath
+  is an empty string.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* SSLIOSession: Improve connectTimeout implementation.
+  Contributed by Ryan Schmitt <rschmitt at apache.org>
+
+* HTTPCLIENT-1981: Disallow TRACE requests with an enclosed entity.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* HTTPCLIENT-1978: Filter characters before byte conversion.
+  Contributed by Ryan Schmitt <rschmitt at apache.org>
+
+* HTTPCORE-573: FileContentDecoder don't always enforce the maximum number of
+  bytes to transfer.
+  Contributed by Julien Coloos <julien.coloos at gmail.com>
+
+* All server and requester implementation to exclude weak TLS protocol versions
+  and ciphers.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* Improved SSL setup handling for classic requester and server.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* Common TLS support methods migrated from HttpClient.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* Bug fix: non-blocking SSL I/O sessions fail to fire session disconnected event.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* Bug fix: basic entity consumers to clear buffered content when releasing resources.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * conscrypt-openjdk-uber 1.4.1 -> 1.4.2.
   Contributed by Gary Gregory <garydgregory at gmail.com>
 
 * Provide more information when a BindException occurs.
   Contributed by Gary Gregory <garydgregory at gmail.com>
 
-* Refactor ClassicHttpRequest and ClassicHttpResponse interfaces to extend a new interface HttpEntityContainer.
+* Refactor ClassicHttpRequest and ClassicHttpResponse interfaces to extend
+  a new interface HttpEntityContainer.
   Contributed by Gary Gregory <garydgregory at gmail.com>
   
 * Update RxJava from 2.2.7 to 2.2.8.
   Contributed by Gary Gregory <garydgregory at gmail.com>
-  
-* [HTTPCORE-578] Incorrect serialization of HeaderGroup #127
-  Contributed by Gary Gregory <garydgregory at gmail.com>
-  
+
 
 Release 5.0-BETA7
 -------------------
@@ -26,6 +88,7 @@ handshake timeout configuration, improves URI builder, and fixes various defects
 Please note that the following interfaces have changed: TlsStrategy, IOSession,
 TransportSecurityLayer.
 
+
 Change Log
 -------------------
 


[httpcomponents-core] 01/03: Removed deprecated methods

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 c0178348549dc42d3c9a528b3299272ea611cf24
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Jun 5 12:14:16 2019 +0200

    Removed deprecated methods
---
 .../java/org/apache/hc/core5/benchmark/HttpBenchmark.java    |  5 -----
 .../org/apache/hc/core5/testing/nio/LoggingIOSession.java    |  5 -----
 .../org/apache/hc/core5/http/protocol/HttpDateGenerator.java |  6 +-----
 .../org/apache/hc/core5/http/protocol/UriPatternType.java    |  6 ------
 .../src/main/java/org/apache/hc/core5/reactor/IOSession.java | 10 ----------
 .../main/java/org/apache/hc/core5/reactor/IOSessionImpl.java |  5 -----
 .../org/apache/hc/core5/reactor/InternalDataChannel.java     |  5 -----
 .../java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java   |  5 -----
 .../src/main/java/org/apache/hc/core5/util/Deadline.java     | 11 -----------
 .../src/main/java/org/apache/hc/core5/util/TimeValue.java    |  8 --------
 .../src/main/java/org/apache/hc/core5/util/Timeout.java      | 12 ------------
 .../apache/hc/core5/http/protocol/TestUriPatternType.java    |  7 -------
 12 files changed, 1 insertion(+), 84 deletions(-)

diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/HttpBenchmark.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/HttpBenchmark.java
index 11aaabd..e3a6c02 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/HttpBenchmark.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/benchmark/HttpBenchmark.java
@@ -189,11 +189,6 @@ public class HttpBenchmark {
                             }
 
                             @Override
-                            public Lock lock() {
-                                return ioSession.getLock();
-                            }
-
-                            @Override
                             public void enqueue(final Command command, final Command.Priority priority) {
                                 ioSession.enqueue(command, priority);
                             }
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSession.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSession.java
index 054d2e0..b29beb2 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSession.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSession.java
@@ -71,11 +71,6 @@ public class LoggingIOSession implements IOSession {
     }
 
     @Override
-    public Lock lock() {
-        return this.session.getLock();
-    }
-
-    @Override
     public void enqueue(final Command command, final Command.Priority priority) {
         this.session.enqueue(command, priority);
         if (this.log.isDebugEnabled()) {
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/HttpDateGenerator.java b/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/HttpDateGenerator.java
index 936f160..c60875a 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/HttpDateGenerator.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/HttpDateGenerator.java
@@ -59,11 +59,7 @@ public class HttpDateGenerator {
     private long dateAsMillis = 0L;
     private String dateAsText = null;
 
-    /**
-     * @deprecated Use {@link #INSTANCE}.
-     */
-    @Deprecated
-    public HttpDateGenerator() {
+    HttpDateGenerator() {
         super();
         this.dateformat = new SimpleDateFormat(PATTERN_RFC1123, Locale.US);
         this.dateformat.setTimeZone(GMT);
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/UriPatternType.java b/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/UriPatternType.java
index 35c5625..1094951 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/UriPatternType.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/UriPatternType.java
@@ -32,12 +32,6 @@ package org.apache.hc.core5.http.protocol;
  */
 public enum UriPatternType {
 
-    /**
-     * @deprecated Use {@link #URI_PATTERN}.
-     */
-    @Deprecated
-    BASIC,
-
     REGEX, URI_PATTERN, URI_PATTERN_IN_ORDER;
 
     public static <T> LookupRegistry<T> newMatcher(final UriPatternType type) {
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSession.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSession.java
index 4f5edb9..cdbcefd 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSession.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSession.java
@@ -66,16 +66,6 @@ public interface IOSession extends ModalCloseable, Identifiable {
     Lock getLock();
 
     /**
-     * Returns session lock that should be used by I/O event handlers
-     * to synchronize access to the session.
-     *
-     * @since 5.0
-     * @deprecated Use {@link #getLock()}.
-     */
-    @Deprecated
-    Lock lock();
-
-    /**
      * Inserts {@link Command} at the end of the command queue.
      *
      * @since 5.0
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
index 23a8aa1..1cd7566 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
@@ -90,11 +90,6 @@ class IOSessionImpl implements IOSession {
     }
 
     @Override
-    public Lock lock() {
-        return lock;
-    }
-
-    @Override
     public void enqueue(final Command command, final Command.Priority priority) {
         if (priority == Command.Priority.IMMEDIATE) {
             commandQueue.addFirst(command);
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java
index 4597e7d..61b3207 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java
@@ -276,11 +276,6 @@ final class InternalDataChannel extends InternalChannel implements ProtocolIOSes
         return ioSession.getLock();
     }
 
-    @Override
-    public Lock lock() {
-        return ioSession.getLock();
-    }
-
     private IOSession getSessionImpl() {
         final SSLIOSession tlsSession = tlsSessionRef.get();
         return tlsSession != null ? tlsSession : ioSession;
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
index 3e964a1..5c24137 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
@@ -184,11 +184,6 @@ public class SSLIOSession implements IOSession {
         return this.session.getLock();
     }
 
-    @Override
-    public Lock lock() {
-        return this.session.getLock();
-    }
-
     /**
      * Returns {@code true} is the session has been fully initialized,
      * {@code false} otherwise.
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/util/Deadline.java b/httpcore5/src/main/java/org/apache/hc/core5/util/Deadline.java
index bffdb5c..2a598a0 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/util/Deadline.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/util/Deadline.java
@@ -142,17 +142,6 @@ public class Deadline {
         setLastCheck();
     }
 
-    /**
-     * Returns the difference in milliseconds between the deadline and now.
-     *
-     * @return the different in milliseconds between the deadline and now.
-     * @deprecated Use {@link #remaining()}
-     */
-    @Deprecated
-    public long difference() {
-        return remaining();
-    }
-
     @Override
     public boolean equals(final Object obj) {
         // Only take into account the deadline value.
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/util/TimeValue.java b/httpcore5/src/main/java/org/apache/hc/core5/util/TimeValue.java
index 1799355..0db3ec3 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/util/TimeValue.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/util/TimeValue.java
@@ -161,14 +161,6 @@ public class TimeValue {
         return of(microseconds, TimeUnit.MICROSECONDS);
     }
 
-    /**
-     * @deprecated Use {@link #ofMilliseconds(long)}.
-     */
-    @Deprecated
-    public static TimeValue ofMillis(final long millis) {
-        return of(millis, TimeUnit.MILLISECONDS);
-    }
-
     public static TimeValue ofMilliseconds(final long millis) {
         return of(millis, TimeUnit.MILLISECONDS);
     }
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/util/Timeout.java b/httpcore5/src/main/java/org/apache/hc/core5/util/Timeout.java
index 04a8c7e..f6a835a 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/util/Timeout.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/util/Timeout.java
@@ -107,18 +107,6 @@ public class Timeout extends TimeValue {
      *
      * @param milliseconds the duration in milliseconds and the given {@code timeUnit}.
      * @return a Timeout
-     * @deprecated Use {@link #ofMilliseconds(long)}
-     */
-    @Deprecated
-    public static Timeout ofMillis(final long milliseconds) {
-        return of(milliseconds, TimeUnit.MILLISECONDS);
-    }
-
-    /**
-     * Creates a Timeout.
-     *
-     * @param milliseconds the duration in milliseconds and the given {@code timeUnit}.
-     * @return a Timeout
      */
     public static Timeout ofMilliseconds(final long milliseconds) {
         return of(milliseconds, TimeUnit.MILLISECONDS);
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/protocol/TestUriPatternType.java b/httpcore5/src/test/java/org/apache/hc/core5/http/protocol/TestUriPatternType.java
index 7ce433f..2c1b5d8 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/protocol/TestUriPatternType.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/protocol/TestUriPatternType.java
@@ -33,13 +33,6 @@ import org.junit.Test;
 public class TestUriPatternType {
 
     @Test
-    public void testBasic() {
-        @SuppressWarnings("deprecation")
-        final LookupRegistry<Object> matcher = UriPatternType.newMatcher(UriPatternType.BASIC);
-        Assert.assertTrue(matcher instanceof UriPatternMatcher);
-    }
-
-    @Test
     public void testRegex() {
         final LookupRegistry<Object> matcher = UriPatternType.newMatcher(UriPatternType.REGEX);
         Assert.assertTrue(matcher instanceof UriRegexMatcher);