Ensure correct socket variable is used; rename sslock => sslsock

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@652153 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2008-04-29 21:33:59 +00:00
parent bdfd6701cf
commit 4419c91e65
1 changed files with 7 additions and 7 deletions

View File

@ -272,7 +272,7 @@ public class SSLSocketFactory implements LayeredSocketFactory {
throw new IllegalArgumentException("Parameters may not be null.");
}
SSLSocket sslock = (SSLSocket)
SSLSocket sslsock = (SSLSocket)
((sock != null) ? sock : createSocket());
if ((localAddress != null) || (localPort > 0)) {
@ -283,25 +283,25 @@ public class SSLSocketFactory implements LayeredSocketFactory {
InetSocketAddress isa =
new InetSocketAddress(localAddress, localPort);
sslock.bind(isa);
sslsock.bind(isa);
}
int connTimeout = HttpConnectionParams.getConnectionTimeout(params);
int soTimeout = HttpConnectionParams.getSoTimeout(params);
sock.connect(new InetSocketAddress(host, port), connTimeout);
sslsock.connect(new InetSocketAddress(host, port), connTimeout);
sslock.setSoTimeout(soTimeout);
sslsock.setSoTimeout(soTimeout);
try {
hostnameVerifier.verify(host, sslock);
hostnameVerifier.verify(host, sslsock);
// verifyHostName() didn't blowup - good!
} catch (IOException iox) {
// close the socket before re-throwing the exception
try { sslock.close(); } catch (Exception x) { /*ignore*/ }
try { sslsock.close(); } catch (Exception x) { /*ignore*/ }
throw iox;
}
return sslock;
return sslsock;
}