From da5b07ecd81f6cc01a6e85a77a5d70d5d16f9f7f Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 15 Jan 2004 22:29:13 +0000 Subject: [PATCH] *** empty log message *** --- include/libtorrent/alert.hpp | 1 + include/libtorrent/session.hpp | 2 +- src/session.cpp | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/libtorrent/alert.hpp b/include/libtorrent/alert.hpp index 00665a44d..7b7781f61 100755 --- a/include/libtorrent/alert.hpp +++ b/include/libtorrent/alert.hpp @@ -48,6 +48,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { + // TODO: all alerts should have a timestamp class alert { public: diff --git a/include/libtorrent/session.hpp b/include/libtorrent/session.hpp index 1dc13662f..84b7ff680 100755 --- a/include/libtorrent/session.hpp +++ b/include/libtorrent/session.hpp @@ -205,7 +205,7 @@ namespace libtorrent bool m_incoming_connection; #ifndef NDEBUG - void assert_invariant(); + void assert_invariant(int marker = -1); boost::shared_ptr create_log(std::string name); boost::shared_ptr m_logger; #endif diff --git a/src/session.cpp b/src/session.cpp index 0a619ccdc..005918efa 100755 --- a/src/session.cpp +++ b/src/session.cpp @@ -420,7 +420,7 @@ namespace libtorrent { #ifndef NDEBUG - assert_invariant(); + assert_invariant(0); loops_per_second++; #endif @@ -714,8 +714,10 @@ namespace libtorrent #endif #ifndef NDEBUG - void session_impl::assert_invariant() + void session_impl::assert_invariant(int marker) { + static int place = 0; + if (marker != -1) place = 0; for (connection_map::iterator i = m_connections.begin(); i != m_connections.end(); ++i) @@ -730,6 +732,7 @@ namespace libtorrent error_log << "peer_connection::send_quota_left " << p->send_quota_left() << "\n"; error_log << "peer_connection::send_quota " << p->send_quota() << "\n"; error_log << "peer_connection::get_peer_id " << p->get_peer_id() << "\n"; + error_log << "place: " << place << "\n"; error_log.flush(); assert(false); } @@ -739,6 +742,7 @@ namespace libtorrent ->get_policy().has_connection(boost::get_pointer(i->second))); } } + place++; } #endif