From: Daniel Stenberg Date: Thu, 4 Dec 2025 18:57:44 +0000 (+0100) Subject: CURLMOPT_SOCKETFUNCTION.md: fix the callback argument use X-Git-Tag: rc-8_18_0-1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1531261b1ed6d0936646794cc169eb6f55bf3ff;p=thirdparty%2Fcurl.git 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 --- 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) {