introduced a more scalable API for torrent status updates (post_torrent_updates())

This commit is contained in:
Arvid Norberg
2011-11-15 02:34:00 +00:00
parent b0271e993c
commit c4232065d8
14 changed files with 260 additions and 46 deletions

View File

@@ -2139,11 +2139,15 @@ namespace libtorrent
TORRENT_ASSERT(m_outstanding_bytes >= bytes);
m_outstanding_bytes -= bytes;
if (m_outstanding_bytes < 0) m_outstanding_bytes = 0;
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
boost::shared_ptr<torrent> t = associated_torrent().lock();
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
TORRENT_ASSERT(m_received_in_piece + bytes <= t->block_size());
m_received_in_piece += bytes;
#endif
// progress of this torrent increased
t->state_updated();
#if !defined TORRENT_DISABLE_INVARIANT_CHECKS && defined TORRENT_DEBUG
check_invariant();
#endif