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.

Re: How to printout CURL_VERSION_UNIX_SOCKETS

From: jian he via curl-library <curl-library_at_lists.haxx.se>
Date: Sun, 2 Oct 2022 22:56:43 +0530

On Sun, Oct 2, 2022 at 8:21 PM Matthew Bobowski via curl-library <
curl-library_at_lists.haxx.se> wrote:

> Jian,
>
>
>
> I’m not sure what you’re trying to accomplish. CURL_VERSION_UNIX_SOCKETS
> is a bit flag for features – not a version.
>
>
>
> Try this:
>
> auto data = curl_version_info(CURLVERSION_NOW);
>
> printf("Curl version: %s\n", data->version);
>
>
>
> if (data->features & CURL_VERSION_UNIX_SOCKETS)
>
> printf("Curl supports UNIX sockets.\n");
>
> else
>
> printf("Curl does NOT support UNIX sockets.\n");
>
>
>
>
>
> -Matt
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows
>
>
>
> *From: *jian he via curl-library <curl-library_at_lists.haxx.se>
> *Sent: *Sunday, October 2, 2022 5:39 AM
> *To: *curl-library_at_lists.haxx.se
> *Cc: *jian he <jian.universality_at_gmail.com>
> *Subject: *How to printout CURL_VERSION_UNIX_SOCKETS
>
>
>
> Hello world.
>
>
> In curl.h
>
> #define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */
>
>
>
> In https://curl.se/libcurl/c/curl_version_info.html
>
> CURL_VERSION_UNIX_SOCKETS
>
> libcurl was built with support for Unix domain sockets. (Added in 7.40.0)
>
> So from here, we can print out CURL_VERSION_UNIX_SOCKETS to 7.40.0?
>
>
>
> Here is what I tried:
>
> printf("CURL_VERSION_UNIX_SOCKETS version: %u.%u.%u\n"
> ,(CURL_VERSION_UNIX_SOCKETS >> 19 ) & 0xff
> ,(CURL_VERSION_UNIX_SOCKETS >> 16) & 0xff
> ,(CURL_VERSION_UNIX_SOCKETS >> 8) & 0xff
> );
>
>
>
> it print out: CURL_VERSION_UNIX_SOCKETS version: 1.8.0
>
>
>
> So it failed.
>
> overall, I don't understand: #define CURL_VERSION_UNIX_SOCKETS (1<<19) /*
> Unix domain sockets support */
>
>
>
>
>
> --
>
> I recommend David Deutsch's <<The Beginning of Infinity>>
>
>
>
> Jian
>
>
>
>
>
>
> --
> Unsubscribe: https://lists.haxx.se/listinfo/curl-library
> Etiquette: https://curl.se/mail/etiquette.html
>

OK. now I got it. Thanks.


-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-10-02