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 2014/08/06 16:10:17 UTC

svn commit: r1616238 - /httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java

Author: olegk
Date: Wed Aug  6 14:10:17 2014
New Revision: 1616238

URL: http://svn.apache.org/r1616238
Log:
HTTPCLIENT-1535: Permit other addresses to be tried in the event of a NoRouteToHostException.  e.g. when there one of the addresses to be used is an ipv6 address when the client does not have an ipv6 route to that particular host

Modified:
    httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java

Modified: httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java?rev=1616238&r1=1616237&r2=1616238&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java (original)
+++ httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java Wed Aug  6 14:10:17 2014
@@ -28,6 +28,7 @@ package org.apache.http.impl.conn;
 
 import java.io.IOException;
 import java.net.ConnectException;
+import java.net.NoRouteToHostException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.Socket;
@@ -141,6 +142,10 @@ class HttpClientConnectionOperator {
                         throw new HttpHostConnectException(ex, host, addresses);
                     }
                 }
+            } catch (final NoRouteToHostException ex) {
+                if (last) {
+                    throw ex;
+                }
             }
             if (this.log.isDebugEnabled()) {
                 this.log.debug("Connect to " + remoteAddress + " timed out. " +