]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLOPT_XFERINFOFUNCTION: clarify the callback return codes
authorDaniel Stenberg <daniel@haxx.se>
Wed, 21 Aug 2024 21:35:31 +0000 (23:35 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 22 Aug 2024 07:20:53 +0000 (09:20 +0200)
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

docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.md
docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md

index d9a24382be5a116c9ccc684847222599f9ecc35d..eb0981e04fd1943ab65a5e2f0fc0ab3623ae9016 100644 (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
index a7c130a5066b97a68e68929d539f72854686a4bd..e2f95371a11f0dafb376c48df860f9d2e8243d09 100644 (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.