hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1427541 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java
Date Tue, 01 Jan 2013 19:28:21 GMT
Author: olegk
Date: Tue Jan  1 19:28:20 2013
New Revision: 1427541

URL: http://svn.apache.org/viewvc?rev=1427541&view=rev
Log:
HTTPCLIENT-1287: DefaultUserTokenHandler#getUserToken to check if the connection is open prior
to retrieving SSLSession.
Contributed by Noah Levitt <nlevitt at gmail.com>

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java?rev=1427541&r1=1427540&r2=1427541&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java
Tue Jan  1 19:28:20 2013
@@ -76,7 +76,7 @@ public class DefaultUserTokenHandler imp
 
         if (userPrincipal == null) {
             HttpConnection conn = clientContext.getConnection();
-            if (conn instanceof SocketClientConnection) {
+            if (conn.isOpen() && conn instanceof SocketClientConnection) {
                 SSLSession sslsession = ((SocketClientConnection) conn).getSSLSession();
                 if (sslsession != null) {
                     userPrincipal = sslsession.getLocalPrincipal();



Mime
View raw message