From 91f5fa20a79c53dcfd9e16aa399a66569a7bb7ca Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Tue, 24 Mar 2009 16:55:28 +0000 Subject: include overall completed count in stats --- trackerlogic.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'trackerlogic.c') diff --git a/trackerlogic.c b/trackerlogic.c index 1bd8ac7..d1ef063 100644 --- a/trackerlogic.c +++ b/trackerlogic.c @@ -128,8 +128,10 @@ size_t add_peer_to_torrent_and_return_peers( ot_hash hash, ot_peer *peer, PROTO_ #endif torrent->peer_list->peer_count++; - if( OT_PEERFLAG(peer) & PEER_FLAG_COMPLETED ) + if( OT_PEERFLAG(peer) & PEER_FLAG_COMPLETED ) { torrent->peer_list->down_count++; + stats_issue_event( EVENT_COMPLETED, 0, 0 ); + } if( OT_PEERFLAG(peer) & PEER_FLAG_SEEDING ) torrent->peer_list->seed_count++; @@ -150,8 +152,10 @@ size_t add_peer_to_torrent_and_return_peers( ot_hash hash, ot_peer *peer, PROTO_ torrent->peer_list->seed_count--; if( !(OT_PEERFLAG(peer_dest) & PEER_FLAG_SEEDING ) && (OT_PEERFLAG(peer) & PEER_FLAG_SEEDING ) ) torrent->peer_list->seed_count++; - if( !(OT_PEERFLAG(peer_dest) & PEER_FLAG_COMPLETED ) && (OT_PEERFLAG(peer) & PEER_FLAG_COMPLETED ) ) + if( !(OT_PEERFLAG(peer_dest) & PEER_FLAG_COMPLETED ) && (OT_PEERFLAG(peer) & PEER_FLAG_COMPLETED ) ) { torrent->peer_list->down_count++; + stats_issue_event( EVENT_COMPLETED, 0, 0 ); + } if( OT_PEERFLAG(peer_dest) & PEER_FLAG_COMPLETED ) OT_PEERFLAG( peer ) |= PEER_FLAG_COMPLETED; } -- cgit v1.2.3