]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLOPT_XFERINFOFUNCTION.md: fix the callback return type in example
authorDaniel Stenberg <daniel@haxx.se>
Tue, 29 Apr 2025 15:47:50 +0000 (17:47 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 29 Apr 2025 20:16:40 +0000 (22:16 +0200)
Fixes #17228
Reported-by: gkarracer on github
Closes #17229

docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md

index f5dfdd4c059ac28e34103aeb3be099a452265a87..67f48afcb2b7cd7fdd066effba0fdc04d1645e4a 100644 (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);
   }
 }
 ~~~