forked from premiere/premiere-libtorrent
fix performance issue when receiving UDP packets (the udp tracker would not reject DHT packets immediately)
This commit is contained in:
parent
f85d62b601
commit
51dd174303
|
@ -328,7 +328,12 @@ namespace libtorrent
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* ptr = buf + 4;
|
// the first word is the action, if it's not [0, 3]
|
||||||
|
// it's not a valid udp tracker response
|
||||||
|
const char* ptr = buf;
|
||||||
|
boost::uint32_t action = detail::read_uint32(ptr);
|
||||||
|
if (action > 3) return false;
|
||||||
|
|
||||||
boost::uint32_t transaction = detail::read_uint32(ptr);
|
boost::uint32_t transaction = detail::read_uint32(ptr);
|
||||||
udp_conns_t::iterator i = m_udp_conns.find(transaction);
|
udp_conns_t::iterator i = m_udp_conns.find(transaction);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue