mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-16 23:16:33 +00:00
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:
parent
0bb63c609a
commit
0f8ca31e92
@ -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: "
|
||||
|
Loading…
x
Reference in New Issue
Block a user