Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 286CD970A for ; Thu, 23 Aug 2012 20:12:06 +0000 (UTC) Received: (qmail 20054 invoked by uid 500); 23 Aug 2012 20:12:06 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 20011 invoked by uid 500); 23 Aug 2012 20:12:05 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 20004 invoked by uid 99); 23 Aug 2012 20:12:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Aug 2012 20:12:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Aug 2012 20:12:03 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E83112388A32 for ; Thu, 23 Aug 2012 20:11:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120823201118.E83112388A32@eris.apache.org> 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;