fixed bug where pieces may have been requested before the metadata was received

This commit is contained in:
Arvid Norberg 2009-10-05 00:10:35 +00:00
parent 115a4b1863
commit cdc30f1dd1
2 changed files with 5 additions and 0 deletions

View File

@ -83,6 +83,8 @@ release 0.14.7
* improved forward compatibility in DHT
* added set_piece_hashes that takes a callback to the python binding
* fixed division by zero in get_peer_info()
* fixed bug where pieces may have been requested before the metadata
was received
release 0.14.6

View File

@ -128,6 +128,9 @@ namespace libtorrent
if (c.no_download()) return;
if (t.upload_mode()) return;
// don't request pieces before we have the metadata
if (!t.valid_metadata()) return;
TORRENT_ASSERT(t.valid_metadata());
TORRENT_ASSERT(c.peer_info_struct() != 0 || !dynamic_cast<bt_peer_connection*>(&c));
int num_requests = c.desired_queue_size()