CURLOPT_XFERINFOFUNCTION.md: fix the callback return type in example

Fixes #17228
Reported-by: gkarracer on github
Closes #17229
This commit is contained in:
Daniel Stenberg 2025-04-29 17:47:50 +02:00
parent 3fcddc835c
commit d33b449271
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -85,11 +85,11 @@ struct progress {
size_t size;
};
static size_t progress_callback(void *clientp,
curl_off_t dltotal,
curl_off_t dlnow,
curl_off_t ultotal,
curl_off_t ulnow)
static int xferinfo_callback(void *clientp,
curl_off_t dltotal,
curl_off_t dlnow,
curl_off_t ultotal,
curl_off_t ulnow)
{
struct progress *memory = clientp;
printf("my ptr: %p\n", memory->private);
@ -111,7 +111,7 @@ int main(void)
/* enable progress callback getting called */
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback);
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, xferinfo_callback);
}
}
~~~