HTTPCLIENT-1531: CONNECT via proxy fails if authentication is disabled

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1612816 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2014-07-23 11:54:17 +00:00
parent 9e4c8332f8
commit 4216fc1f10
1 changed files with 3 additions and 6 deletions

View File

@ -450,14 +450,14 @@ public class MainClientExec implements ClientExecChain {
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 ClientExecChain {
} else {
managedConn.close();
}
} else {
break;
response = null;
}
} else {
break;
}
}
}