]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operate: use stricter curl_multi_setopt() arguments
authorDaniel Stenberg <daniel@haxx.se>
Fri, 22 Aug 2025 14:15:11 +0000 (16:15 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 22 Aug 2025 15:13:07 +0000 (17:13 +0200)
To please the curl_multi_setopt() typechecker

- set multi callback protypes to match exactylu
- set CURLMOPT_MAX_HOST_CONNECTIONS as a long

Closes #18357

src/tool_operate.c

index 90e1fbf860daa0ace53d683ee7cf5fdbf3d753e3..22bb3ca736896f33659f873f9ff75bbdf4a0292b 100644 (file)
@@ -1514,9 +1514,9 @@ static void on_uv_timeout(uv_timer_t *req)
 }
 
 /* callback from libcurl to update the timeout expiry */
-static int cb_timeout(CURLM *multi, long timeout_ms,
-                      struct datauv *uv)
+static int cb_timeout(CURLM *multi, long timeout_ms, void *userp)
 {
+  struct datauv *uv = userp;
   (void)multi;
 #if DEBUG_UV
   fprintf(tool_stderr, "parallel_event: cb_timeout=%ld\n", timeout_ms);
@@ -1562,11 +1562,11 @@ static void destroy_context(struct contextuv *c)
 
 /* callback from libcurl to update socket activity to wait for */
 static int cb_socket(CURL *easy, curl_socket_t s, int action,
-                     struct datauv *uv,
-                     void *socketp)
+                     void *userp, void *socketp)
 {
   struct contextuv *c;
   int events = 0;
+  struct datauv *uv = userp;
   (void)easy;
 
 #if DEBUG_UV
@@ -1622,7 +1622,7 @@ static CURLcode parallel_event(struct parastate *s)
   curl_multi_setopt(s->multi, CURLMOPT_SOCKETDATA, &uv);
   curl_multi_setopt(s->multi, CURLMOPT_TIMERFUNCTION, cb_timeout);
   curl_multi_setopt(s->multi, CURLMOPT_TIMERDATA, &uv);
-  curl_multi_setopt(s->multi, CURLMOPT_MAX_HOST_CONNECTIONS,
+  curl_multi_setopt(s->multi, CURLMOPT_MAX_HOST_CONNECTIONS, (long)
                     global->parallel_host);
 
   /* kickstart the thing */