fix to handle 0-size piece response without asserting

This commit is contained in:
Arvid Norberg 2008-10-06 03:23:47 +00:00
parent ccd75006d4
commit d06fea3d6c
1 changed files with 2 additions and 0 deletions

View File

@ -2691,6 +2691,8 @@ namespace libtorrent
TORRENT_ASSERT(!m_disk_recv_buffer);
TORRENT_ASSERT(disk_buffer_size <= 16 * 1024);
if (disk_buffer_size == 0) return true;
if (disk_buffer_size > 16 * 1024)
{
disconnect("invalid piece size", 2);