HTTPCLIENT-944: maintain separate count of connect attempts

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@954282 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2010-06-13 18:37:25 +00:00
parent 0bb63c609a
commit 0f8ca31e92

View File

@ -555,9 +555,12 @@ private void tryConnect(
HttpRoute route = req.getRoute();
boolean retrying = true;
int connectCount = 0;
while (retrying) {
// Increment total exec count
execCount++;
// Increment connect count
connectCount++;
try {
if (!managedConn.isOpen()) {
managedConn.open(route, context, params);
@ -571,7 +574,7 @@ private void tryConnect(
managedConn.close();
} catch (IOException ignore) {
}
if (retryHandler.retryRequest(ex, execCount, context)) {
if (retryHandler.retryRequest(ex, connectCount, context)) {
if (this.log.isInfoEnabled()) {
this.log.info("I/O exception ("+ ex.getClass().getName() +
") caught when connecting to the target host: "
@ -629,7 +632,7 @@ private HttpResponse tryExecute(
managedConn.close();
} catch (IOException ignore) {
}
if (retryHandler.retryRequest(ex, execCount, context)) {
if (retryHandler.retryRequest(ex, wrapper.getExecCount(), context)) {
if (this.log.isInfoEnabled()) {
this.log.info("I/O exception ("+ ex.getClass().getName() +
") caught when processing request: "