hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1777769 - /httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/HttpClientBuilder.java
Date Sat, 07 Jan 2017 11:39:16 GMT
Author: olegk
Date: Sat Jan  7 11:39:15 2017
New Revision: 1777769

URL: http://svn.apache.org/viewvc?rev=1777769&view=rev
Log:
HTTPCLIENT-1800: wrap redirect around retry in execChain

Modified:
    httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/HttpClientBuilder.java

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/HttpClientBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/HttpClientBuilder.java?rev=1777769&r1=1777768&r2=1777769&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/HttpClientBuilder.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/HttpClientBuilder.java
Sat Jan  7 11:39:15 2017
@@ -818,6 +818,13 @@ public class HttpClientBuilder {
                 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
         if (!redirectHandlingDisabled) {
             RedirectStrategy redirectStrategyCopy = this.redirectStrategy;
@@ -827,11 +834,6 @@ public class HttpClientBuilder {
             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
         if (this.backoffManager != null && this.connectionBackoffStrategy != null)
{
             execChain = new BackoffStrategyExec(execChain, this.connectionBackoffStrategy,
this.backoffManager);



Mime
View raw message