hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [26/34] httpcomponents-core git commit: make a connection exception throw a ConnectException instead of a SocketTimeoutException to allow a FutureCallback handler to correctly distinguish between the two events
Date Tue, 09 May 2017 20:02:55 GMT
make a connection exception throw a ConnectException instead of a SocketTimeoutException to
allow a FutureCallback handler to correctly distinguish between the two events

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.3.x@1626970
13f79535-47bb-0310-9956-ffa450edef68


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

Branch: refs/heads/4.3.x
Commit: 736bb1b79a2454e4c57a15d92a380d40933f6bb0
Parents: fbe3861
Author: Oleg Kalnichevski <olegk@apache.org>
Authored: Tue Sep 23 09:16:17 2014 +0000
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Tue Sep 23 09:16:17 2014 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/http/nio/pool/RouteSpecificPool.java    | 4 ++--
 .../src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java  | 4 ++--
 .../java/org/apache/http/nio/pool/TestRouteSpecificPool.java     | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/736bb1b7/httpcore-nio/src/main/java/org/apache/http/nio/pool/RouteSpecificPool.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/pool/RouteSpecificPool.java b/httpcore-nio/src/main/java/org/apache/http/nio/pool/RouteSpecificPool.java
index 576c786..b50096f 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/pool/RouteSpecificPool.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/pool/RouteSpecificPool.java
@@ -26,7 +26,7 @@
  */
 package org.apache.http.nio.pool;
 
-import java.net.SocketTimeoutException;
+import java.net.ConnectException;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -167,7 +167,7 @@ abstract class RouteSpecificPool<T, C, E extends PoolEntry<T, C>>
{
 
     public void timeout(final SessionRequest request) {
         final BasicFuture<E> future = removeRequest(request);
-        future.failed(new SocketTimeoutException());
+        future.failed(new ConnectException());
     }
 
     public void shutdown() {

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/736bb1b7/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java b/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java
index 52cac99..fcc098f 100644
--- a/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java
+++ b/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java
@@ -29,7 +29,7 @@ package org.apache.http.nio.pool;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
-import java.net.SocketTimeoutException;
+import java.net.ConnectException;
 import java.net.UnknownHostException;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
@@ -291,7 +291,7 @@ public class TestNIOConnPool {
             future.get();
             Assert.fail("ExecutionException should have been thrown");
         } catch (final ExecutionException ex) {
-            Assert.assertTrue(ex.getCause() instanceof SocketTimeoutException);
+            Assert.assertTrue(ex.getCause() instanceof ConnectException);
         }
 
         totals = pool.getTotalStats();

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/736bb1b7/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestRouteSpecificPool.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestRouteSpecificPool.java
b/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestRouteSpecificPool.java
index cc10378..f341fa9 100644
--- a/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestRouteSpecificPool.java
+++ b/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestRouteSpecificPool.java
@@ -27,7 +27,7 @@
 package org.apache.http.nio.pool;
 
 import java.io.IOException;
-import java.net.SocketTimeoutException;
+import java.net.ConnectException;
 import java.util.concurrent.ExecutionException;
 
 import org.apache.http.concurrent.BasicFuture;
@@ -171,7 +171,7 @@ public class TestRouteSpecificPool {
             future.get();
             Assert.fail("ExecutionException should have been thrown");
         } catch (final ExecutionException ex) {
-            Assert.assertTrue(ex.getCause() instanceof SocketTimeoutException);
+            Assert.assertTrue(ex.getCause() instanceof ConnectException);
         }
         Assert.assertEquals(0, pool.getAllocatedCount());
         Assert.assertEquals(0, pool.getAvailableCount());


Mime
View raw message