apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: [PATCH] change apr_bind() API, add apr_get_sockaddr()
Date Sat, 18 Nov 2000 01:57:15 GMT
+1 across the board. It all sounds like Goodness to me.

Cheers,
-g

On Fri, Nov 17, 2000 at 02:24:08PM -0500, Jeff Trawick wrote:
> The following patch makes the following changes to APR and
> all callers in the apache-2.0 CVS repository:
> 
> 1) change apr_bind() to take apr_sockaddr_t as second parameter,
>    for specifying the local socket address to bind to
> 
> 2) add apr_get_sockaddr() function for retrieving the local or
>    remote apr_sockaddr_t associated with a function
> 
> 3) tweak apr_getaddrinfo() to handle certain AF_INET6 usage a little
>    better   
> 
> Concerns?
> 
> Would anybody like to see this patch before the next alpha?
> 
> Where is the API going from here? (mostly IMHO :) )
> 
> . more helper functions are needed for dealing with sockaddrs and
>   IP addresses (non-disruptive)
> 
> . apr_sendto() and apr_recvfrom() are needed to support normal
>   UDP idioms (non-disruptive)
> 
> . apr_get_port(), apr_set_port(), apr_get_ipaddr(),
>   apr_set_ipaddr() should take apr_sockaddr_t as a parameter,
>   not apr_socket_t+APR_LOCAL/APR_REMOTE;
>   (a little disruptive, but really a trivial change for apps)
> 
> . apr_create_tcp_socket() can go away
>   (a little disruptive, but really a trivial change for apps)
> 
> . change apr_get_hostname() to apr_getnameinfo(), make it
>   take apr_sockaddr_t instead of apr_socket_t+APR_LOCAL/APR_REMOTE,
>   let it cache result in apr_sockaddr_t
>   (a little disruptive, but really a trivial change for apps)
> 
> . get rid of apr_get_remote_name() and apr_get_local_name();
>   if an app wants to deal with the native sockaddr structure 
>   directly, they can call apr_get_sockaddr() and look in the
>   returned apr_sockaddr_t for the native structure
>   (a little disruptive, but really a trivial change for apps)
> 
> . get rid of apr_get_inaddr(); apr_getaddrinfo() does that
>   work + more
>   (a little disruptive, but really a trivial change for apps)
> 
> . get rid of apr_get_socket_inaddr(); 
>   if an app wants to deal with the native IP address structure 
>   directly, they can call apr_get_sockaddr() and look in the
>   returned apr_sockaddr_t for the native structure
>   (a little disruptive, but really a trivial change for apps)
> 
> . decide what to do about apr_make_os_sock(): should it play the
>   AF_INET/AF_INET6 game and make a socket really work?  currently,
>   such a socket is not fully functional even for AF_INET; this isn't 
>   terrible, because we save syscalls, and such sockets are usually 
>   built only for use with apr_poll()
> 
> Where are the internals going from here?
> 
> . apr_getaddrinfo() needs to be changed support IPv6 (when the
>   platform provides getipnodebyname() or getaddrinfo())
> 
> . test better with AF_INET6 and/or UDP to make sure those
>   work properly and support expected idioms
> 
> . it is high time to get more commonality in the codebase
>...

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message