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

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1616239 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2014-08-06 14:14:45 +00:00
parent 0bc123c992
commit 262fec5203
1 changed files with 5 additions and 0 deletions

View File

@ -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 DefaultHttpClientConnectionOperator implements HttpClientConnection
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. " +