HTTPCLIENT-1098: Avoid expensive reverse DNS lookup on connect timeout excpetion
Contributed by Thomas Boettcher <tboett at gmail.com> git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1132902 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a41eccec14
commit
92d66f3355
|
@ -1,9 +1,14 @@
|
|||
Changes since 4.1.1
|
||||
|
||||
* [HTTPCLIENT-1097] BrowserCompatHostnameVerifier and StrictHostnameVerifier should handle wildcards in SSL certificates better.
|
||||
* [HTTPCLIENT-1098] Avoid expensive reverse DNS lookup on connect timeout exception.
|
||||
Contributed by Thomas Boettcher <tboett at gmail.com>
|
||||
|
||||
* [HTTPCLIENT-1097] BrowserCompatHostnameVerifier and StrictHostnameVerifier should handle
|
||||
wildcards in SSL certificates better.
|
||||
Contributed by Sebastian Bazley <sebb at apache.org>
|
||||
|
||||
* [HTTPCLIENT-1092] If ClientPNames.VIRTUAL_HOST does not provide the port, derive it from the current request.
|
||||
* [HTTPCLIENT-1092] If ClientPNames.VIRTUAL_HOST does not provide the port, derive it from the
|
||||
current request.
|
||||
Contributed by Sebastian Bazley <sebb at apache.org>
|
||||
|
||||
* [HTTPCLIENT-1087] NTLM proxy authentication fails on retry if the underlying connection is closed
|
||||
|
|
|
@ -54,5 +54,11 @@ public class HttpInetSocketAddress extends InetSocketAddress {
|
|||
public HttpHost getHost() {
|
||||
return this.host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.host.getHostName() + ":" + getPort();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -122,8 +122,7 @@ public class PlainSocketFactory implements SocketFactory, SchemeSocketFactory {
|
|||
sock.setSoTimeout(soTimeout);
|
||||
sock.connect(remoteAddress, connTimeout);
|
||||
} catch (SocketTimeoutException ex) {
|
||||
throw new ConnectTimeoutException("Connect to " + remoteAddress.getHostName() + "/"
|
||||
+ remoteAddress.getAddress() + " timed out");
|
||||
throw new ConnectTimeoutException("Connect to " + remoteAddress + " timed out");
|
||||
}
|
||||
return sock;
|
||||
}
|
||||
|
|
|
@ -375,8 +375,7 @@ public class SSLSocketFactory implements LayeredSchemeSocketFactory, LayeredSock
|
|||
sock.setSoTimeout(soTimeout);
|
||||
sock.connect(remoteAddress, connTimeout);
|
||||
} catch (SocketTimeoutException ex) {
|
||||
throw new ConnectTimeoutException("Connect to " + remoteAddress.getHostName() + "/"
|
||||
+ remoteAddress.getAddress() + " timed out");
|
||||
throw new ConnectTimeoutException("Connect to " + remoteAddress + " timed out");
|
||||
}
|
||||
SSLSocket sslsock;
|
||||
// Setup SSL layering if necessary
|
||||
|
|
Loading…
Reference in New Issue