Skip to content

Fixed 'Maximum time allowed to spend' section - #655

Open
JonothorDarry wants to merge 1 commit into
curl:masterfrom
JonothorDarry:max_time_fix
Open

Fixed 'Maximum time allowed to spend' section#655
JonothorDarry wants to merge 1 commit into
curl:masterfrom
JonothorDarry:max_time_fix

Conversation

@JonothorDarry

@JonothorDarry JonothorDarry commented Aug 17, 2026

Copy link
Copy Markdown

The statements made in "Maximum time allowed to spend" section are imprecise and out of touch with the contents of the manual (and actual practice). Firstly,

Tell curl with -m / --max-time the maximum time, in seconds, that you allow the command line to spend before curl exits with a timeout error code (28). When the set time has elapsed, curl exits no matter what is going on at that moment—including if it is transferring data. It really is the maximum time allowed.

is incorrect - it only applies to a single transfer. Thus, running
curl -m 5 -O -O file_link_1 file_link_2
may fail with an error code (28) on the first file, and succeed (0 exit code) on the second. Furthermore, the timer is reset for each retry. To add to this,

(Your locale may use another symbol than a dot for expressing numerical fractions.)

seems misleading, for the decimal value needs to be provided using a dot (.) as decimal separator. The exact wording from the current manual goes like this:

-m, --max-time <seconds>
Set the maximum time in seconds that you allow each transfer to take. Prevents your batch jobs from hanging for hours due to slow networks or links going down. This option accepts decimal values.

If you enable retrying the transfer (--retry) then the maximum time counter is reset each time the transfer is retried. You can use --retry-max-time to limit the retry time.

The decimal value needs to be provided using a dot (.) as decimal separator - not the local version even if it might be using another separator.

I also encountered another problem - BUILD.md uses multilingual = false, which appears to be deprecated:
mainmatter/100-exercises-to-learn-rust#332
and it does not build .pdf (and I didn't see anything resembling .epub either). I didn't attempt to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant