Browse Source

trying to fix/understand assertion failure

version: 1.0.0.0
$Rev: 7680 $
file: 'peer_connection.cpp'
line: 5715
function: void libtorrent::peer_connection::check_invariant() const
expression: m_outstanding_bytes >= 0
miguelfreitas
Miguel Freitas 11 years ago
parent
commit
d8b8ff4b4f
  1. 4
      libtorrent/src/peer_connection.cpp

4
libtorrent/src/peer_connection.cpp

@ -2185,7 +2185,8 @@ namespace libtorrent
TORRENT_ASSERT(m_download_queue.front().block == b); TORRENT_ASSERT(m_download_queue.front().block == b);
m_download_queue.front().not_wanted = true; m_download_queue.front().not_wanted = true;
} }
m_outstanding_bytes += r.length; if( r.length > 0 )
m_outstanding_bytes += r.length;
} }
} }
@ -3271,6 +3272,7 @@ namespace libtorrent
TORRENT_ASSERT(verify_piece(t->to_req(block.block))); TORRENT_ASSERT(verify_piece(t->to_req(block.block)));
m_download_queue.push_back(block); m_download_queue.push_back(block);
TORRENT_ASSERT(block_size >= 0);
m_outstanding_bytes += block_size; m_outstanding_bytes += block_size;
#if !defined TORRENT_DISABLE_INVARIANT_CHECKS && defined TORRENT_DEBUG #if !defined TORRENT_DISABLE_INVARIANT_CHECKS && defined TORRENT_DEBUG
check_invariant(); check_invariant();

Loading…
Cancel
Save