From 37711293767383ade39d384fd3576665a3a5f033 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Wed, 29 Jun 2022 09:43:07 +0200 Subject: [PATCH] HTTPCLIENT-2225: connection route calculation does not take the default RequestConfig into account --- .../http/impl/async/InternalAbstractHttpAsyncClient.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalAbstractHttpAsyncClient.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalAbstractHttpAsyncClient.java index 1e488267d..4e9a7379b 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalAbstractHttpAsyncClient.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalAbstractHttpAsyncClient.java @@ -184,6 +184,9 @@ abstract class InternalAbstractHttpAsyncClient extends AbstractHttpAsyncClientBa if (requestConfig != null) { clientContext.setRequestConfig(requestConfig); } + + setupContext(clientContext); + final HttpRoute route = determineRoute( httpHost != null ? httpHost : RoutingSupport.determineHost(request), clientContext); @@ -194,8 +197,6 @@ abstract class InternalAbstractHttpAsyncClient extends AbstractHttpAsyncClientBa } final AsyncExecRuntime execRuntime = createAsyncExecRuntime(pushHandlerFactory); - setupContext(clientContext); - final AsyncExecChain.Scheduler scheduler = this::executeScheduled; final AsyncExecChain.Scope scope = new AsyncExecChain.Scope(exchangeId, route, request, future,