[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: IPv6 oddness in ra_svn

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2005-03-22 20:52:20 CET

On Tue, 2005-03-22 at 10:39 +0000, Max Bowsher wrote:
> Why does the ipv6_supported variable exist at all in the below code?

Oh, it was originally static, so it was only tested once.

:)

> Couldn't it be removed entirely with *NO* change to the functioning of the
> code at all, like so:

>
> ==============================================================================
> {
> apr_sockaddr_t *sa;
> apr_status_t status;
> int family = APR_INET;
>
> /* Make sure we have IPV6 support first before giving
> apr_sockaddr_info_get
> APR_UNSPEC, because it may give us back an IPV6 address even if we
> can't
> create IPV6 sockets. */
>
> #if APR_HAVE_IPV6
> #ifdef MAX_SECS_TO_LINGER
> status = apr_socket_create(sock, APR_INET6, SOCK_STREAM, pool);
> #else
> status = apr_socket_create(sock, APR_INET6, SOCK_STREAM,
> APR_PROTO_TCP, pool);
> #endif
> if (status == 0)
> {
> apr_socket_close(*sock);
> family = APR_UNSPEC;
> }
> #endif
> ==============================================================================
>
>
> Thoughts?

I can't think of a compiler that won't do this on it's own, but feel
free :)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 22 20:53:48 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.