HTTPCLIENT-1800: wrap redirect around retry in execChain
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1777769 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1da6fc21ed
commit
aaf638b1d5
|
@ -818,6 +818,13 @@ public class HttpClientBuilder {
|
||||||
routePlannerCopy = new DefaultRoutePlanner(schemePortResolverCopy);
|
routePlannerCopy = new DefaultRoutePlanner(schemePortResolverCopy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Optionally, add service unavailable retry executor
|
||||||
|
final ServiceUnavailableRetryStrategy serviceUnavailStrategyCopy = this.serviceUnavailStrategy;
|
||||||
|
if (serviceUnavailStrategyCopy != null) {
|
||||||
|
execChain = new ServiceUnavailableRetryExec(execChain, serviceUnavailStrategyCopy);
|
||||||
|
}
|
||||||
|
|
||||||
// Add redirect executor, if not disabled
|
// Add redirect executor, if not disabled
|
||||||
if (!redirectHandlingDisabled) {
|
if (!redirectHandlingDisabled) {
|
||||||
RedirectStrategy redirectStrategyCopy = this.redirectStrategy;
|
RedirectStrategy redirectStrategyCopy = this.redirectStrategy;
|
||||||
|
@ -827,11 +834,6 @@ public class HttpClientBuilder {
|
||||||
execChain = new RedirectExec(execChain, routePlannerCopy, redirectStrategyCopy);
|
execChain = new RedirectExec(execChain, routePlannerCopy, redirectStrategyCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optionally, add service unavailable retry executor
|
|
||||||
final ServiceUnavailableRetryStrategy serviceUnavailStrategyCopy = this.serviceUnavailStrategy;
|
|
||||||
if (serviceUnavailStrategyCopy != null) {
|
|
||||||
execChain = new ServiceUnavailableRetryExec(execChain, serviceUnavailStrategyCopy);
|
|
||||||
}
|
|
||||||
// Optionally, add connection back-off executor
|
// Optionally, add connection back-off executor
|
||||||
if (this.backoffManager != null && this.connectionBackoffStrategy != null) {
|
if (this.backoffManager != null && this.connectionBackoffStrategy != null) {
|
||||||
execChain = new BackoffStrategyExec(execChain, this.connectionBackoffStrategy, this.backoffManager);
|
execChain = new BackoffStrategyExec(execChain, this.connectionBackoffStrategy, this.backoffManager);
|
||||||
|
|
Loading…
Reference in New Issue