cURL / Mailing Lists / curl-library / Single Mail


Re: Fwd: [PATCH] check ip callback

From: Dan Fandrich <>
Date: Thu, 27 Sep 2007 14:22:56 -0700

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
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);

>>> Dan

--              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-09-27