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 2018/09/04 09:03:52 UTC

httpcomponents-client git commit: Enable hard cancellation by default

Repository: httpcomponents-client
Updated Branches:
  refs/heads/master ec9927971 -> b2f09ae0e


Enable hard cancellation by default

This change makes request cancellation behavior more consistent across
different client types (blocking, non-blocking HTTP/1.1, and HTTP/2).


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/b2f09ae0
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/b2f09ae0
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/b2f09ae0

Branch: refs/heads/master
Commit: b2f09ae0eb9c80458355b1f12f47764ce0c3416b
Parents: ec99279
Author: Ryan Schmitt <ry...@amazon.com>
Authored: Fri Aug 31 13:24:34 2018 -0700
Committer: Ryan Schmitt <ry...@amazon.com>
Committed: Fri Aug 31 13:24:38 2018 -0700

----------------------------------------------------------------------
 .../apache/hc/client5/http/config/RequestConfig.java | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/b2f09ae0/httpclient5/src/main/java/org/apache/hc/client5/http/config/RequestConfig.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/config/RequestConfig.java b/httpclient5/src/main/java/org/apache/hc/client5/http/config/RequestConfig.java
index 7d7a3e0..96d2e0d 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/config/RequestConfig.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/config/RequestConfig.java
@@ -258,13 +258,13 @@ public class RequestConfig implements Cloneable {
     /**
      * Determines whether request cancellation, such as through {@code
      * Future#cancel(boolean)}, should kill the underlying connection. If this
-     * option is not set, the client will attempt to preserve the underlying
-     * connection by allowing the request to complete in the background,
-     * discarding the response.
+     * option is set to false, the client will attempt to preserve the
+     * underlying connection by allowing the request to complete in the
+     * background, discarding the response.
      * <p>
-     * Note that setting this option to {@code true} means that cancelling a
-     * request may cause other requests to fail, if they are waiting to use the
-     * same connection.
+     * Note that when this option is {@code true}, cancelling a request may
+     * cause other requests to fail, if they are waiting to use the same
+     * connection.
      * </p>
      * <p>
      * On HTTP/2, this option has no effect. Request cancellation will always
@@ -277,7 +277,7 @@ public class RequestConfig implements Cloneable {
      * always kill the underlying connection.
      * </p>
      * <p>
-     * Default: {@code false}
+     * Default: {@code true}
      * </p>
      *
      * @since 5.0
@@ -357,6 +357,7 @@ public class RequestConfig implements Cloneable {
             this.connectionRequestTimeout = DEFAULT_CONNECTION_REQUEST_TIMEOUT;
             this.connectionTimeout = DEFAULT_CONNECTION_TIMEOUT;
             this.contentCompressionEnabled = true;
+            this.hardCancellationEnabled = true;
         }
 
         public Builder setExpectContinueEnabled(final boolean expectContinueEnabled) {