diff options
author | denis <> | 2007-02-01 22:34:23 +0000 |
---|---|---|
committer | denis <> | 2007-02-01 22:34:23 +0000 |
commit | 929d375b973b2a30fbc75ea31595aa3f042d5cc2 (patch) | |
tree | bc69f58b4cf6940b8ac3385faf9e80b682d16d71 | |
parent | 7ab634b6f6947fce4acf4bb4e6b40255240981e2 (diff) |
make the interval with random an average value around the real value and not additional
-rw-r--r-- | trackerlogic.h | 5 |
1 files 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; | |||
25 | #define OT_CLIENT_REQUEST_INTERVAL (60*30) | 25 | #define OT_CLIENT_REQUEST_INTERVAL (60*30) |
26 | #define OT_CLIENT_REQUEST_VARIATION (60*3) | 26 | #define OT_CLIENT_REQUEST_VARIATION (60*3) |
27 | 27 | ||
28 | #define OT_TORRENT_TIMEOUT ((60*60*24)/OT_POOLS_TIMEOUT) | 28 | #define OT_TORRENT_TIMEOUT_HOURS 24 |
29 | #define OT_TORRENT_TIMEOUT ((60*60*OT_TORRENT_TIMEOUT_HOURS)/OT_POOLS_TIMEOUT) | ||
29 | 30 | ||
30 | #define OT_CLIENT_REQUEST_INTERVAL_RANDOM ( OT_CLIENT_REQUEST_INTERVAL + (int)( random( ) % OT_CLIENT_REQUEST_VARIATION ) ) | 31 | #define OT_CLIENT_REQUEST_INTERVAL_RANDOM ( OT_CLIENT_REQUEST_INTERVAL - OT_CLIENT_REQUEST_VARIATION/2 + (int)( random( ) % OT_CLIENT_REQUEST_VARIATION ) ) |
31 | 32 | ||
32 | /* We maintain a list of 256 pointers to sorted list of ot_torrent structs | 33 | /* We maintain a list of 256 pointers to sorted list of ot_torrent structs |
33 | Sort key is, of course, its hash */ | 34 | Sort key is, of course, its hash */ |