You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2014/07/23 13:54:17 UTC

svn commit: r1612816 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java

Author: olegk
Date: Wed Jul 23 11:54:17 2014
New Revision: 1612816

URL: http://svn.apache.org/r1612816
Log:
HTTPCLIENT-1531: CONNECT via proxy fails if authentication is disabled

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java?rev=1612816&r1=1612815&r2=1612816&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java Wed Jul 23 11:54:17 2014
@@ -450,14 +450,14 @@ public class MainClientExec implements C
 
         final HttpHost target = route.getTargetHost();
         final HttpHost proxy = route.getProxyHost();
-        HttpResponse response;
+        HttpResponse response = null;
 
         final String authority = target.toHostString();
         final HttpRequest connect = new BasicHttpRequest("CONNECT", authority, request.getProtocolVersion());
 
         this.requestExecutor.preProcess(connect, this.proxyHttpProcessor, context);
 
-        for (;;) {
+        while (response == null) {
             if (!managedConn.isOpen()) {
                 this.connManager.connect(
                         managedConn,
@@ -491,11 +491,8 @@ public class MainClientExec implements C
                         } else {
                             managedConn.close();
                         }
-                    } else {
-                        break;
+                        response = null;
                     }
-                } else {
-                    break;
                 }
             }
         }