How does "curl --retry-max-time <seconds>" work?
curl
Solution
Let me try to clarify.
When curl decides to do a retry (because `--retry` is used and the conditions were such that a retry is warranted) and a `--retry-max-time` was set, curl checks if the total time elapsed since the start of the operation has surpassed the `--retry-max-time` or not. If it hasn't, it will allow another retry.
So in your command line above: if the total time is less than 32 seconds by the time it considers the retry, it will do another retry. If the total time is more than 32 seconds it will not do any more retries.
Problem
I don't know how `--retry-max-time` calculated. If I download a file `file.txt`: ``` curl --max-time 10 --retry 3 --retry-delay 5 --retry-max-time 32 'http://www.site.com/download/file.txt' ``` - `[ 0- 2]` It takes `2s` to download `50%` of the file, and no speed any more. - `[ 2-10]` It waits for another `8s`, still no speed, timeout, will retry - `[10-15]` It waits for `5s` before retry #1 - `[15-25]` Still no speed, will retry - `[25-30]` It waits for `5s` before retry #2 - `[30-34]` It takes `4s` to download `33%` of the file, and no speed any more. - `[34-40]` It waits for another `6s`, still no speed, timeout Will `curl` stop retry at this point(`40s`)? When was the `retry timer` started and stopped? ``` --retry-max-time <seconds> The retry timer is reset before the first transfer attempt. Retries will be done as usual (see --retry) as long as the timer hasn't reached this given limit. Notice that if the timer hasn't reached the limit, the request will be made and while performing, it may take longer than this given time period. To limit a single request´s maximum time, use -m, --max-time. Set this option to zero to not timeout retries. (Added in 7.12.3) ```