From 471d81394d10055c20f26bc43327d6df416a56b1 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 10 Jan 2008 22:44:32 +0000 Subject: [PATCH] added invariant check --- src/peer_connection.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index f3db521e6..fdbfc8471 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -3032,6 +3032,10 @@ namespace libtorrent TORRENT_ASSERT(int(m_reading) + int(m_requested_read_quota) <= 1); TORRENT_ASSERT(int(m_writing) + int(m_requested_write_quota) <= 1); + if (m_requested_read_quota) + TORRENT_ASSERT(m_bandwidth_limit[download_channel].quota_left() == 0); + if (m_requested_write_quota) + TORRENT_ASSERT(m_bandwidth_limit[upload_channel].quota_left() == 0); std::set unique; std::copy(m_download_queue.begin(), m_download_queue.end(), std::inserter(unique, unique.begin()));