From 3f637807f63ed531ac623da7df4cdf946431f499 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Mon, 15 Sep 2014 08:31:28 +0000 Subject: [PATCH] HTTPCLIENT-1525: fixed inconsistent debug log Contributed by Joseph Walton git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1624969 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/impl/conn/PoolingHttpClientConnectionManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java b/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java index 0eef6299d..4b061954c 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java @@ -301,12 +301,13 @@ public class PoolingHttpClientConnectionManager final ManagedHttpClientConnection conn = entry.getConnection(); try { if (conn.isOpen()) { + final TimeUnit effectiveUnit = tunit != null ? tunit : TimeUnit.MILLISECONDS; entry.setState(state); - entry.updateExpiry(keepalive, tunit != null ? tunit : TimeUnit.MILLISECONDS); + entry.updateExpiry(keepalive, effectiveUnit); if (this.log.isDebugEnabled()) { final String s; if (keepalive > 0) { - s = "for " + (double) keepalive / 1000 + " seconds"; + s = "for " + (double) effectiveUnit.toMillis(keepalive) / 1000 + " seconds"; } else { s = "indefinitely"; }