hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1104220 - in /httpcomponents/httpclient/branches/4.1.x: ./ RELEASE_NOTES.txt httpclient/ httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Date Tue, 17 May 2011 13:03:12 GMT
Author: olegk
Date: Tue May 17 13:03:11 2011
New Revision: 1104220

URL: http://svn.apache.org/viewvc?rev=1104220&view=rev
Log:
HTTPCLIENT-1087: NTLM proxy authentication fails on retry if the underlying connection is
closed as a result of a target authentication failure (merged from trunk)

Modified:
    httpcomponents/httpclient/branches/4.1.x/   (props changed)
    httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt
    httpcomponents/httpclient/branches/4.1.x/httpclient/   (props changed)
    httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java

Propchange: httpcomponents/httpclient/branches/4.1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 17 13:03:11 2011
@@ -1,4 +1,4 @@
 /httpcomponents/httpclient/branches/4.0.x:950681-950688
 /httpcomponents/httpclient/branches/branch_4_1:755593-811107
 /httpcomponents/httpclient/branches/notice-plugin-test:1024348-1031454
-/httpcomponents/httpclient/trunk:1087358,1091140-1091141,1091904
+/httpcomponents/httpclient/trunk:1087358,1091140-1091141,1091904,1104207-1104211

Modified: httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt?rev=1104220&r1=1104219&r2=1104220&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt Tue May 17 13:03:11 2011
@@ -1,5 +1,9 @@
 Changes since 4.1.1
 
+* [HTTPCLIENT-1087] NTLM proxy authentication fails on retry if the underlying connection
is closed
+  as a result of a target authentication failure.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCLIENT-1079] Fixed Kerberos cross-realm support
   Contributed by Michael Osipov <1983-01-06 at gmx.net> 
 

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 17 13:03:11 2011
@@ -1,4 +1,4 @@
 /httpcomponents/httpclient/branches/4.0.x/httpclient:950681-950688
 /httpcomponents/httpclient/branches/branch_4_1/httpclient:755593-811107
 /httpcomponents/httpclient/branches/notice-plugin-test/httpclient:1024348-1031454
-/httpcomponents/httpclient/trunk/httpclient:1087358,1088000-1088004,1091140-1091141,1091904,1100531-1100533
+/httpcomponents/httpclient/trunk/httpclient:1087358,1088000-1088004,1091140-1091141,1091904,1100531-1100533,1104207-1104211

Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java?rev=1104220&r1=1104219&r2=1104220&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Tue May 17 13:03:11 2011
@@ -493,6 +493,8 @@ public class DefaultRequestDirector impl
                         managedConn.markReusable();
                     } else {
                         managedConn.close();
+                        invalidateAuthIfSuccessful(this.proxyAuthState);                
       
+                        invalidateAuthIfSuccessful(this.targetAuthState);               
        
                     }
                     // check if we can use the same connection for the followup
                     if (!followup.getRoute().equals(roureq.getRoute())) {
@@ -1232,4 +1234,14 @@ public class DefaultRequestDirector impl
         authState.setCredentials(creds);
     }
 
+    private void invalidateAuthIfSuccessful(final AuthState authState) {
+        AuthScheme authscheme = authState.getAuthScheme();
+        if (authscheme != null
+                && authscheme.isConnectionBased()
+                && authscheme.isComplete()
+                && authState.getCredentials() != null) {
+            authState.invalidate();
+        }
+    }
+
 } // class DefaultClientRequestDirector



Mime
View raw message