undo reordering change that broke compilation

This commit is contained in:
Miguel Freitas 2013-07-29 21:12:19 -03:00
parent 07e0f50945
commit d96f8814d3

View File

@ -312,32 +312,6 @@ bool rpc_manager::incoming(msg const& m, node_id* id)
return false;
}
lazy_entry const* ext_ip = ret_ent->dict_find_string("ip");
if (ext_ip && ext_ip->string_length() == 4)
{
// this node claims we use the wrong node-ID!
address_v4::bytes_type b;
memcpy(&b[0], ext_ip->string_ptr(), 4);
if (m_observer)
m_observer->set_external_address(address_v4(b)
, m.addr.address());
// [MF] enforced: no valid response is sent along with "ip".
return false;
}
#if TORRENT_USE_IPV6
else if (ext_ip && ext_ip->string_length() == 16)
{
// this node claims we use the wrong node-ID!
address_v6::bytes_type b;
memcpy(&b[0], ext_ip->string_ptr(), 16);
if (m_observer)
m_observer->set_external_address(address_v6(b)
, m.addr.address());
// [MF] enforced: no valid response is sent along with "ip".
return false;
}
#endif
ptime now = time_now_hires();
#ifdef TORRENT_DHT_VERBOSE_LOGGING
@ -364,6 +338,32 @@ bool rpc_manager::incoming(msg const& m, node_id* id)
return false;
}
lazy_entry const* ext_ip = ret_ent->dict_find_string("ip");
if (ext_ip && ext_ip->string_length() == 4)
{
// this node claims we use the wrong node-ID!
address_v4::bytes_type b;
memcpy(&b[0], ext_ip->string_ptr(), 4);
if (m_observer)
m_observer->set_external_address(address_v4(b)
, m.addr.address());
// [MF] enforced: no valid response is sent along with "ip".
return false;
}
#if TORRENT_USE_IPV6
else if (ext_ip && ext_ip->string_length() == 16)
{
// this node claims we use the wrong node-ID!
address_v6::bytes_type b;
memcpy(&b[0], ext_ip->string_ptr(), 16);
if (m_observer)
m_observer->set_external_address(address_v6(b)
, m.addr.address());
// [MF] enforced: no valid response is sent along with "ip".
return false;
}
#endif
#ifdef TORRENT_DHT_VERBOSE_LOGGING
TORRENT_LOG(rpc) << "[" << o->m_algorithm.get() << "] Reply with transaction id: "
<< tid << " from " << m.addr;