1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 18:18:10 +00:00

in peer-msgs.c's tr_peerMsgsCalculateActive(), adjust some of those new tracer assertions to work better with magnet links.

This commit is contained in:
Jordan Lee 2013-07-09 17:05:32 +00:00
parent 7a766efe7b
commit de248c94fb
3 changed files with 15 additions and 6 deletions

View file

@ -1912,6 +1912,7 @@ createBitTorrentPeer (tr_torrent * tor,
tr_quark client) tr_quark client)
{ {
tr_peer * peer; tr_peer * peer;
tr_peerMsgs * msgs;
tr_swarm * swarm; tr_swarm * swarm;
assert (atom != NULL); assert (atom != NULL);
@ -1931,6 +1932,10 @@ createBitTorrentPeer (tr_torrent * tor,
assert (swarm->stats.peerCount == tr_ptrArraySize (&swarm->peers)); assert (swarm->stats.peerCount == tr_ptrArraySize (&swarm->peers));
assert (swarm->stats.peerFromCount[atom->fromFirst] <= swarm->stats.peerCount); assert (swarm->stats.peerFromCount[atom->fromFirst] <= swarm->stats.peerCount);
msgs = PEER_MSGS (peer);
tr_peerMsgsUpdateActive (msgs, TR_UP);
tr_peerMsgsUpdateActive (msgs, TR_DOWN);
} }

View file

@ -708,14 +708,18 @@ tr_peerMsgsCalculateActive (const tr_peerMsgs * msgs, tr_direction direction)
else /* TR_PEER_TO_CLIENT */ else /* TR_PEER_TO_CLIENT */
{ {
if (!tr_torrentHasMetadata (msgs->torrent)) if (!tr_torrentHasMetadata (msgs->torrent))
{
is_active = true; is_active = true;
}
else else
{
is_active = tr_peerMsgsIsClientInterested (msgs) is_active = tr_peerMsgsIsClientInterested (msgs)
&& !tr_peerMsgsIsClientChoked (msgs); && !tr_peerMsgsIsClientChoked (msgs);
if (is_active) if (is_active)
assert (!tr_torrentIsSeed (msgs->torrent)); assert (!tr_torrentIsSeed (msgs->torrent));
} }
}
return is_active; return is_active;
} }