diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-14 17:31:16 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-14 17:31:16 +0200 |
commit | 04e0eca0a0309a9c5eefcb8317f21fff603f9a59 (patch) | |
tree | b9773298e1b78caf11bba7498ca1b168518450fd | |
parent | cab821f253976a21a1ad5fcf05d9d5fe3b3100c1 (diff) |
Make the amount of random torrents a tunable
-rw-r--r-- | opentracker.c | 3 | ||||
-rw-r--r-- | trackerlogic.h | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/opentracker.c b/opentracker.c index 8e04907..8d56ed6 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -722,7 +722,8 @@ int main( int argc, char **argv ) { | |||
722 | trackerlogic_init( ); | 722 | trackerlogic_init( ); |
723 | 723 | ||
724 | #ifdef _DEBUG_RANDOMTORRENTS | 724 | #ifdef _DEBUG_RANDOMTORRENTS |
725 | trackerlogic_add_random_torrents(1024*1024*1); | 725 | fprintf(stderr, "DEBUG: Generating %zd random peers on random torrents. This may take a while. (Setting RANDOMTORRENTS in trackerlogic.h\n", RANDOMTORRENTS); |
726 | trackerlogic_add_random_torrents(RANDOMTORRENTS); | ||
726 | #endif | 727 | #endif |
727 | 728 | ||
728 | if( statefile ) | 729 | if( statefile ) |
diff --git a/trackerlogic.h b/trackerlogic.h index 7e6e8ad..e43fcdb 100644 --- a/trackerlogic.h +++ b/trackerlogic.h | |||
@@ -67,6 +67,10 @@ typedef struct { ot_ip6 address; int bits; } | |||
67 | #define OT_BUCKET_COUNT (1<<OT_BUCKET_COUNT_BITS) | 67 | #define OT_BUCKET_COUNT (1<<OT_BUCKET_COUNT_BITS) |
68 | #define OT_BUCKET_COUNT_SHIFT (32-OT_BUCKET_COUNT_BITS) | 68 | #define OT_BUCKET_COUNT_SHIFT (32-OT_BUCKET_COUNT_BITS) |
69 | 69 | ||
70 | /* if _DEBUG_RANDOMTORRENTS is set, this is the amount of torrents to create | ||
71 | on startup */ | ||
72 | #define RANDOMTORRENTS (1024*1024*1) | ||
73 | |||
70 | /* From opentracker.c */ | 74 | /* From opentracker.c */ |
71 | extern time_t g_now_seconds; | 75 | extern time_t g_now_seconds; |
72 | extern volatile int g_opentracker_running; | 76 | extern volatile int g_opentracker_running; |