From 90719bf77dd80a0e0b1736fa06de436e31a41f91 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 29 Apr 2011 02:45:02 +0000 Subject: [PATCH] fixed bug when receiving a have message before having the metadata --- ChangeLog | 1 + src/peer_connection.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c5ba12102..7989209e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -86,6 +86,7 @@ incoming connection * added more detailed instrumentation of the disk I/O thread + * fixed bug when receiving a have message before having the metadata * fixed python bindings build with disabled DHT support * fixed BSD file allocation issue * fixed bug in session::delete_files option to remove_torrent diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 0d2148840..f1127a0dd 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -1638,7 +1638,7 @@ namespace libtorrent if (is_disconnecting()) return; - if (!t->valid_metadata() && index > int(m_have_piece.size())) + if (!t->valid_metadata() && index >= int(m_have_piece.size())) { if (index < 65536) {