reorganize code to make it straightforward.
This commit is contained in:
@@ -464,9 +464,8 @@ namespace libtorrent { namespace dht
|
|||||||
bencode(std::back_inserter(m_send_buf), e);
|
bencode(std::back_inserter(m_send_buf), e);
|
||||||
error_code ec;
|
error_code ec;
|
||||||
|
|
||||||
if (m_sock.send(addr, &m_send_buf[0], int(m_send_buf.size()), ec, send_flags))
|
bool ret = m_sock.send(addr, &m_send_buf[0], int(m_send_buf.size()), ec, send_flags);
|
||||||
{
|
if (!ret || ec)
|
||||||
if (ec)
|
|
||||||
{
|
{
|
||||||
m_counters.inc_stats_counter(counters::dht_messages_out_dropped);
|
m_counters.inc_stats_counter(counters::dht_messages_out_dropped);
|
||||||
#ifndef TORRENT_DISABLE_LOGGING
|
#ifndef TORRENT_DISABLE_LOGGING
|
||||||
@@ -487,17 +486,6 @@ namespace libtorrent { namespace dht
|
|||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
m_counters.inc_stats_counter(counters::dht_messages_out_dropped);
|
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_LOGGING
|
|
||||||
m_log->log_packet(dht_logger::outgoing_message, &m_send_buf[0]
|
|
||||||
, m_send_buf.size(), addr);
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user