File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -90,12 +90,18 @@ bool httpClientConnectLimitReached()
90
90
91
91
// Retry the connection a few times
92
92
limitReached = (httpClientConnectionAttempts >= MAX_HTTP_CLIENT_CONNECTION_ATTEMPTS);
93
- limitReached = false ;
94
93
95
94
// Restart the HTTP client
96
- httpClientStop ((!httpClientEnabled (nullptr )) || limitReached);
97
-
98
- httpClientConnectionAttempts++;
95
+ httpClientStop (limitReached || (!httpClientEnabled (nullptr )));
96
+
97
+ // Limit to max connection delay
98
+ if (httpClientConnectionAttempts)
99
+ httpClientConnectionAttemptTimeout = (5 * MILLISECONDS_IN_A_SECOND)
100
+ << (httpClientConnectionAttempts - 1 );
101
+ if (httpClientConnectionAttemptTimeout > RTK_MAX_CONNECTION_MSEC)
102
+ httpClientConnectionAttemptTimeout = httpClientConnectionAttemptTimeout;
103
+ else
104
+ httpClientConnectionAttempts++;
99
105
httpClientConnectionAttemptsTotal++;
100
106
if (settings.debugHttpClientState )
101
107
httpClientPrintStatus ();
You can’t perform that action at this time.
0 commit comments