mirror of
https://github.com/transmission/transmission
synced 2024-12-27 01:57:52 +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:
parent
7a766efe7b
commit
de248c94fb
3 changed files with 15 additions and 6 deletions
|
@ -1912,6 +1912,7 @@ createBitTorrentPeer (tr_torrent * tor,
|
|||
tr_quark client)
|
||||
{
|
||||
tr_peer * peer;
|
||||
tr_peerMsgs * msgs;
|
||||
tr_swarm * swarm;
|
||||
|
||||
assert (atom != NULL);
|
||||
|
@ -1931,6 +1932,10 @@ createBitTorrentPeer (tr_torrent * tor,
|
|||
|
||||
assert (swarm->stats.peerCount == tr_ptrArraySize (&swarm->peers));
|
||||
assert (swarm->stats.peerFromCount[atom->fromFirst] <= swarm->stats.peerCount);
|
||||
|
||||
msgs = PEER_MSGS (peer);
|
||||
tr_peerMsgsUpdateActive (msgs, TR_UP);
|
||||
tr_peerMsgsUpdateActive (msgs, TR_DOWN);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -708,14 +708,18 @@ tr_peerMsgsCalculateActive (const tr_peerMsgs * msgs, tr_direction direction)
|
|||
else /* TR_PEER_TO_CLIENT */
|
||||
{
|
||||
if (!tr_torrentHasMetadata (msgs->torrent))
|
||||
{
|
||||
is_active = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
is_active = tr_peerMsgsIsClientInterested (msgs)
|
||||
&& !tr_peerMsgsIsClientChoked (msgs);
|
||||
|
||||
if (is_active)
|
||||
assert (!tr_torrentIsSeed (msgs->torrent));
|
||||
}
|
||||
}
|
||||
|
||||
return is_active;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue