hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1189374 - in /httpcomponents/httpclient/branches/4.1.x: RELEASE_NOTES.txt httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Date Wed, 26 Oct 2011 18:42:33 GMT
Author: olegk
Date: Wed Oct 26 18:42:33 2011
New Revision: 1189374

URL: http://svn.apache.org/viewvc?rev=1189374&view=rev
Log:
HTTPCLIENT-1140: Infinite loop in case of an authentication failure if WARN priority logging
is disabled

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

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=1189374&r1=1189373&r2=1189374&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt Wed Oct 26 18:42:33 2011
@@ -1,6 +1,9 @@
 Changes since 4.1.2
 -------------------
 
+* [HTTPCLIENT-1140] Infinite loop in case of an authentication failure if WARN priority logging

+  is disabled. 
+
 * [HTTPCLIENT-1127] Fixed deadlock between SingleClientConnManager.releaseConnection() and
   SingleClientConnManager.shutdown()
 

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=1189374&r1=1189373&r2=1189374&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
Wed Oct 26 18:42:33 2011
@@ -359,9 +359,9 @@ public class DefaultRequestDirector impl
 
         virtualHost = (HttpHost) orig.getParams().getParameter(
                 ClientPNames.VIRTUAL_HOST);
-        
+
         // HTTPCLIENT-1092 - add the port if necessary
-        if (virtualHost != null && virtualHost.getPort() == -1) 
+        if (virtualHost != null && virtualHost.getPort() == -1)
         {
             int port = target.getPort();
             if (port != -1){
@@ -502,8 +502,8 @@ public class DefaultRequestDirector impl
                         managedConn.markReusable();
                     } else {
                         managedConn.close();
-                        invalidateAuthIfSuccessful(this.proxyAuthState);                
       
-                        invalidateAuthIfSuccessful(this.targetAuthState);               
        
+                        invalidateAuthIfSuccessful(this.proxyAuthState);
+                        invalidateAuthIfSuccessful(this.targetAuthState);
                     }
                     // check if we can use the same connection for the followup
                     if (!followup.getRoute().equals(roureq.getRoute())) {
@@ -870,8 +870,8 @@ public class DefaultRequestDirector impl
                     } catch (AuthenticationException ex) {
                         if (this.log.isWarnEnabled()) {
                             this.log.warn("Authentication error: " +  ex.getMessage());
-                            break;
                         }
+                        break;
                     }
                     updateAuthState(this.proxyAuthState, proxy, credsProvider);
 
@@ -1095,8 +1095,8 @@ public class DefaultRequestDirector impl
                 } catch (AuthenticationException ex) {
                     if (this.log.isWarnEnabled()) {
                         this.log.warn("Authentication error: " +  ex.getMessage());
-                        return null;
                     }
+                    return null;
                 }
                 updateAuthState(this.targetAuthState, target, credsProvider);
 
@@ -1125,8 +1125,8 @@ public class DefaultRequestDirector impl
                 } catch (AuthenticationException ex) {
                     if (this.log.isWarnEnabled()) {
                         this.log.warn("Authentication error: " +  ex.getMessage());
-                        return null;
                     }
+                    return null;
                 }
                 updateAuthState(this.proxyAuthState, proxy, credsProvider);
 



Mime
View raw message