Skip to content

Commit

Permalink
HTTPCLIENT-2315: client builders fails to apply system properties to …
Browse files Browse the repository at this point in the history
…the default connection manager
  • Loading branch information
ok2c committed Jan 8, 2024
1 parent 1650831 commit 679991a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Expand Up @@ -779,7 +779,11 @@ protected void addCloseable(final Closeable closeable) {
public CloseableHttpAsyncClient build() {
AsyncClientConnectionManager connManagerCopy = this.connManager;
if (connManagerCopy == null) {
connManagerCopy = PoolingAsyncClientConnectionManagerBuilder.create().build();
final PoolingAsyncClientConnectionManagerBuilder connectionManagerBuilder = PoolingAsyncClientConnectionManagerBuilder.create();
if (systemProperties) {
connectionManagerBuilder.useSystemProperties();
}
connManagerCopy = connectionManagerBuilder.build();
}

ConnectionKeepAliveStrategy keepAliveStrategyCopy = this.keepAliveStrategy;
Expand Down
Expand Up @@ -749,7 +749,11 @@ public CloseableHttpClient build() {
}
HttpClientConnectionManager connManagerCopy = this.connManager;
if (connManagerCopy == null) {
connManagerCopy = PoolingHttpClientConnectionManagerBuilder.create().build();
final PoolingHttpClientConnectionManagerBuilder connectionManagerBuilder = PoolingHttpClientConnectionManagerBuilder.create();
if (systemProperties) {
connectionManagerBuilder.useSystemProperties();
}
connManagerCopy = connectionManagerBuilder.build();
}
ConnectionReuseStrategy reuseStrategyCopy = this.reuseStrategy;
if (reuseStrategyCopy == null) {
Expand Down

0 comments on commit 679991a

Please sign in to comment.