cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Is --ftp-retry a good idea?

From: Bill Mercer <bmerc_at_nccer.org>
Date: Tue, 26 Oct 2004 09:13:16 -0400

>>>> daniel-curl_at_haxx.se 10/26/04 07:40AM >>>
>I'm considering adding a new --ftp-retry option that would do exactly
this: if
>the FTP server returns a trancient error when we attempt to login, we
sleep a
>while and retry again later. We double the sleep time for each attempt
and we
>do only a limited number of attempts.

The nice thing about adding an optional parameter is that those who
don't want
it don't have to use it. As long as default behavior is not changed,
this would
only be a positive change IMHO.

Does the retry have to be specific to FTP? There are enough potential
transient
HTTP errors that this would make sense as a general --retry option.

>If it is a good idea, would we also need a --ftp-retry-count (to set
maximum
>number of retries) and --ftp-retry-time (to set maximum time allowed
for
>retries)?

I don't think you would need this many options. The --retry option
itself could
accept an optional parameter for the number of retries, defaulting to
some
sensible value if none specified. If you know the base interval between
retries,
specifying the number of retries will give you a de facto time limit,
so I don't think
you need a separate parameter for that.

Also, if you double the interval each time, having a retry-time will
lead to ambiguity,
as it's not obvious exactly when curl will stop trying. (i.e., if the
delay in minutes
 follows the sequence 1, 2, 4, 8, 16, and the user specifies 10
minutes, what really
happens? Does it stop at 8? at 16? Or does it go to 8, then make one
extra try at
10 before quitting? Or does it stop at 8, then sit there doing nothing
for 2 minutes? (I know, that would be
silly...)

If someone wants to do more sophisticated stuff, they should probably
be writing
their own scripts anyway.

>What do you think?
It's an excellent idea.

>--
> Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se

> Dedicated custom curl help for hire: http://haxx.se/curl.html

Cheers,

Bill Mercer - National Center for Construction Education and Research
3600 NW 43rd St
Gainesville, Florida 32606
http://www.nccer.org
Phone 352-334-0911 Fax 352-334-0932
=============================================

                                       
Received on 2004-10-26