fixed bugs in dont-have and upload-only extension messages

This commit is contained in:
Arvid Norberg
2011-10-11 07:20:12 +00:00
parent 744a3be65d
commit e1bfd8541f
2 changed files with 8 additions and 3 deletions

View File

@@ -1645,7 +1645,7 @@ namespace libtorrent
if (extended_id == upload_only_msg)
{
if (!packet_finished()) return;
if (packet_size() != 1)
if (packet_size() != 3)
{
#ifdef TORRENT_VERBOSE_LOGGING
peer_log("<== UPLOAD_ONLY [ ERROR: unexpected packet size: %d ]", packet_size());
@@ -1663,7 +1663,7 @@ namespace libtorrent
if (extended_id == share_mode_msg)
{
if (!packet_finished()) return;
if (packet_size() != 1)
if (packet_size() != 3)
{
#ifdef TORRENT_VERBOSE_LOGGING
peer_log("<== SHARE_MODE [ ERROR: unexpected packet size: %d ]", packet_size());
@@ -1691,7 +1691,7 @@ namespace libtorrent
if (extended_id == dont_have_msg)
{
if (!packet_finished()) return;
if (packet_size() != 4)
if (packet_size() != 6)
{
#ifdef TORRENT_VERBOSE_LOGGING
peer_log("<== DONT_HAVE [ ERROR: unexpected packet size: %d ]", packet_size());