(trunk libT) #3329 "connection problems when downloading" -- when deciding which peer to connect to, take download/seed status into account

This commit is contained in:
Charles Kerr 2010-06-26 18:49:31 +00:00
parent e70ed9a2e8
commit acd0e77901
1 changed files with 4 additions and 0 deletions

View File

@ -3393,6 +3393,10 @@ getPeerCandidateScore( const tr_torrent * tor, const struct peer_atom * atom, ui
i = torrentWasRecentlyStarted( tor ) ? 0 : 1;
score = addValToKey( score, 1, i );
/* prefer torrents we're downloading with */
i = tr_torrentIsSeed( tor ) ? 1 : 0;
score = addValToKey( score, 1, i );
/* prefer peers that we might have a chance of uploading to...
so lower seed probability is better */
if( atom->seedProbability == 100 ) i = 101;