Log 'Connection can be kept alive' debug message only if the connection is known be re-usable

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1442567 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2013-02-05 12:39:32 +00:00
parent 3627984c9d
commit 4a021ce33a
1 changed files with 10 additions and 8 deletions

View File

@ -209,6 +209,7 @@ public class BasicClientConnectionManager implements ClientConnectionManager {
if (managedConn.isOpen() && !managedConn.isMarkedReusable()) {
shutdownConnection(managedConn);
}
if (managedConn.isMarkedReusable()) {
this.poolEntry.updateExpiry(keepalive, tunit != null ? tunit : TimeUnit.MILLISECONDS);
if (this.log.isDebugEnabled()) {
String s;
@ -219,6 +220,7 @@ public class BasicClientConnectionManager implements ClientConnectionManager {
}
this.log.debug("Connection can be kept alive " + s);
}
}
} finally {
managedConn.detach();
this.conn = null;