diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2020-04-04 16:16:18 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2020-05-12 03:00:15 -0400 |
commit | b995bb58cbd976280b132ee2148376fadd071063 (patch) | |
tree | 6e2c8903f3ae9e5bc515828df90f045dab186750 /src/tool_operate.c | |
parent | 98e5904165859679cd78825bcccb52306ee3bb66 (diff) |
tool: Add option --retry-all-errors to retry on any error
The "sledgehammer" of retrying.
Closes https://github.com/curl/curl/pull/5185
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r-- | src/tool_operate.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c index 66c6468bc..6d489aa30 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -437,6 +437,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global, config->retry_maxtime*1000L)) ) { enum { RETRY_NO, + RETRY_ALL_ERRORS, RETRY_TIMEOUT, RETRY_CONNREFUSED, RETRY_HTTP, @@ -506,11 +507,15 @@ static CURLcode post_per_transfer(struct GlobalConfig *global, retry = RETRY_FTP; } + if(result && !retry && config->retry_all_errors) + retry = RETRY_ALL_ERRORS; + if(retry) { long sleeptime = 0; curl_off_t retry_after = 0; static const char * const m[]={ NULL, + "(retrying all errors)", "timeout", "connection refused", "HTTP error", |