hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1442565 - /httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java
Date Tue, 05 Feb 2013 12:39:04 GMT
Author: olegk
Date: Tue Feb  5 12:39:04 2013
New Revision: 1442565

URL: http://svn.apache.org/viewvc?rev=1442565&view=rev
Log:
Log 'Connection can be kept alive' debug message only if the connection is known be re-usable

Modified:
    httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java

Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java?rev=1442565&r1=1442564&r2=1442565&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java
(original)
+++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java
Tue Feb  5 12:39:04 2013
@@ -216,15 +216,17 @@ public class BasicClientConnectionManage
                     if (managedConn.isOpen() && !managedConn.isMarkedReusable())
{
                         shutdownConnection(managedConn);
                     }
-                    this.poolEntry.updateExpiry(keepalive, tunit != null ? tunit : TimeUnit.MILLISECONDS);
-                    if (this.log.isDebugEnabled()) {
-                        String s;
-                        if (keepalive > 0) {
-                            s = "for " + keepalive + " " + tunit;
-                        } else {
-                            s = "indefinitely";
+                    if (managedConn.isMarkedReusable()) {
+                        this.poolEntry.updateExpiry(keepalive, tunit != null ? tunit : TimeUnit.MILLISECONDS);
+                        if (this.log.isDebugEnabled()) {
+                            String s;
+                            if (keepalive > 0) {
+                                s = "for " + keepalive + " " + tunit;
+                            } else {
+                                s = "indefinitely";
+                            }
+                            this.log.debug("Connection can be kept alive " + s);
                         }
-                        this.log.debug("Connection can be kept alive " + s);
                     }
                 } finally {
                     managedConn.detach();



Mime
View raw message