mirror of
				git://erdgeist.org/opentracker
				synced 2025-11-04 11:53:22 +08:00 
			
		
		
		
	Allow opentracker to start with a random set of torrents for debugging purposes
This commit is contained in:
		
							parent
							
								
									3a6d99dd46
								
							
						
					
					
						commit
						2eeae0a65a
					
				
							
								
								
									
										1
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								Makefile
									
									
									
									
									
								
							@ -43,6 +43,7 @@ FEATURES+=-DWANT_FULLSCRAPE
 | 
			
		||||
#FEATURES+=-DWANT_ARC4RANDOM
 | 
			
		||||
 | 
			
		||||
#FEATURES+=-D_DEBUG_HTTPERROR
 | 
			
		||||
#FEATURES+=-D_DEBUG_RANDOMTORRENTS
 | 
			
		||||
 | 
			
		||||
OPTS_debug=-D_DEBUG -g -ggdb # -pg -fprofile-arcs -ftest-coverage
 | 
			
		||||
OPTS_production=-O3
 | 
			
		||||
 | 
			
		||||
@ -726,6 +726,10 @@ int main( int argc, char **argv ) {
 | 
			
		||||
  /* Init all sub systems. This call may fail with an exit() */
 | 
			
		||||
  trackerlogic_init( );
 | 
			
		||||
 | 
			
		||||
#ifdef _DEBUG_RANDOMTORRENTS
 | 
			
		||||
  trackerlogic_add_random_torrents(1024*1024*1);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  if( statefile )
 | 
			
		||||
    load_state( statefile );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -517,6 +517,7 @@ size_t   peer_size_from_peer6(ot_peer6 *peer) {
 | 
			
		||||
  return OT_PEER_SIZE4;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef _DEBUG_RANDOMTORRENTS
 | 
			
		||||
void trackerlogic_add_random_torrents(size_t amount) {
 | 
			
		||||
  struct ot_workstruct ws;
 | 
			
		||||
  memset( &ws, 0, sizeof(ws) );
 | 
			
		||||
@ -538,7 +539,7 @@ void trackerlogic_add_random_torrents(size_t amount) {
 | 
			
		||||
  free(ws.inbuf);
 | 
			
		||||
  free(ws.outbuf);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void exerr( char * message ) {
 | 
			
		||||
  fprintf( stderr, "%s\n", message );
 | 
			
		||||
 | 
			
		||||
@ -190,7 +190,9 @@ size_t  remove_peer_from_torrent( PROTO_FLAG proto, struct ot_workstruct *ws );
 | 
			
		||||
size_t  return_tcp_scrape_for_torrent( ot_hash const *hash_list, int amount, char *reply );
 | 
			
		||||
size_t  return_udp_scrape_for_torrent( ot_hash const hash, char *reply );
 | 
			
		||||
void    add_torrent_from_saved_state( ot_hash const hash, ot_time base, size_t down_count );
 | 
			
		||||
#ifdef _DEBUG_RANDOMTORRENTS
 | 
			
		||||
void    trackerlogic_add_random_torrents(size_t amount);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* torrent iterator */
 | 
			
		||||
void iterate_all_torrents( int (*for_each)( ot_torrent* torrent, uintptr_t data ), uintptr_t data );
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user