cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: socket callback for setsockopt()

From: David McCreedy <mccreedytpf_at_msn.com>
Date: Mon, 21 Aug 2006 23:44:46 +0000

On Sat, 19 AUG 2006, Daniel Stenberg wrote
>
>On Mon, 14 Aug 2006, David McCreedy wrote:
>
>>Here's a new patch.
>
>Looks good. Just one little nit and two questions:
>
>1 - we want the callback to get a user-provided pointer as well, in the
>same
> style all the other ones do. Probably then called CURLOPT_SOCKOPTDATA.

I have added CURLOOPT_SOCKOPTDATA with this new, attached patch.

>2 - we do create sockets at several other places as well, shouldn't we
>offer
> the callback for them too?
>
>3 - if we do (2) and call the callback at other places, do we want to tell
>the
> callback something about what the socket is meant for or similar to
>let it
> be able to decide what options to set on it?
>

The socket() calls in hostip6.c and hostthre.c just create then close the
sockets, so I don't think it's useful there.
And I'm not sure about the socket() calls in ftp.c and if2ip.c.
So I've added the callback to connect.c and have created an enum (for your
question #3) so additional callbacks can be added in the future if someone
finds them useful.

Thanks,

-David

Received on 2006-08-22