hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1075780 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
Date Tue, 01 Mar 2011 11:17:49 GMT
Author: olegk
Date: Tue Mar  1 11:17:48 2011
New Revision: 1075780

URL: http://svn.apache.org/viewvc?rev=1075780&view=rev
Log:
Code optimization: perform auth cache lookup only if no auth scheme is available in the auth
state

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java?rev=1075780&r1=1075779&r2=1075780&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
Tue Mar  1 11:17:48 2011
@@ -83,7 +83,7 @@ public class RequestAuthCache implements
 
         HttpHost target = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
         AuthState targetState = (AuthState) context.getAttribute(ClientContext.TARGET_AUTH_STATE);
-        if (target != null && targetState != null) {
+        if (target != null && targetState != null && targetState.getAuthScheme()
== null) {
             AuthScheme authScheme = authCache.get(target);
             if (authScheme != null) {
                 doPreemptiveAuth(target, authScheme, targetState, credsProvider);
@@ -92,7 +92,7 @@ public class RequestAuthCache implements
 
         HttpHost proxy = (HttpHost) context.getAttribute(ExecutionContext.HTTP_PROXY_HOST);
         AuthState proxyState = (AuthState) context.getAttribute(ClientContext.PROXY_AUTH_STATE);
-        if (proxy != null && proxyState != null) {
+        if (proxy != null && proxyState != null && proxyState.getAuthScheme()
== null) {
             AuthScheme authScheme = authCache.get(proxy);
             if (authScheme != null) {
                 doPreemptiveAuth(proxy, authScheme, proxyState, credsProvider);



Mime
View raw message