hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1376672 - in /httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client: DefaultRequestDirector.java HttpAuthenticator.java
Date Thu, 23 Aug 2012 20:11:18 GMT
Author: olegk
Date: Thu Aug 23 20:11:18 2012
New Revision: 1376672

URL: http://svn.apache.org/viewvc?rev=1376672&view=rev
Log:
HTTPCLIENT-1224: (regression) NTLM auth not retried after a redirect over a non-persistent
connection

Modified:
    httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
    httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java

Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java?rev=1376672&r1=1376671&r2=1376672&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
(original)
+++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Thu Aug 23 20:11:18 2012
@@ -555,13 +555,13 @@ public class DefaultRequestDirector impl
                         managedConn.markReusable();
                     } else {
                         managedConn.close();
-                        if (proxyAuthState.getState() == AuthProtocolState.SUCCESS
+                        if (proxyAuthState.getState().compareTo(AuthProtocolState.CHALLENGED)
> 0
                                 && proxyAuthState.getAuthScheme() != null
                                 && proxyAuthState.getAuthScheme().isConnectionBased())
{
                             this.log.debug("Resetting proxy auth state");
                             proxyAuthState.reset();
                         }
-                        if (targetAuthState.getState() == AuthProtocolState.SUCCESS
+                        if (targetAuthState.getState().compareTo(AuthProtocolState.CHALLENGED)
> 0
                                 && targetAuthState.getAuthScheme() != null
                                 && targetAuthState.getAuthScheme().isConnectionBased())
{
                             this.log.debug("Resetting target auth state");

Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java?rev=1376672&r1=1376671&r2=1376672&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java
(original)
+++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java
Thu Aug 23 20:11:18 2012
@@ -64,11 +64,13 @@ public class HttpAuthenticator {
             final AuthState authState,
             final HttpContext context) {
         if (authStrategy.isAuthenticationRequested(host, response, context)) {
+            this.log.debug("Authentication required");
             return true;
         } else {
             switch (authState.getState()) {
             case CHALLENGED:
             case HANDSHAKE:
+                this.log.debug("Authentication succeeded");
                 authState.setState(AuthProtocolState.SUCCESS);
                 authStrategy.authSucceeded(host, authState.getAuthScheme(), context);
                 break;



Mime
View raw message