ut_pex exception fix

This commit is contained in:
Arvid Norberg 2008-04-07 03:31:41 +00:00
parent 507b812ae8
commit 6fa3d37e83
1 changed files with 4 additions and 1 deletions

View File

@ -215,7 +215,10 @@ namespace libtorrent { namespace
if (m_message_index == 0) return false; if (m_message_index == 0) return false;
if (length > 500 * 1024) if (length > 500 * 1024)
throw protocol_error("uT peer exchange message larger than 500 kB"); {
m_pc.disconnect("peer exchange message larger than 500 kB");
return true;
}
if (body.left() < length) return true; if (body.left() < length) return true;