no need to disconnect peers that send DHT_PORT message without advertising support for it
This commit is contained in:
@@ -1315,11 +1315,6 @@ namespace libtorrent
|
|||||||
|
|
||||||
TORRENT_ASSERT(received > 0);
|
TORRENT_ASSERT(received > 0);
|
||||||
m_statistics.received_bytes(0, received);
|
m_statistics.received_bytes(0, received);
|
||||||
if (!m_supports_dht_port)
|
|
||||||
{
|
|
||||||
disconnect(errors::invalid_dht_port, 2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (packet_size() != 3)
|
if (packet_size() != 3)
|
||||||
{
|
{
|
||||||
disconnect(errors::invalid_dht_port, 2);
|
disconnect(errors::invalid_dht_port, 2);
|
||||||
@@ -1333,6 +1328,15 @@ namespace libtorrent
|
|||||||
int listen_port = detail::read_uint16(ptr);
|
int listen_port = detail::read_uint16(ptr);
|
||||||
|
|
||||||
incoming_dht_port(listen_port);
|
incoming_dht_port(listen_port);
|
||||||
|
|
||||||
|
if (!m_supports_dht_port)
|
||||||
|
{
|
||||||
|
m_supports_dht_port = true;
|
||||||
|
#ifndef TORRENT_DISABLE_DHT
|
||||||
|
if (m_supports_dht_port && m_ses.m_dht)
|
||||||
|
write_dht_port(m_ses.get_dht_settings().service_port);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bt_peer_connection::on_suggest_piece(int received)
|
void bt_peer_connection::on_suggest_piece(int received)
|
||||||
|
Reference in New Issue
Block a user