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
This commit is contained in:
Toon Claes 2024-04-11 13:45:25 +02:00 committed by Daniel Stenberg
parent 1087937992
commit 0f7be5a519
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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);
}
}