fix up some cases where we shouldn't be in end-game mode

This commit is contained in:
Arvid Norberg 2011-06-01 09:14:21 +00:00
parent 8190744f0c
commit ae76e77065
2 changed files with 5 additions and 1 deletions

View File

@ -1248,6 +1248,7 @@ namespace libtorrent
peer_log("<== CHOKE");
#endif
m_peer_choked = true;
set_endgame(false);
clear_request_queue();
}

View File

@ -305,7 +305,10 @@ namespace libtorrent
// there aren't enough. This means we're in end-game mode
// as long as we have at least one request outstanding,
// we shouldn't pick another piece
c.set_endgame(true);
// if we are attempting to download 'allowed' pieces
// and can't find any, that doesn't count as end-game
if (!c.has_peer_choked())
c.set_endgame(true);
// if we don't have any potential busy blocks to request
// or if we already have outstanding requests, don't