ignore zero size piece messages

This commit is contained in:
Arvid Norberg 2008-07-09 17:37:38 +00:00
parent 06f3ad65e8
commit fc3bb01587
1 changed files with 10 additions and 0 deletions

View File

@ -1481,6 +1481,16 @@ namespace libtorrent
"qs: " << m_desired_queue_size << " ]\n";
#endif
if (p.length == 0)
{
if (t->alerts().should_post<peer_error_alert>())
{
t->alerts().post_alert(peer_error_alert(t->get_handle(), m_remote
, m_peer_id, "peer sent 0 length piece"));
}
return;
}
if (!verify_piece(p))
{
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING