summaryrefslogtreecommitdiff
path: root/trackerlogic.c
diff options
context:
space:
mode:
authorerdgeist <>2008-11-03 01:26:38 +0000
committererdgeist <>2008-11-03 01:26:38 +0000
commitbb1c5d28056647f12883b83d6a1cea2ad3e6bbab (patch)
tree95c8b3989e97827b04297f0b64b5aabe021304ec /trackerlogic.c
parentdaaee855b251b1c5368b6a577a5fcba4bf7828c6 (diff)
Add stats about when peers renew their announces.
Diffstat (limited to 'trackerlogic.c')
-rw-r--r--trackerlogic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/trackerlogic.c b/trackerlogic.c
index 3d9ca5e..0aca287 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -91,6 +91,8 @@ ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer WANT_SYNC_PARAM(
91 return torrent; 91 return torrent;
92 } 92 }
93 base_pool = 1; 93 base_pool = 1;
94 if( torrent->peer_list->base < NOW )
95 torrent->peer_list->base = NOW;
94 } 96 }
95#endif 97#endif
96 98
@@ -125,6 +127,7 @@ ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer WANT_SYNC_PARAM(
125 case 1: default: 127 case 1: default:
126 torrent->peer_list->peer_count--; 128 torrent->peer_list->peer_count--;
127 mutex_bucket_unlock_by_hash( hash ); 129 mutex_bucket_unlock_by_hash( hash );
130 stats_issue_event( EVENT_RENEW, 0, i );
128 return torrent; 131 return torrent;
129 } 132 }
130 } 133 }
@@ -142,6 +145,7 @@ ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer WANT_SYNC_PARAM(
142 if( OT_FLAG( peer_dest ) & PEER_FLAG_COMPLETED ) 145 if( OT_FLAG( peer_dest ) & PEER_FLAG_COMPLETED )
143 OT_FLAG( peer ) |= PEER_FLAG_COMPLETED; 146 OT_FLAG( peer ) |= PEER_FLAG_COMPLETED;
144 147
148 stats_issue_event( EVENT_RENEW, 0, base_pool );
145 memmove( peer_dest, peer, sizeof( ot_peer ) ); 149 memmove( peer_dest, peer, sizeof( ot_peer ) );
146 } 150 }
147 151