updated dht verbose logging to try to catch #176

This commit is contained in:
Arvid Norberg 2007-11-24 21:38:46 +00:00
parent e931ee54f6
commit 29fa298d05
1 changed files with 15 additions and 1 deletions

View File

@ -226,6 +226,10 @@ bool rpc_manager::incoming(msg const& m)
std::ofstream reply_stats("libtorrent_logs/round_trip_ms.log", std::ios::app);
reply_stats << m.addr << "\t" << total_milliseconds(time_now() - o->sent)
<< std::endl;
#endif
#ifdef TORRENT_DHT_VERBOSE_LOGGING
TORRENT_LOG(rpc) << "Reply with transaction id: "
<< tid << " from " << m.addr;
#endif
o->reply(m);
m_transactions[tid] = 0;
@ -284,6 +288,10 @@ time_duration rpc_manager::tick()
try
{
m_transactions[m_oldest_transaction_id] = 0;
#ifdef TORRENT_DHT_VERBOSE_LOGGING
TORRENT_LOG(rpc) << "Timing out transaction id: "
<< m_oldest_transaction_id << " from " << o->target_addr;
#endif
timeouts.push_back(o);
} catch (std::exception) {}
}
@ -309,7 +317,13 @@ unsigned int rpc_manager::new_transaction_id(observer_ptr o)
// moving the observer into the set of aborted transactions
// it will prevent it from spawning new requests right now,
// since that would break the invariant
m_aborted_transactions.push_back(m_transactions[m_next_transaction_id]);
observer_ptr o = m_transactions[m_next_transaction_id];
m_aborted_transactions.push_back(o);
#ifdef TORRENT_DHT_VERBOSE_LOGGING
TORRENT_LOG(rpc) << "[new_transaction_id] Aborting message with transaction id: "
<< m_next_transaction_id << " sent to " << o->target_addr
<< " at " << o->sent;
#endif
m_transactions[m_next_transaction_id] = 0;
TORRENT_ASSERT(m_oldest_transaction_id == m_next_transaction_id);
}