cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP connection to unix socket

From: Bart Whiteley <bwhiteley_at_novell.com>
Date: Wed, 16 Apr 2008 13:15:24 -0600

Dan Fandrich wrote:
>
>> I guess it would be kind of nice if the path to the unix socket was encoded
>> in the URL for libcurl, as this would require no changes to the WBEM client
>> library. However, if we can't come up with a way to do this that feels good
>> to the libcurl community, I'm totally fine with extending the API of the
>> WBEM client library, or inventing some application-specific way of encoding
>> the path in the URL, and then doing some URL parsing in the WBEM client
>> library prior to invoking libcurl.
>>
>
> You could probably implement this today without modifying libcurl by using
> the CURLOPT_OPENSOCKETFUNCTION callback to open the socket within your
> library.
>

Nice. That is working for me. Thanks for the tip.

Just one note on this solution: In singleipconnect() (lib/connect.c)
after the call to the opensocket callback, just below the /* FIXME */
note, the code assumes AF_INET or AF_INET6, and the return value of
Curl_inet_ntop() isn't checked prior to passing addr_buf to infof().
Received on 2008-04-16