aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-08-02 00:10:18 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-08-02 00:10:18 +0200
commitf38e52071e19dc16cf59c1719f37ec555b4c75b5 (patch)
treef0bae487d0cfb26a2a079b78e1b160dfe0b50cd0 /src
parent811fcccfc97ee6545f1b9d28ac0dd9ea93a81ab8 (diff)
retry: consider retrying even if -f is used
The --retry logic does retry HTTP when some specific response codes are returned, but because the -f option sets the CURLOPT_FAILONERROR to libcurl, the return codes are different for such situations and then the curl tool failed to consider it for retrying. Reported by: Mike Power Bug: http://curl.haxx.se/bug/view.cgi?id=3037362
Diffstat (limited to 'src')
-rw-r--r--src/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index f35fc62d5..5585c1755 100644
--- a/src/main.c
+++ b/src/main.c
@@ -5439,8 +5439,12 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
if(CURLE_OPERATION_TIMEDOUT == res)
/* retry timeout always */
retry = RETRY_TIMEOUT;
- else if(CURLE_OK == res) {
- /* Check for HTTP transient errors */
+ else if((CURLE_OK == res) ||
+ (config->failonerror &&
+ (CURLE_HTTP_RETURNED_ERROR == res))) {
+ /* If it returned OK. _or_ failonerror was enabled and it
+ returned due to such an error, check for HTTP transient
+ errors to retry on. */
char *this_url=NULL;
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &this_url);
if(this_url &&