fixed possible problem with errors occuring and reported to dht_tracker::on_receive.

This commit is contained in:
Arvid Norberg 2006-08-01 16:59:12 +00:00
parent 5ef57265bf
commit e340485974
1 changed files with 4 additions and 0 deletions

View File

@ -297,12 +297,16 @@ namespace libtorrent { namespace dht
void dht_tracker::on_receive(asio::error const& error, size_t bytes_transferred)
try
{
if (error == asio::error::operation_aborted) return;
int current_buffer = m_buffer;
m_buffer = (m_buffer + 1) & 1;
m_socket.async_receive_from(asio::buffer(&m_in_buf[m_buffer][0]
, m_in_buf[m_buffer].size()), m_remote_endpoint[m_buffer]
, bind(&dht_tracker::on_receive, this, _1, _2));
if (error) return;
#ifdef TORRENT_DHT_VERBOSE_LOGGING
++m_total_message_input;
#endif