curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

OPENSOCKETFUNCTION documentation weirdness

From: Jeff Mears via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 3 Dec 2019 03:16:00 +0000

The documentation for CURLOPT_OPENSOCKETFUNCTION is a little weird.

https://curl.haxx.se/libcurl/c/CURLOPT_OPENSOCKETFUNCTION.html

CURLSOCKTYPE_ACCEPT doesn't make any sense for OPENSOCKETFUNCTION, because there's no listener socket passed in. Indeed, the only code using this constant is ftp.c, which only uses the constant for the SOCKOPTFUNCTION:

  if(data->set.fsockopt) {
    int error = 0;

    /* activate callback for setting socket options */
    Curl_set_in_callback(data, true);
    error = data->set.fsockopt(data->set.sockopt_client,
                               s,
                               CURLSOCKTYPE_ACCEPT);
    Curl_set_in_callback(data, false);

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-12-03