[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: Erik Huelsmann <e.huelsmann_at_gmx.net>
Date: 2005-03-22 11:52:59 CET

> Why does the ipv6_supported variable exist at all in the below code?

Optimization, I believe. (Does that need optimization?!)

bye,

Erik.

>
==============================================================================
> {
> apr_sockaddr_t *sa;
> apr_status_t status;
> int family = APR_INET;
> int ipv6_supported = APR_HAVE_IPV6;
>
> /* 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
> if (ipv6_supported)
> {
> #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)
> ipv6_supported = 0;
> else
> {
> apr_socket_close(*sock);
> family = APR_UNSPEC;
> }
> }
> #endif
>
==============================================================================
>
> 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?
>
>
> Max.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>

-- 
"Happy ProMail" bis 24. März: http://www.gmx.net/de/go/promail
Zum 6. Geburtstag gibt's GMX ProMail jetzt 66 Tage kostenlos!
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 22 11:54:26 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.