You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Greg Stein <gs...@lyra.org> on 2000/11/21 21:03:11 UTC

Re: cvs commit: apr CHANGES

On Tue, Nov 21, 2000 at 07:08:32PM -0000, trawick@locus.apache.org wrote:
> trawick     00/11/21 11:08:30
> 
>   Modified:    include  apr_network_io.h
>                network_io/beos sockaddr.c
>                network_io/unix sa_common.c sockaddr.c
>                network_io/win32 sockaddr.c
>                .        CHANGES
>   Log:
>   Some of the forewarned APR network_io interface changes:
>   
>   apr_set_port(), apr_get_port(), apr_set_ipaddr(), and apr_get_ipaddr()
>   now take apr_sockaddr_t as a parameter instead of apr_socket_t +
>   apr_interface_e.  This will allow the same routines to be used with
>   datagram APIs to be added later.  Note that code which calls
>   apr_set_ipaddr() should probably be changed to call apr_getaddrinfo()
>   for protocol independence.
>...
>   --- apr_network_io.h	2000/11/21 00:30:43	1.77
>   +++ apr_network_io.h	2000/11/21 19:08:22	1.78
>...
>    /**
>   - * Return the port associated with a socket.
>   - * @param port The local port this socket is associated with.
>   - * @param which Which interface are we getting the port for?
>   - * @param sock The socket to enquire about.
>   + * Return the port in an APR socket address.
>   + * @param port The port from the socket address.
>   + * @param sock The socket address to reference.
>     */
>   -apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock);
>   +apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr);

The comment-doc should be "sockaddr"

>...
>    /**
>   - * Return the IP address associated with an apr socket.
>   - * @param addr The local IP address associated with the socket.
>   - * @param sock The socket to use 
>   + * Return the IP address (in numeric address string format) in
>   + * an APR socket address.
>   + * @param addr The IP address.
>   + * @param sock The socket address to reference.
>     */
>   -apr_status_t apr_get_ipaddr(char **addr, apr_interface_e which, apr_socket_t *sock);
>   +apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr);

Same.

>...
>   --- sa_common.c	2000/11/19 01:21:11	1.10
>   +++ sa_common.c	2000/11/21 19:08:25	1.11
>   @@ -65,65 +65,54 @@
>    
>    #include "apr.h"
>    
>   -apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, 
>   -                         apr_port_t port)
>   +apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port)
>    {
>        /* XXX IPv6: assumes sin_port and sin6_port at same offset */
>   -    if (which == APR_LOCAL)
>   -        sock->local_addr->sa.sin.sin_port = htons(port);
>   -    else if (which == APR_REMOTE)
>   -        sock->remote_addr->sa.sin.sin_port = htons(port);
>   -    else
>   -        return APR_EINVAL;
>   +    sockaddr->sa.sin.sin_port = htons(port);
>   +    sockaddr->sa.sin.sin_port = htons(port);

Twice. Just to make sure.

:-)


Cheers,
-g

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