|
|
@ -1489,7 +1489,7 @@ void Session::configurePeerClasses() |
|
|
|
// Proactively do the same for 0.0.0.0 and address_v4::any()
|
|
|
|
// Proactively do the same for 0.0.0.0 and address_v4::any()
|
|
|
|
f.add_rule(lt::address_v4::any() |
|
|
|
f.add_rule(lt::address_v4::any() |
|
|
|
, lt::address_v4::broadcast() |
|
|
|
, lt::address_v4::broadcast() |
|
|
|
, 1 << static_cast<LTUnderlyingType<lt::peer_class_t>>(lt::session::global_peer_class_id)); |
|
|
|
, 1 << toLTUnderlyingType(lt::session::global_peer_class_id)); |
|
|
|
|
|
|
|
|
|
|
|
// IPv6 may not be available on OS and the parsing
|
|
|
|
// IPv6 may not be available on OS and the parsing
|
|
|
|
// would result in an exception -> abnormal program termination
|
|
|
|
// would result in an exception -> abnormal program termination
|
|
|
@ -1498,7 +1498,7 @@ void Session::configurePeerClasses() |
|
|
|
{ |
|
|
|
{ |
|
|
|
f.add_rule(lt::address_v6::any() |
|
|
|
f.add_rule(lt::address_v6::any() |
|
|
|
, lt::make_address("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") |
|
|
|
, lt::make_address("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") |
|
|
|
, 1 << static_cast<LTUnderlyingType<lt::peer_class_t>>(lt::session::global_peer_class_id)); |
|
|
|
, 1 << toLTUnderlyingType(lt::session::global_peer_class_id)); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const std::exception &) {} |
|
|
|
catch (const std::exception &) {} |
|
|
|
|
|
|
|
|
|
|
@ -1507,21 +1507,21 @@ void Session::configurePeerClasses() |
|
|
|
// local networks
|
|
|
|
// local networks
|
|
|
|
f.add_rule(lt::make_address("10.0.0.0") |
|
|
|
f.add_rule(lt::make_address("10.0.0.0") |
|
|
|
, lt::make_address("10.255.255.255") |
|
|
|
, lt::make_address("10.255.255.255") |
|
|
|
, 1 << static_cast<LTUnderlyingType<lt::peer_class_t>>(lt::session::local_peer_class_id)); |
|
|
|
, 1 << toLTUnderlyingType(lt::session::local_peer_class_id)); |
|
|
|
f.add_rule(lt::make_address("172.16.0.0") |
|
|
|
f.add_rule(lt::make_address("172.16.0.0") |
|
|
|
, lt::make_address("172.31.255.255") |
|
|
|
, lt::make_address("172.31.255.255") |
|
|
|
, 1 << static_cast<LTUnderlyingType<lt::peer_class_t>>(lt::session::local_peer_class_id)); |
|
|
|
, 1 << toLTUnderlyingType(lt::session::local_peer_class_id)); |
|
|
|
f.add_rule(lt::make_address("192.168.0.0") |
|
|
|
f.add_rule(lt::make_address("192.168.0.0") |
|
|
|
, lt::make_address("192.168.255.255") |
|
|
|
, lt::make_address("192.168.255.255") |
|
|
|
, 1 << static_cast<LTUnderlyingType<lt::peer_class_t>>(lt::session::local_peer_class_id)); |
|
|
|
, 1 << toLTUnderlyingType(lt::session::local_peer_class_id)); |
|
|
|
// link local
|
|
|
|
// link local
|
|
|
|
f.add_rule(lt::make_address("169.254.0.0") |
|
|
|
f.add_rule(lt::make_address("169.254.0.0") |
|
|
|
, lt::make_address("169.254.255.255") |
|
|
|
, lt::make_address("169.254.255.255") |
|
|
|
, 1 << static_cast<LTUnderlyingType<lt::peer_class_t>>(lt::session::local_peer_class_id)); |
|
|
|
, 1 << toLTUnderlyingType(lt::session::local_peer_class_id)); |
|
|
|
// loopback
|
|
|
|
// loopback
|
|
|
|
f.add_rule(lt::make_address("127.0.0.0") |
|
|
|
f.add_rule(lt::make_address("127.0.0.0") |
|
|
|
, lt::make_address("127.255.255.255") |
|
|
|
, lt::make_address("127.255.255.255") |
|
|
|
, 1 << static_cast<LTUnderlyingType<lt::peer_class_t>>(lt::session::local_peer_class_id)); |
|
|
|
, 1 << toLTUnderlyingType(lt::session::local_peer_class_id)); |
|
|
|
|
|
|
|
|
|
|
|
// IPv6 may not be available on OS and the parsing
|
|
|
|
// IPv6 may not be available on OS and the parsing
|
|
|
|
// would result in an exception -> abnormal program termination
|
|
|
|
// would result in an exception -> abnormal program termination
|
|
|
@ -1531,15 +1531,15 @@ void Session::configurePeerClasses() |
|
|
|
// link local
|
|
|
|
// link local
|
|
|
|
f.add_rule(lt::make_address("fe80::") |
|
|
|
f.add_rule(lt::make_address("fe80::") |
|
|
|
, lt::make_address("febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff") |
|
|
|
, lt::make_address("febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff") |
|
|
|
, 1 << static_cast<LTUnderlyingType<lt::peer_class_t>>(lt::session::local_peer_class_id)); |
|
|
|
, 1 << toLTUnderlyingType(lt::session::local_peer_class_id)); |
|
|
|
// unique local addresses
|
|
|
|
// unique local addresses
|
|
|
|
f.add_rule(lt::make_address("fc00::") |
|
|
|
f.add_rule(lt::make_address("fc00::") |
|
|
|
, lt::make_address("fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") |
|
|
|
, lt::make_address("fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") |
|
|
|
, 1 << static_cast<LTUnderlyingType<lt::peer_class_t>>(lt::session::local_peer_class_id)); |
|
|
|
, 1 << toLTUnderlyingType(lt::session::local_peer_class_id)); |
|
|
|
// loopback
|
|
|
|
// loopback
|
|
|
|
f.add_rule(lt::address_v6::loopback() |
|
|
|
f.add_rule(lt::address_v6::loopback() |
|
|
|
, lt::address_v6::loopback() |
|
|
|
, lt::address_v6::loopback() |
|
|
|
, 1 << static_cast<LTUnderlyingType<lt::peer_class_t>>(lt::session::local_peer_class_id)); |
|
|
|
, 1 << toLTUnderlyingType(lt::session::local_peer_class_id)); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const std::exception &) {} |
|
|
|
catch (const std::exception &) {} |
|
|
|
} |
|
|
|
} |
|
|
@ -2377,7 +2377,7 @@ void Session::saveTorrentsQueue() const |
|
|
|
for (const TorrentImpl *torrent : asConst(m_torrents)) |
|
|
|
for (const TorrentImpl *torrent : asConst(m_torrents)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// We require actual (non-cached) queue position here!
|
|
|
|
// We require actual (non-cached) queue position here!
|
|
|
|
const int queuePos = static_cast<LTUnderlyingType<lt::queue_position_t>>(torrent->nativeHandle().queue_position()); |
|
|
|
const int queuePos = toLTUnderlyingType(torrent->nativeHandle().queue_position()); |
|
|
|
if (queuePos >= 0) |
|
|
|
if (queuePos >= 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (queuePos >= queue.size()) |
|
|
|
if (queuePos >= queue.size()) |
|
|
|