> 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