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_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);
}

View File

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

View File

@ -941,7 +941,7 @@ sessionSetImpl (void * vdata)
}
void
tr_sessionSet (tr_session * session, tr_variant * settings)
tr_sessionSet (tr_session * session, tr_variant * settings)
{
struct init_data data;
data.done = false;