added check for valid allowed-fast messages

This commit is contained in:
Arvid Norberg 2007-10-01 01:12:00 +00:00
parent 29c8cc1a98
commit 1cbe23667b
1 changed files with 9 additions and 0 deletions

View File

@ -1597,6 +1597,15 @@ namespace libtorrent
&& t->have_piece(index))
return;
if (index < 0 || index >= int(m_have_piece.size()))
{
#ifdef TORRENT_VERBOSE_LOGGING
(*m_logger) << time_now_string() << " <== INVALID_ALLOWED_FAST [ " << index << " | s: "
<< int(m_have_piece.size()) << " ]\n";
#endif
return;
}
m_allowed_fast.push_back(index);
// if the peer has the piece and we want