hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1575899 - in /httpcomponents/httpclient/branches/4.3.x/httpclient/src/main: java-deprecated/org/apache/http/impl/client/DefaultRequestDirector.java java/org/apache/http/client/protocol/RequestAuthCache.java
Date Mon, 10 Mar 2014 11:13:18 GMT
Author: olegk
Date: Mon Mar 10 11:13:18 2014
New Revision: 1575899

URL: http://svn.apache.org/r1575899
Log:
HTTPCLIENT-1479: fixed NPE in RequestAuthCache caused by incorrect context initialization

Modified:
    httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java-deprecated/org/apache/http/impl/client/DefaultRequestDirector.java
    httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java

Modified: httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java-deprecated/org/apache/http/impl/client/DefaultRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java-deprecated/org/apache/http/impl/client/DefaultRequestDirector.java?rev=1575899&r1=1575898&r2=1575899&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java-deprecated/org/apache/http/impl/client/DefaultRequestDirector.java
(original)
+++ httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java-deprecated/org/apache/http/impl/client/DefaultRequestDirector.java
Mon Mar 10 11:13:18 2014
@@ -867,6 +867,7 @@ public class DefaultRequestDirector impl
 
             // Populate the execution context
             context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, target);
+            context.setAttribute(ClientContext.ROUTE, route);
             context.setAttribute(ExecutionContext.HTTP_PROXY_HOST, proxy);
             context.setAttribute(ExecutionContext.HTTP_CONNECTION, managedConn);
             context.setAttribute(ExecutionContext.HTTP_REQUEST, connect);

Modified: httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java?rev=1575899&r1=1575898&r2=1575899&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
(original)
+++ httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
Mon Mar 10 11:13:18 2014
@@ -83,7 +83,17 @@ public class RequestAuthCache implements
         }
 
         final RouteInfo route = clientContext.getHttpRoute();
+        if (route == null) {
+            this.log.debug("Route info not set in the context");
+            return;
+        }
+
         HttpHost target = clientContext.getTargetHost();
+        if (target == null) {
+            this.log.debug("Target host not set in the context");
+            return;
+        }
+
         if (target.getPort() < 0) {
             target = new HttpHost(
                     target.getHostName(),



Mime
View raw message