don't try IPv6 on windows if it's not installed

This commit is contained in:
Arvid Norberg 2009-03-27 18:44:40 +00:00
parent d4e08cd37f
commit db9236fcf8
2 changed files with 13 additions and 0 deletions

View File

@ -54,6 +54,7 @@ release 0.14.3
* fixed CIDR-distance calculation in the precense of IPv6 peers * fixed CIDR-distance calculation in the precense of IPv6 peers
* save partial resume data for torrents that are queued for checking * save partial resume data for torrents that are queued for checking
or checking, to maintain stats and renamed files or checking, to maintain stats and renamed files
* Don't try IPv6 on windows if it's not installed
release 0.14.2 release 0.14.2

View File

@ -725,6 +725,15 @@ namespace aux {
async_accept(s.sock); async_accept(s.sock);
} }
#ifdef TORRENT_WINDOWS
// only try to open the IPv6 port if IPv6 is installed
SOCKADDR_STORAGE storage;
int len = sizeof(storage);
if (WSAStringToAddressA("::1", AF_INET6, 0,
(sockaddr*)&storage, &len) != SOCKET_ERROR)
{
#endif
s = setup_listener( s = setup_listener(
tcp::endpoint(address_v6::any(), m_listen_interface.port()) tcp::endpoint(address_v6::any(), m_listen_interface.port())
, m_listen_port_retries, true); , m_listen_port_retries, true);
@ -734,6 +743,9 @@ namespace aux {
m_listen_sockets.push_back(s); m_listen_sockets.push_back(s);
async_accept(s.sock); async_accept(s.sock);
} }
#ifdef TORRENT_WINDOWS
}
#endif
} }
else else
{ {