cURL / Mailing Lists / curl-users / Single Mail

curl-users

--retry and DNS errors

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 20 Dec 2011 14:39:48 -0800

The --retry command attempts to redo a transfer if an attempt failed due to
what's considered a "temporary" problem. Current, a DNS failure is not on
that list, and I think that it should be. DNS problems are relatively
common and often temporary, especially so when MDNS is used.

If the user specifies --retry, then I think curl should error on the side
of retrying in the case of a failure rather than assuming a permanent
problem.

There are also a couple of more errors added recently that should really
cause a retry as well. I'm proposing this patch to fix them:

diff --git a/src/tool_operate.c b/src/tool_operate.c
index 1e88120..f880dec 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1233,7 +1233,10 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
               RETRY_LAST /* not used */
             } retry = RETRY_NO;
             long response;
- if(CURLE_OPERATION_TIMEDOUT == res)
+ if((CURLE_OPERATION_TIMEDOUT == res) ||
+ (CURLE_COULDNT_RESOLVE_HOST == res) ||
+ (CURLE_COULDNT_RESOLVE_PROXY == res) ||
+ (CURLE_FTP_ACCEPT_TIMEOUT == res))
               /* retry timeout always */
               retry = RETRY_TIMEOUT;
             else if((CURLE_OK == res) ||

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-12-20