hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1054960 - in /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl: client/DefaultRequestDirector.java conn/tsccm/ConnPoolByRoute.java
Date Tue, 04 Jan 2011 10:26:15 GMT
Author: olegk
Date: Tue Jan  4 10:26:15 2011
New Revision: 1054960

URL: http://svn.apache.org/viewvc?rev=1054960&view=rev
Log:
Corrected debug logs: report zero keep-alive duration as indefinite; use better terminology
('indefinitely' instead of 'for ever')

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java?rev=1054960&r1=1054959&r2=1054960&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Tue Jan  4 10:26:15 2011
@@ -469,12 +469,12 @@ public class DefaultRequestDirector impl
                     long duration = keepAliveStrategy.getKeepAliveDuration(response, context);
                     if (this.log.isDebugEnabled()) {
                         String s;
-                        if (duration >= 0) {
-                            s = duration + " " + TimeUnit.MILLISECONDS;
+                        if (duration > 0) {
+                            s = "for " + duration + " " + TimeUnit.MILLISECONDS;
                         } else {
-                            s = "ever";
+                            s = "indefinitely";
                         }
-                        this.log.debug("Connection can be kept alive for " + s);
+                        this.log.debug("Connection can be kept alive " + s);
                     }
                     managedConn.setIdleDuration(duration, TimeUnit.MILLISECONDS);
                 }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java?rev=1054960&r1=1054959&r2=1054960&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
Tue Jan  4 10:26:15 2011
@@ -452,13 +452,13 @@ public class ConnPoolByRoute extends Abs
             if (reusable) {
                 if (log.isDebugEnabled()) {
                     String s;
-                    if (validDuration >= 0) {
-                        s = validDuration + " " + timeUnit;
+                    if (validDuration > 0) {
+                        s = "for " + validDuration + " " + timeUnit;
                     } else {
-                        s = "ever";
+                        s = "indefinitely";
                     }
                     log.debug("Pooling connection" +
-                            " [" + route + "][" + entry.getState() + "]; keep alive for "
+ s);
+                            " [" + route + "][" + entry.getState() + "]; keep alive " + s);
                 }
                 rospl.freeEntry(entry);
                 entry.updateExpiry(validDuration, timeUnit);



Mime
View raw message