CURLOPT_XFERINFOFUNCTION: clarify the callback return codes

also done in CURLOPT_PROGRESSFUNCTION.md

This changes the wording to say that 1 should be returned instad of
non-zero to return error from the callback. I did this to simplify, even
if other non-zero values still do the same thing I figure we might just
as well just leave out the others from the documentation.

Fixes #14627
Reported-by: Benjamin Riefenstahl Mecom
Closes #14637
This commit is contained in:
Daniel Stenberg 2024-08-21 23:35:31 +02:00
parent 9724526429
commit b000cdfb2c
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 9 additions and 5 deletions

View File

@ -60,11 +60,13 @@ if you only download data, the upload size remains 0). Many times the callback
is called one or more times first, before it knows the data sizes so a program
must be made to handle that.
Return zero from the callback if everything is fine.
If your callback function returns CURL_PROGRESSFUNC_CONTINUE it causes libcurl
to continue executing the default progress function.
Returning any other non-zero value from this callback makes libcurl abort the
transfer and return *CURLE_ABORTED_BY_CALLBACK*.
Return 1 from this callback to make libcurl abort the transfer and return
*CURLE_ABORTED_BY_CALLBACK*.
If you transfer data with the multi interface, this function is not called
during periods of idleness unless you call the appropriate libcurl function

View File

@ -56,12 +56,14 @@ you only download data, the upload size remains 0). Many times the callback is
called one or more times first, before it knows the data sizes so a program
must be made to handle that.
Return zero from the callback if everything is fine.
Return 1 from this callback to make libcurl abort the transfer and return
*CURLE_ABORTED_BY_CALLBACK*.
If your callback function returns CURL_PROGRESSFUNC_CONTINUE it makes libcurl
to continue executing the default progress function.
Returning any other non-zero value from this callback makes libcurl abort the
transfer and return *CURLE_ABORTED_BY_CALLBACK*.
If you transfer data with the multi interface, this function is not called
during periods of idleness unless you call the appropriate libcurl function
that performs transfers.