#ifdef IPV6_V6ONLY
/*
- * Accepts only IPv6 connections on IPv6 sockets
- * (and open an IPv4 socket later as well if needed).
- * Only Linux and FreeBSD can map IPv4 connections on IPv6 sockets,
- * so this allows for more uniform handling across platforms. Besides,
- * it makes sure that IPv4 addresses will be printed as w.x.y.z rather
- * than ::ffff:w.x.y.z
+ * Accepts only IPv6 and IPv4 connections on IPv6 sockets.
+ * If possible, we should open two sockets, but it is not always possible.
*/
if (family == AF_INET6)
- setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &(int){ 1 }, sizeof (int));
+ setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &(int){ 0 }, sizeof (int));
#endif
#if defined (WIN32) || defined (UNDER_CE)
if (p_this->b_die)
{
#if defined(WIN32) || defined(UNDER_CE)
- WSASetLastError(WSAEINTR);
+ WSASetLastError (WSAEINTR);
#else
errno = EINTR;
#endif
}
else
{
- if( ufd[i].revents & POLLRDHUP )
+ if (ufd[i].revents & POLLRDHUP)
return 0; // EOF, read() would yield 0
}
if (n == -1)
{
#if defined(WIN32) || defined(UNDER_CE)
- switch (WSAGetLastError())
+ switch (WSAGetLastError ())
{
case WSAEWOULDBLOCK:
/* only happens with vs != NULL (SSL) - not really an error */
p_buf += n;
i_buflen -= n;
- if( n == 0 || !waitall )
+ if ((n == 0) || !waitall)
break;
}
return i_total;