From 29fa298d055341c57b76a4c7b7cdb49e6f20dc0d Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 24 Nov 2007 21:38:46 +0000 Subject: [PATCH] updated dht verbose logging to try to catch #176 --- src/kademlia/rpc_manager.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/kademlia/rpc_manager.cpp b/src/kademlia/rpc_manager.cpp index 086b8fc44..aa729aab7 100644 --- a/src/kademlia/rpc_manager.cpp +++ b/src/kademlia/rpc_manager.cpp @@ -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); }