From a1531261b1ed6d0936646794cc169eb6f55bf3ff Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Dec 2025 19:57:44 +0100 Subject: [PATCH] CURLMOPT_SOCKETFUNCTION.md: fix the callback argument use The example code does not use curl_multi_assign(), but its callback function used socketp (called sockp in the function) to get the struct priv pointer instead of the correct clientp (cbp). Reported-by: Greg Hudson Fixes #19840 Closes #19841 --- docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md b/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md index fae15d58a2..411b856e93 100644 --- a/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md +++ b/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md @@ -109,7 +109,7 @@ struct priv { static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { - struct priv *p = sockp; + struct priv *p = cbp; printf("our ptr: %p\n", p->ours); if(what == CURL_POLL_REMOVE) { -- 2.47.3