diff options
author | erdgeist <> | 2006-12-15 22:07:33 +0000 |
---|---|---|
committer | erdgeist <> | 2006-12-15 22:07:33 +0000 |
commit | af147a1d147ce79636656b1b835230be29b6c3b9 (patch) | |
tree | 0b6ab9a874e50abaa3fdfc649a1b1ba0eb04e68d /trackerlogic.c | |
parent | 25e63d93d2d48d49799ec66f571b0457a3bd4345 (diff) |
Fixed mem leak, inmplemented mrtg_scrape
Diffstat (limited to 'trackerlogic.c')
-rw-r--r-- | trackerlogic.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/trackerlogic.c b/trackerlogic.c index 7b5b94a..b9f14f0 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
@@ -210,6 +210,10 @@ size_t return_peers_for_torrent( ot_torrent *torrent, unsigned long amount, char | |||
210 | off = 1 + ( off % ( peer_count - wert - 1 )); | 210 | off = 1 + ( off % ( peer_count - wert - 1 )); |
211 | wert += off; pool_offset += off; | 211 | wert += off; pool_offset += off; |
212 | 212 | ||
213 | // In some rare occasions random gets the last peer a round to early | ||
214 | // correct that and return last peer twice | ||
215 | if( wert >= peer_count ) { wert--; pool_offset--; } | ||
216 | |||
213 | while( pool_offset >= torrent->peer_list->peers[pool_index].size ) { | 217 | while( pool_offset >= torrent->peer_list->peers[pool_index].size ) { |
214 | pool_offset -= torrent->peer_list->peers[pool_index].size; | 218 | pool_offset -= torrent->peer_list->peers[pool_index].size; |
215 | pool_index++; | 219 | pool_index++; |