a bit more conservative block request timeouts. promote some invariant checks in the DHT as expensive (to disable them for regular debug builds)

This commit is contained in:
Arvid Norberg 2014-12-10 07:13:57 +00:00
parent 1ce3bdf0d0
commit 333a13c957
2 changed files with 5 additions and 1 deletions

View File

@ -490,7 +490,9 @@ bool routing_table::add_node(node_entry e)
routing_table::add_node_status_t routing_table::add_node_impl(node_entry e)
{
#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS
INVARIANT_CHECK;
#endif
// if we already have this (IP,port), don't do anything
if (m_router_nodes.find(e.ep()) != m_router_nodes.end())
@ -940,7 +942,9 @@ void routing_table::for_each_node(
void routing_table::node_failed(node_id const& nid, udp::endpoint const& ep)
{
#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS
INVARIANT_CHECK;
#endif
// if messages to ourself fails, ignore it
if (nid == m_id) return;

View File

@ -4193,7 +4193,7 @@ namespace libtorrent
}
else
{
ret = avg + deviation * 3;
ret = avg + deviation * 4;
}
// ret is milliseconds, the return value is seconds. Convert to