From: Toon Claes Date: Thu, 11 Apr 2024 11:45:25 +0000 (+0200) Subject: docs: add CURLOPT_NOPROGRESS to CURLOPT_XFERINFOFUNCTION example X-Git-Tag: curl-8_8_0~244 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f7be5a5192f638e29a893a46a6d4f9ea5e89b08;p=thirdparty%2Fcurl.git docs: add CURLOPT_NOPROGRESS to CURLOPT_XFERINFOFUNCTION example It's important to set `CURLOPT_NOPROGRESS` to `0` if you want your transfer callback function, set by `CURLOPT_XFERINFOFUNCTION`, getting called. To emphasize this to the users, add this to the code example. Closes #13348 --- diff --git a/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md b/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md index 7fcd0e06d8..fd1fd2cb21 100644 --- a/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md @@ -104,6 +104,9 @@ int main(void) /* pass struct to callback */ curl_easy_setopt(curl, CURLOPT_XFERINFODATA, &data); + /* enable progress callback getting called */ + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback); } }