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 2019/03/18 08:29:27 UTC

[httpcomponents-client] 01/01: Changed route tracking of proxy to not default to false

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch PR-143
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit 07bd2e26fce7b25900ec0f866ce69d172985d98c
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Mon Mar 18 09:28:31 2019 +0100

     Changed route tracking of proxy to not default to false
---
 .../java/org/apache/hc/client5/http/impl/async/AsyncConnectExec.java    | 2 +-
 .../main/java/org/apache/hc/client5/http/impl/classic/ConnectExec.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncConnectExec.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncConnectExec.java
index 5aad68d..9c9ae56 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncConnectExec.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncConnectExec.java
@@ -223,7 +223,7 @@ public final class AsyncConnectExec implements AsyncExecChainHandler {
                         @Override
                         public void completed(final AsyncExecRuntime execRuntime) {
                             final HttpHost proxy  = route.getProxyHost();
-                            tracker.connectProxy(proxy, false);
+                            tracker.connectProxy(proxy, route.isSecure() && !route.isTunnelled());
                             log.debug("Connected to proxy");
                             proceedToNextHop(state, request, entityProducer, scope, chain, asyncExecCallback);
                         }
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ConnectExec.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ConnectExec.java
index abafdad..6517c45 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ConnectExec.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ConnectExec.java
@@ -132,7 +132,7 @@ public final class ConnectExec implements ExecChainHandler {
                         case HttpRouteDirector.CONNECT_PROXY:
                             execRuntime.connectEndpoint(context);
                             final HttpHost proxy  = route.getProxyHost();
-                            tracker.connectProxy(proxy, false);
+                            tracker.connectProxy(proxy, route.isSecure() && !route.isTunnelled());
                             break;
                         case HttpRouteDirector.TUNNEL_TARGET: {
                             final boolean secure = createTunnelToTarget(route, request, execRuntime, context);