forked from premiere/premiere-libtorrent
Merge pull request #446 from arvidn/default-gateway-fix-1.1
forward port removal of special case for windows and mingw-1.1
This commit is contained in:
commit
764c8a7f0c
|
@ -693,13 +693,8 @@ namespace libtorrent
|
||||||
address get_default_gateway(io_service& ios, error_code& ec)
|
address get_default_gateway(io_service& ios, error_code& ec)
|
||||||
{
|
{
|
||||||
std::vector<ip_route> ret = enum_routes(ios, ec);
|
std::vector<ip_route> ret = enum_routes(ios, ec);
|
||||||
#if defined TORRENT_WINDOWS || defined TORRENT_MINGW
|
|
||||||
std::vector<ip_route>::iterator i = std::find_if(ret.begin(), ret.end()
|
|
||||||
, boost::bind(&is_loopback, boost::bind(&ip_route::destination, _1)));
|
|
||||||
#else
|
|
||||||
std::vector<ip_route>::iterator i = std::find_if(ret.begin(), ret.end()
|
std::vector<ip_route>::iterator i = std::find_if(ret.begin(), ret.end()
|
||||||
, boost::bind(&ip_route::destination, _1) == address());
|
, boost::bind(&ip_route::destination, _1) == address());
|
||||||
#endif
|
|
||||||
if (i == ret.end()) return address();
|
if (i == ret.end()) return address();
|
||||||
return i->gateway;
|
return i->gateway;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue