mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-17 15:35:20 +00:00
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 HttpResponse execute(HttpHost target, HttpRequest request,
|
|||||||
long duration = keepAliveStrategy.getKeepAliveDuration(response, context);
|
long duration = keepAliveStrategy.getKeepAliveDuration(response, context);
|
||||||
if (this.log.isDebugEnabled()) {
|
if (this.log.isDebugEnabled()) {
|
||||||
String s;
|
String s;
|
||||||
if (duration >= 0) {
|
if (duration > 0) {
|
||||||
s = duration + " " + TimeUnit.MILLISECONDS;
|
s = "for " + duration + " " + TimeUnit.MILLISECONDS;
|
||||||
} else {
|
} 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);
|
managedConn.setIdleDuration(duration, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
@ -452,13 +452,13 @@ public void freeEntry(BasicPoolEntry entry, boolean reusable, long validDuration
|
|||||||
if (reusable) {
|
if (reusable) {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
String s;
|
String s;
|
||||||
if (validDuration >= 0) {
|
if (validDuration > 0) {
|
||||||
s = validDuration + " " + timeUnit;
|
s = "for " + validDuration + " " + timeUnit;
|
||||||
} else {
|
} else {
|
||||||
s = "ever";
|
s = "indefinitely";
|
||||||
}
|
}
|
||||||
log.debug("Pooling connection" +
|
log.debug("Pooling connection" +
|
||||||
" [" + route + "][" + entry.getState() + "]; keep alive for " + s);
|
" [" + route + "][" + entry.getState() + "]; keep alive " + s);
|
||||||
}
|
}
|
||||||
rospl.freeEntry(entry);
|
rospl.freeEntry(entry);
|
||||||
entry.updateExpiry(validDuration, timeUnit);
|
entry.updateExpiry(validDuration, timeUnit);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user