Browse Source

Make the amount of random torrents a tunable

master
Dirk Engling 3 months ago
parent
commit
04e0eca0a0
  1. 3
      opentracker.c
  2. 4
      trackerlogic.h

3
opentracker.c

@ -722,7 +722,8 @@ int main( int argc, char **argv ) { @@ -722,7 +722,8 @@ int main( int argc, char **argv ) {
trackerlogic_init( );
#ifdef _DEBUG_RANDOMTORRENTS
trackerlogic_add_random_torrents(1024*1024*1);
fprintf(stderr, "DEBUG: Generating %zd random peers on random torrents. This may take a while. (Setting RANDOMTORRENTS in trackerlogic.h\n", RANDOMTORRENTS);
trackerlogic_add_random_torrents(RANDOMTORRENTS);
#endif
if( statefile )

4
trackerlogic.h

@ -67,6 +67,10 @@ typedef struct { ot_ip6 address; int bits; } @@ -67,6 +67,10 @@ typedef struct { ot_ip6 address; int bits; }
#define OT_BUCKET_COUNT (1<<OT_BUCKET_COUNT_BITS)
#define OT_BUCKET_COUNT_SHIFT (32-OT_BUCKET_COUNT_BITS)
/* if _DEBUG_RANDOMTORRENTS is set, this is the amount of torrents to create
on startup */
#define RANDOMTORRENTS (1024*1024*1)
/* From opentracker.c */
extern time_t g_now_seconds;
extern volatile int g_opentracker_running;

Loading…
Cancel
Save