hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1624969 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java
Date Mon, 15 Sep 2014 08:31:28 GMT
Author: olegk
Date: Mon Sep 15 08:31:28 2014
New Revision: 1624969

URL: http://svn.apache.org/r1624969
Log:
HTTPCLIENT-1525: fixed inconsistent debug log
Contributed by Joseph Walton <joe at kafsemo.org>

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java?rev=1624969&r1=1624968&r2=1624969&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java
Mon Sep 15 08:31:28 2014
@@ -301,12 +301,13 @@ public class PoolingHttpClientConnection
             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";
                         }



Mime
View raw message