From 929d375b973b2a30fbc75ea31595aa3f042d5cc2 Mon Sep 17 00:00:00 2001 From: denis <> Date: Thu, 1 Feb 2007 22:34:23 +0000 Subject: make the interval with random an average value around the real value and not additional --- trackerlogic.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trackerlogic.h b/trackerlogic.h index 74440f4..66e8c2a 100644 --- a/trackerlogic.h +++ b/trackerlogic.h @@ -25,9 +25,10 @@ typedef time_t ot_time; #define OT_CLIENT_REQUEST_INTERVAL (60*30) #define OT_CLIENT_REQUEST_VARIATION (60*3) -#define OT_TORRENT_TIMEOUT ((60*60*24)/OT_POOLS_TIMEOUT) +#define OT_TORRENT_TIMEOUT_HOURS 24 +#define OT_TORRENT_TIMEOUT ((60*60*OT_TORRENT_TIMEOUT_HOURS)/OT_POOLS_TIMEOUT) -#define OT_CLIENT_REQUEST_INTERVAL_RANDOM ( OT_CLIENT_REQUEST_INTERVAL + (int)( random( ) % OT_CLIENT_REQUEST_VARIATION ) ) +#define OT_CLIENT_REQUEST_INTERVAL_RANDOM ( OT_CLIENT_REQUEST_INTERVAL - OT_CLIENT_REQUEST_VARIATION/2 + (int)( random( ) % OT_CLIENT_REQUEST_VARIATION ) ) /* We maintain a list of 256 pointers to sorted list of ot_torrent structs Sort key is, of course, its hash */ -- cgit v1.2.3