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) {