HTTPCLIENT-1237: PoolingClientConnectionManager should only update pool expiry for resuable connections
Contributed by Alf Høgemark <alf at i100.no> git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1390317 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8e452a0159
commit
c9829f5ac0
|
@ -261,15 +261,18 @@ public class PoolingClientConnectionManager implements ClientConnectionManager,
|
|||
}
|
||||
}
|
||||
}
|
||||
entry.updateExpiry(keepalive, tunit != null ? tunit : TimeUnit.MILLISECONDS);
|
||||
if (this.log.isDebugEnabled()) {
|
||||
String s;
|
||||
if (keepalive > 0) {
|
||||
s = "for " + keepalive + " " + tunit;
|
||||
} else {
|
||||
s = "indefinitely";
|
||||
// Only reusable connections can be kept alive
|
||||
if (managedConn.isMarkedReusable()) {
|
||||
entry.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 " + format(entry) + " can be kept alive " + s);
|
||||
}
|
||||
this.log.debug("Connection " + format(entry) + " can be kept alive " + s);
|
||||
}
|
||||
} finally {
|
||||
this.pool.release(entry, managedConn.isMarkedReusable());
|
||||
|
|
Loading…
Reference in New Issue