From: Jordan Lee Date: Tue, 9 Jul 2013 17:05:32 +0000 (+0000) Subject: in peer-msgs.c's tr_peerMsgsCalculateActive(), adjust some of those new tracer assert... X-Git-Tag: 2.81~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de248c94fbd34d95d01a16c768c5a9829c4ed6f7;p=transmission in peer-msgs.c's tr_peerMsgsCalculateActive(), adjust some of those new tracer assertions to work better with magnet links. --- diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 5a049d04e..cb6d184c1 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -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); } diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index f77fc51e8..9b6db0e42 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -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; diff --git a/libtransmission/session.c b/libtransmission/session.c index d55ecfce4..a0512b43b 100644 --- a/libtransmission/session.c +++ b/libtransmission/session.c @@ -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;