fixed race conditon when receiving metadata from swarm

This commit is contained in:
Arvid Norberg 2009-10-31 18:39:46 +00:00
parent c9392fe0fb
commit b97dcc8c58
2 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,7 @@ release 0.14.7
ended with a /
* fixed bug in error handling when parsing torrent files
* fixed file checking bug when renaming a file before checking the torrent
* fixed race conditon when receiving metadata from swarm
release 0.14.6

View File

@ -131,6 +131,10 @@ namespace libtorrent
// don't request pieces before we have the metadata
if (!t.valid_metadata()) return;
// don't request pieces before the peer is properly
// initialized after we have the metadata
if (!t.are_files_checked()) 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()