Corrected debug logs: report zero keep-alive duration as indefinite; use better terminology ('indefinitely' instead of 'for ever')
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1054960 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dafdf43025
commit
232ee999c8
|
@ -469,12 +469,12 @@ public class DefaultRequestDirector implements RequestDirector {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -452,13 +452,13 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue