cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Fwd: [PATCH] check ip callback

From: Alexey Pesternikov <paster_at_page2rss.com>
Date: Thu, 27 Sep 2007 17:00:57 -0700

On 9/27/07, Dan Fandrich <dan_at_coneharvesters.com> wrote:
>
> On Thu, Sep 27, 2007 at 01:56:22PM -0700, Alexey Pesternikov wrote:
> > If we are going to add one more callback I would prefer to NOT mix it
> with the
> > SOCKOPT but make the separated one:
> >
> > struct curl_sockaddr {
> > int family,
> > int socktype,
> > int protocol,
> > socklen_t addrlen,
> > struct sockaddr addr
> > }; /* or something like that */
> >
> > typedef int (*curl_iptranslate_callback)(void *clientp,
> > curlsocktype purpose,
> > struct curl_sockaddr_info*
> address);
> > That would have much cleaner semantics.
>
> The semantics would be even clearer if the new callback were responsible
> for returning an open and configured socket instead of just an address.
> That eliminates the open/changeaddress/close/open loop with
> changeaddress/open

actually the separated address translation callback does not require the
loop.

and provides even more flexibility for users who need libcurl to operate on
> an already-open socket.
>
> typedef int (*curl_sockopen_callback)(void *clientp,
> curlsocktype purpose,
> const Curl_addrinfo* address,
> curL_socket_t *fd);
>
> Personally, I'm fine with that too.

-- 
Alexey,
http://page2rss.com     RSS feed from almost any page
Received on 2007-09-28