]> granicus.if.org Git - transmission/commitdiff
in peer-msgs.c's tr_peerMsgsCalculateActive(), adjust some of those new tracer assert...
authorJordan Lee <jordan@transmissionbt.com>
Tue, 9 Jul 2013 17:05:32 +0000 (17:05 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Tue, 9 Jul 2013 17:05:32 +0000 (17:05 +0000)
libtransmission/peer-mgr.c
libtransmission/peer-msgs.c
libtransmission/session.c

index 5a049d04ebe4bd664354bd9d1f80328bf416ef77..cb6d184c18be77ab36a8d768fad709ea8cd6aff3 100644 (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);
 }
 
 
index f77fc51e8d12e88fadce52689de6c10763dd90df..9b6db0e421800f2e3e616f939218eaeff63a32a9 100644 (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;
index d55ecfce48d665547594cbdb9ed126de57243b89..a0512b43bd9d7522678802eea126ee707126d767 100644 (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;