tr_quark client)
{
tr_peer * peer;
+ tr_peerMsgs * msgs;
tr_swarm * swarm;
assert (atom != NULL);
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);
}
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;
}
void
-tr_sessionSet (tr_session * session, tr_variant * settings)
+tr_sessionSet (tr_session * session, tr_variant * settings)
{
struct init_data data;
data.done = false;