mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-27 13:25:35 +00:00
HTTPCLIENT-1058: SO_TIMEOUT not set early enough for SOCKS proxies
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1070943 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a54611e8d6
commit
c3c7ba214d
@ -115,9 +115,12 @@ public Socket connectSocket(
|
||||
sock.setReuseAddress(HttpConnectionParams.getSoReuseaddr(params));
|
||||
sock.bind(localAddress);
|
||||
}
|
||||
int timeout = HttpConnectionParams.getConnectionTimeout(params);
|
||||
int connTimeout = HttpConnectionParams.getConnectionTimeout(params);
|
||||
int soTimeout = HttpConnectionParams.getSoTimeout(params);
|
||||
|
||||
try {
|
||||
sock.connect(remoteAddress, timeout);
|
||||
sock.setSoTimeout(soTimeout);
|
||||
sock.connect(remoteAddress, connTimeout);
|
||||
} catch (SocketTimeoutException ex) {
|
||||
throw new ConnectTimeoutException("Connect to " + remoteAddress.getHostName() + "/"
|
||||
+ remoteAddress.getAddress() + " timed out");
|
||||
|
@ -371,12 +371,12 @@ public Socket connectSocket(
|
||||
int soTimeout = HttpConnectionParams.getSoTimeout(params);
|
||||
|
||||
try {
|
||||
sock.setSoTimeout(soTimeout);
|
||||
sock.connect(remoteAddress, connTimeout);
|
||||
} catch (SocketTimeoutException ex) {
|
||||
throw new ConnectTimeoutException("Connect to " + remoteAddress.getHostName() + "/"
|
||||
+ remoteAddress.getAddress() + " timed out");
|
||||
}
|
||||
sock.setSoTimeout(soTimeout);
|
||||
SSLSocket sslsock;
|
||||
// Setup SSL layering if necessary
|
||||
if (sock instanceof SSLSocket) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user