From 0aff0348ad4a41708552f23201f61900286632d2 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Wed, 22 Mar 2017 09:03:54 +0000 Subject: [PATCH] HTTPCLIENT-1835: evictExpiredConnections no longer causes the evictIdleConnections behaviour to be enabled when evictIdleConnections is not explicitly enabled git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1788069 13f79535-47bb-0310-9956-ffa450edef68 --- .../hc/client5/http/impl/async/HttpAsyncClientBuilder.java | 3 ++- .../apache/hc/client5/http/impl/sync/HttpClientBuilder.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java index 51213d8b3..e4c581547 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java @@ -507,7 +507,8 @@ public class HttpAsyncClientBuilder { if (evictExpiredConnections || evictIdleConnections) { if (connManagerCopy instanceof ConnPoolControl) { final IdleConnectionEvictor connectionEvictor = new IdleConnectionEvictor((ConnPoolControl) connManagerCopy, - maxIdleTime > 0 ? maxIdleTime : 10, maxIdleTimeUnit != null ? maxIdleTimeUnit : TimeUnit.SECONDS); + maxIdleTime > 0 ? maxIdleTime : 10, maxIdleTimeUnit != null ? maxIdleTimeUnit : TimeUnit.SECONDS, + maxIdleTime, maxIdleTimeUnit); closeablesCopy.add(new Closeable() { @Override diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/HttpClientBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/HttpClientBuilder.java index 62e4a297d..c06a964cb 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/HttpClientBuilder.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/HttpClientBuilder.java @@ -867,7 +867,8 @@ public class HttpClientBuilder { if (evictExpiredConnections || evictIdleConnections) { if (connManagerCopy instanceof ConnPoolControl) { final IdleConnectionEvictor connectionEvictor = new IdleConnectionEvictor((ConnPoolControl) connManagerCopy, - maxIdleTime > 0 ? maxIdleTime : 10, maxIdleTimeUnit != null ? maxIdleTimeUnit : TimeUnit.SECONDS); + maxIdleTime > 0 ? maxIdleTime : 10, maxIdleTimeUnit != null ? maxIdleTimeUnit : TimeUnit.SECONDS, + maxIdleTime, maxIdleTimeUnit); closeablesCopy.add(new Closeable() { @Override