cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl and sock_cloexec

From: Paul Albrecht <albrecht_at_glccom.com>
Date: Mon, 25 Apr 2011 15:23:21 -0500

On Mon, 2011-04-25 at 15:04 -0500, Dan Fandrich wrote:
> On Mon, Apr 25, 2011 at 09:25:08AM -0500, Paul Albrecht wrote:
> > I'm using libcurl-easy and I was wondering if there's any way to set
> > sock_cloexec on the socket call in the library?
>
> There are a number of callbacks that can be used to set socket options,
> such as CURLOPT_SOCKOPTFUNCTION, CURLOPT_OPENSOCKETFUNCTION,
> CURLOPT_SSL_CTX_FUNCTION and the CURLINFO_LASTSOCKET curl_easy_getinfo
> option.
>

I need the option set when the socket is created so
CURLOPT_SOCKOPTFUNCTION (setsockopt) is too late. I'll try the
CURL_OPENSOCKETFUNCTION (socket) which should work, but why is the
callback necessary? Shouldn't this be the default? Why would I want the
connect socket propagated to a forked process?

> >>> Dan
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-- 
Paul Albrecht
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-04-25