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:14:46 UTC

svn commit: r1616239 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java

Author: olegk
Date: Wed Aug  6 14:14:45 2014
New Revision: 1616239

URL: http://svn.apache.org/r1616239
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/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java?rev=1616239&r1=1616238&r2=1616239&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java Wed Aug  6 14:14:45 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;
@@ -150,6 +151,10 @@ public class DefaultHttpClientConnection
                         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. " +