1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-30 19:46:56 +00:00

#5407: In tr_peerMgrGetDesiredAvailable(), check if swarm is running (suggested by x190)

This commit is contained in:
Mike Gelfand 2015-12-31 14:33:02 +00:00
parent 7d30ad3ff6
commit de304e8a35

View file

@ -2619,17 +2619,12 @@ tr_peerMgrGetDesiredAvailable (const tr_torrent * tor)
/* common shortcuts... */
if (!tor->isRunning || tor->isStopping)
return 0;
if (tr_torrentIsSeed (tor))
return 0;
if (!tr_torrentHasMetadata (tor))
if (!tor->isRunning || tor->isStopping ||
tr_torrentIsSeed (tor) || !tr_torrentHasMetadata (tor))
return 0;
s = tor->swarm;
if (s == NULL)
if (s == NULL || !s->isRunning)
return 0;
n = tr_ptrArraySize (&s->peers);