hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject httpcomponents-client git commit: Fixed handling of task cancelation
Date Sun, 12 Nov 2017 15:20:42 GMT
Repository: httpcomponents-client
Updated Branches:
  refs/heads/master 1577356f3 -> d992bec7a


Fixed handling of task cancelation


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

Branch: refs/heads/master
Commit: d992bec7ad67bc36d4e9b6d6592b9d51f60af232
Parents: 1577356
Author: Oleg Kalnichevski <olegk@apache.org>
Authored: Sun Nov 12 16:19:35 2017 +0100
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Sun Nov 12 16:20:27 2017 +0100

----------------------------------------------------------------------
 .../hc/client5/http/impl/classic/HttpRequestTaskCallable.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/d992bec7/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpRequestTaskCallable.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpRequestTaskCallable.java
b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpRequestTaskCallable.java
index eef7aa1..6536e14 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpRequestTaskCallable.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpRequestTaskCallable.java
@@ -27,6 +27,7 @@
 package org.apache.hc.client5.http.impl.classic;
 
 import java.util.concurrent.Callable;
+import java.util.concurrent.CancellationException;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.hc.client5.http.classic.HttpClient;
@@ -107,7 +108,7 @@ class HttpRequestTaskCallable<V> implements Callable<V> {
                 metrics.getActiveConnections().decrementAndGet();
             }
         } else {
-            throw new IllegalStateException("call has been cancelled");
+            throw new CancellationException();
         }
     }
 


Mime
View raw message