diff options
author | erdgeist <> | 2008-10-28 01:27:22 +0000 |
---|---|---|
committer | erdgeist <> | 2008-10-28 01:27:22 +0000 |
commit | daaee855b251b1c5368b6a577a5fcba4bf7828c6 (patch) | |
tree | e453fbc06cb15b6b970f33abbff9d3bc8240b8ad | |
parent | 55d03b9a1b7344fde72b5474734ea53ff766d1d4 (diff) |
Whitespace fixes
-rw-r--r-- | opentracker.c | 16 | ||||
-rw-r--r-- | ot_accesslist.c | 2 | ||||
-rw-r--r-- | ot_accesslist.h | 2 | ||||
-rw-r--r-- | ot_clean.c | 2 | ||||
-rw-r--r-- | ot_clean.h | 2 | ||||
-rw-r--r-- | ot_fullscrape.c | 2 | ||||
-rw-r--r-- | ot_fullscrape.h | 2 | ||||
-rw-r--r-- | ot_http.c | 4 | ||||
-rw-r--r-- | ot_http.h | 2 | ||||
-rw-r--r-- | ot_iovec.c | 4 | ||||
-rw-r--r-- | ot_iovec.h | 2 | ||||
-rw-r--r-- | ot_livesync.c | 8 | ||||
-rw-r--r-- | ot_livesync.h | 8 | ||||
-rw-r--r-- | ot_mutex.c | 10 | ||||
-rw-r--r-- | ot_mutex.h | 2 | ||||
-rw-r--r-- | ot_stats.c | 14 | ||||
-rw-r--r-- | ot_stats.h | 4 | ||||
-rw-r--r-- | ot_sync.c | 2 | ||||
-rw-r--r-- | ot_sync.h | 2 | ||||
-rw-r--r-- | ot_udp.c | 2 | ||||
-rw-r--r-- | ot_udp.h | 2 | ||||
-rw-r--r-- | ot_vector.c | 2 | ||||
-rw-r--r-- | ot_vector.h | 2 | ||||
-rw-r--r-- | scan_urlencoded_query.c | 2 | ||||
-rw-r--r-- | scan_urlencoded_query.h | 4 | ||||
-rw-r--r-- | trackerlogic.c | 8 | ||||
-rw-r--r-- | trackerlogic.h | 2 |
27 files changed, 57 insertions, 57 deletions
diff --git a/opentracker.c b/opentracker.c index a831b06..f76c042 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -220,7 +220,7 @@ static void server_mainloop( ) { | |||
220 | } | 220 | } |
221 | 221 | ||
222 | livesync_ticker(); | 222 | livesync_ticker(); |
223 | 223 | ||
224 | /* See if we need to move our pools */ | 224 | /* See if we need to move our pools */ |
225 | if( NOW != ot_last_clean_time ) { | 225 | if( NOW != ot_last_clean_time ) { |
226 | ot_last_clean_time = NOW; | 226 | ot_last_clean_time = NOW; |
@@ -254,10 +254,10 @@ static int64_t ot_try_bind( char ip[4], uint16_t port, PROTO_FLAG proto ) { | |||
254 | 254 | ||
255 | io_wantread( s ); | 255 | io_wantread( s ); |
256 | 256 | ||
257 | #ifdef _DEBUG | 257 | #ifdef _DEBUG |
258 | fputs( " success.\n", stderr); | 258 | fputs( " success.\n", stderr); |
259 | #endif | 259 | #endif |
260 | 260 | ||
261 | return s; | 261 | return s; |
262 | } | 262 | } |
263 | 263 | ||
@@ -291,19 +291,19 @@ int parse_configfile( char * config_filename ) { | |||
291 | int bound = 0; | 291 | int bound = 0; |
292 | 292 | ||
293 | accesslist_filehandle = fopen( config_filename, "r" ); | 293 | accesslist_filehandle = fopen( config_filename, "r" ); |
294 | 294 | ||
295 | if( accesslist_filehandle == NULL ) { | 295 | if( accesslist_filehandle == NULL ) { |
296 | fprintf( stderr, "Warning: Can't open config file: %s.", config_filename ); | 296 | fprintf( stderr, "Warning: Can't open config file: %s.", config_filename ); |
297 | return 0; | 297 | return 0; |
298 | } | 298 | } |
299 | 299 | ||
300 | while( fgets( inbuf, sizeof(inbuf), accesslist_filehandle ) ) { | 300 | while( fgets( inbuf, sizeof(inbuf), accesslist_filehandle ) ) { |
301 | char *newl; | 301 | char *newl; |
302 | char *p = inbuf; | 302 | char *p = inbuf; |
303 | 303 | ||
304 | /* Skip white spaces */ | 304 | /* Skip white spaces */ |
305 | while(isspace(*p)) ++p; | 305 | while(isspace(*p)) ++p; |
306 | 306 | ||
307 | /* Ignore comments and empty lines */ | 307 | /* Ignore comments and empty lines */ |
308 | if((*p=='#')||(*p=='\n')||(*p==0)) continue; | 308 | if((*p=='#')||(*p=='\n')||(*p==0)) continue; |
309 | 309 | ||
@@ -360,7 +360,7 @@ int parse_configfile( char * config_filename ) { | |||
360 | fprintf( stderr, "Unhandled line in config file: %s\n", inbuf ); | 360 | fprintf( stderr, "Unhandled line in config file: %s\n", inbuf ); |
361 | continue; | 361 | continue; |
362 | parse_error: | 362 | parse_error: |
363 | fprintf( stderr, "Parse error in config file: %s\n", inbuf); | 363 | fprintf( stderr, "Parse error in config file: %s\n", inbuf); |
364 | } | 364 | } |
365 | fclose( accesslist_filehandle ); | 365 | fclose( accesslist_filehandle ); |
366 | return bound; | 366 | return bound; |
@@ -371,7 +371,7 @@ int main( int argc, char **argv ) { | |||
371 | char serverip[4] = {0,0,0,0}, tmpip[4]; | 371 | char serverip[4] = {0,0,0,0}, tmpip[4]; |
372 | int bound = 0, scanon = 1; | 372 | int bound = 0, scanon = 1; |
373 | uint16_t tmpport; | 373 | uint16_t tmpport; |
374 | 374 | ||
375 | while( scanon ) { | 375 | while( scanon ) { |
376 | switch( getopt( argc, argv, ":i:p:A:P:d:r:s:f:v" | 376 | switch( getopt( argc, argv, ":i:p:A:P:d:r:s:f:v" |
377 | #ifdef WANT_ACCESSLIST_BLACK | 377 | #ifdef WANT_ACCESSLIST_BLACK |
diff --git a/ot_accesslist.c b/ot_accesslist.c index 91e99b3..59d3659 100644 --- a/ot_accesslist.c +++ b/ot_accesslist.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
diff --git a/ot_accesslist.h b/ot_accesslist.h index 5d163c2..8d87710 100644 --- a/ot_accesslist.h +++ b/ot_accesslist.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_ACCESSLIST_H__ | 6 | #ifndef __OT_ACCESSLIST_H__ |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_CLEAN_H__ | 6 | #ifndef __OT_CLEAN_H__ |
diff --git a/ot_fullscrape.c b/ot_fullscrape.c index abd8cee..fa17d61 100644 --- a/ot_fullscrape.c +++ b/ot_fullscrape.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifdef WANT_FULLSCRAPE | 6 | #ifdef WANT_FULLSCRAPE |
diff --git a/ot_fullscrape.h b/ot_fullscrape.h index 4025be1..3f5dc7d 100644 --- a/ot_fullscrape.h +++ b/ot_fullscrape.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_FULLSCRAPE_H__ | 6 | #ifndef __OT_FULLSCRAPE_H__ |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
@@ -335,7 +335,7 @@ static ssize_t http_handle_stats( const int64 client_socket, char *data, char *d | |||
335 | stats_deliver( client_socket, mode ); | 335 | stats_deliver( client_socket, mode ); |
336 | return -2; | 336 | return -2; |
337 | } | 337 | } |
338 | 338 | ||
339 | /* Simple stats can be answerred immediately */ | 339 | /* Simple stats can be answerred immediately */ |
340 | if( !( l = return_stats_for_tracker( static_outbuf + SUCCESS_HTTP_HEADER_LENGTH, mode, 0 ) ) ) HTTPERROR_500; | 340 | if( !( l = return_stats_for_tracker( static_outbuf + SUCCESS_HTTP_HEADER_LENGTH, mode, 0 ) ) ) HTTPERROR_500; |
341 | 341 | ||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_HTTP_H__ | 6 | #ifndef __OT_HTTP_H__ |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
@@ -24,7 +24,7 @@ void *iovec_increase( int *iovec_entries, struct iovec **iovector, size_t new_al | |||
24 | if( !new_ptr ) | 24 | if( !new_ptr ) |
25 | return NULL; | 25 | return NULL; |
26 | ((*iovector)[*iovec_entries]).iov_base = new_ptr; | 26 | ((*iovector)[*iovec_entries]).iov_base = new_ptr; |
27 | ((*iovector)[*iovec_entries]).iov_len = new_alloc; | 27 | ((*iovector)[*iovec_entries]).iov_len = new_alloc; |
28 | ++*iovec_entries; | 28 | ++*iovec_entries; |
29 | return new_ptr; | 29 | return new_ptr; |
30 | } | 30 | } |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_IOVEC_H__ | 6 | #ifndef __OT_IOVEC_H__ |
diff --git a/ot_livesync.c b/ot_livesync.c index 92c947c..3e27c9a 100644 --- a/ot_livesync.c +++ b/ot_livesync.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
@@ -54,7 +54,7 @@ void livesync_init( ) { | |||
54 | 54 | ||
55 | pthread_create( &thread_id, NULL, livesync_worker, NULL ); | 55 | pthread_create( &thread_id, NULL, livesync_worker, NULL ); |
56 | } | 56 | } |
57 | 57 | ||
58 | void livesync_deinit() { | 58 | void livesync_deinit() { |
59 | pthread_cancel( thread_id ); | 59 | pthread_cancel( thread_id ); |
60 | } | 60 | } |
@@ -106,7 +106,7 @@ void livesync_tell( ot_hash * const info_hash, const ot_peer * const peer, const | |||
106 | stuck when there's not enough traffic to fill udp packets fast | 106 | stuck when there's not enough traffic to fill udp packets fast |
107 | enough */ | 107 | enough */ |
108 | void livesync_ticker( ) { | 108 | void livesync_ticker( ) { |
109 | if( ( g_now - livesync_lastpacket_time > LIVESYNC_MAXDELAY) && | 109 | if( ( g_now - livesync_lastpacket_time > LIVESYNC_MAXDELAY) && |
110 | ( livesync_outbuffer_pos > livesync_outbuffer_start + sizeof( g_tracker_id ) ) ) | 110 | ( livesync_outbuffer_pos > livesync_outbuffer_start + sizeof( g_tracker_id ) ) ) |
111 | livesync_issuepacket(); | 111 | livesync_issuepacket(); |
112 | } | 112 | } |
@@ -115,7 +115,7 @@ static void * livesync_worker( void * args ) { | |||
115 | uint8_t in_ip[4]; uint16_t in_port; | 115 | uint8_t in_ip[4]; uint16_t in_port; |
116 | ssize_t datalen; | 116 | ssize_t datalen; |
117 | int off; | 117 | int off; |
118 | 118 | ||
119 | args = args; | 119 | args = args; |
120 | 120 | ||
121 | while( 1 ) { | 121 | while( 1 ) { |
diff --git a/ot_livesync.h b/ot_livesync.h index 27070d6..8c3c96d 100644 --- a/ot_livesync.h +++ b/ot_livesync.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_LIVESYNC_H__ | 6 | #ifndef __OT_LIVESYNC_H__ |
@@ -24,7 +24,7 @@ | |||
24 | 0x001c 0x02 peer's port | 24 | 0x001c 0x02 peer's port |
25 | 0x0020 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 ) | 25 | 0x0020 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 ) |
26 | ]* | 26 | ]* |
27 | 27 | ||
28 | For N == 24: (aggregator syncs) | 28 | For N == 24: (aggregator syncs) |
29 | 0x0000 0x04 id of tracker instance | 29 | 0x0000 0x04 id of tracker instance |
30 | [ 0x0004 0x14 info_hash | 30 | [ 0x0004 0x14 info_hash |
@@ -34,7 +34,7 @@ | |||
34 | 0x0021 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 ) | 34 | 0x0021 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 ) |
35 | ]+ | 35 | ]+ |
36 | ]* | 36 | ]* |
37 | 37 | ||
38 | 38 | ||
39 | */ | 39 | */ |
40 | 40 | ||
@@ -61,7 +61,7 @@ void handle_livesync( const int64 serversocket ); | |||
61 | 61 | ||
62 | #else | 62 | #else |
63 | 63 | ||
64 | /* If no syncing is required, save calling code from #ifdef | 64 | /* If no syncing is required, save calling code from #ifdef |
65 | constructions */ | 65 | constructions */ |
66 | 66 | ||
67 | #define livesync_init() | 67 | #define livesync_init() |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
@@ -93,7 +93,7 @@ void mutex_bucket_unlock( int bucket ) { | |||
93 | bucket_remove( bucket ); | 93 | bucket_remove( bucket ); |
94 | pthread_cond_broadcast( &bucket_being_unlocked ); | 94 | pthread_cond_broadcast( &bucket_being_unlocked ); |
95 | pthread_mutex_unlock( &bucket_mutex ); | 95 | pthread_mutex_unlock( &bucket_mutex ); |
96 | } | 96 | } |
97 | 97 | ||
98 | void mutex_bucket_unlock_by_hash( ot_hash *hash ) { | 98 | void mutex_bucket_unlock_by_hash( ot_hash *hash ) { |
99 | unsigned char *local_hash = hash[0]; | 99 | unsigned char *local_hash = hash[0]; |
@@ -134,7 +134,7 @@ int mutex_workqueue_pushtask( int64 socket, ot_tasktype tasktype ) { | |||
134 | } | 134 | } |
135 | 135 | ||
136 | /* Skip to end of list */ | 136 | /* Skip to end of list */ |
137 | tmptask = &tasklist; | 137 | tmptask = &tasklist; |
138 | while( *tmptask ) | 138 | while( *tmptask ) |
139 | tmptask = &(*tmptask)->next; | 139 | tmptask = &(*tmptask)->next; |
140 | *tmptask = task; | 140 | *tmptask = task; |
@@ -267,7 +267,7 @@ int mutex_workqueue_pushresult( ot_taskid taskid, int iovec_entries, struct iove | |||
267 | MTX_DBG( "pushresult unlocks.\n" ); | 267 | MTX_DBG( "pushresult unlocks.\n" ); |
268 | pthread_mutex_unlock( &tasklist_mutex ); | 268 | pthread_mutex_unlock( &tasklist_mutex ); |
269 | MTX_DBG( "pushresult unlocked.\n" ); | 269 | MTX_DBG( "pushresult unlocked.\n" ); |
270 | 270 | ||
271 | /* Indicate whether the worker has to throw away results */ | 271 | /* Indicate whether the worker has to throw away results */ |
272 | return task ? 0 : -1; | 272 | return task ? 0 : -1; |
273 | } | 273 | } |
@@ -291,7 +291,7 @@ int64 mutex_workqueue_popresult( int *iovec_entries, struct iovec ** iovec ) { | |||
291 | *iovec_entries = (*task)->iovec_entries; | 291 | *iovec_entries = (*task)->iovec_entries; |
292 | *iovec = (*task)->iovec; | 292 | *iovec = (*task)->iovec; |
293 | socket = (*task)->socket; | 293 | socket = (*task)->socket; |
294 | 294 | ||
295 | *task = (*task)->next; | 295 | *task = (*task)->next; |
296 | free( ptask ); | 296 | free( ptask ); |
297 | } | 297 | } |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_MUTEX_H__ | 6 | #ifndef __OT_MUTEX_H__ |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
@@ -85,7 +85,7 @@ static int stats_shift_down_network_count( stats_network_node **node, int depth, | |||
85 | int i, rest = 0; | 85 | int i, rest = 0; |
86 | if( !*node ) return 0; | 86 | if( !*node ) return 0; |
87 | 87 | ||
88 | if( ++depth == STATS_NETWORK_NODE_MAXDEPTH ) | 88 | if( ++depth == STATS_NETWORK_NODE_MAXDEPTH ) |
89 | for( i=0; i<STATS_NETWORK_NODE_COUNT; ++i ) { | 89 | for( i=0; i<STATS_NETWORK_NODE_COUNT; ++i ) { |
90 | rest += ((*node)->counters[i]>>=shift); | 90 | rest += ((*node)->counters[i]>>=shift); |
91 | return rest; | 91 | return rest; |
@@ -487,7 +487,7 @@ static size_t stats_torrents_mrtg( char * reply ) | |||
487 | 487 | ||
488 | static size_t stats_httperrors_txt ( char * reply ) { | 488 | static size_t stats_httperrors_txt ( char * reply ) { |
489 | return sprintf( reply, "302 RED %llu\n400 ... %llu\n400 PAR %llu\n400 COM %llu\n403 IP %llu\n404 INV %llu\n500 SRV %llu\n", | 489 | return sprintf( reply, "302 RED %llu\n400 ... %llu\n400 PAR %llu\n400 COM %llu\n403 IP %llu\n404 INV %llu\n500 SRV %llu\n", |
490 | ot_failed_request_counts[0], ot_failed_request_counts[1], ot_failed_request_counts[2], | 490 | ot_failed_request_counts[0], ot_failed_request_counts[1], ot_failed_request_counts[2], |
491 | ot_failed_request_counts[3], ot_failed_request_counts[4], ot_failed_request_counts[5], | 491 | ot_failed_request_counts[3], ot_failed_request_counts[4], ot_failed_request_counts[5], |
492 | ot_failed_request_counts[6] ); | 492 | ot_failed_request_counts[6] ); |
493 | } | 493 | } |
@@ -545,10 +545,10 @@ static void stats_make( int *iovec_entries, struct iovec **iovector, ot_tasktype | |||
545 | *iovector = NULL; | 545 | *iovector = NULL; |
546 | if( !( r = iovec_increase( iovec_entries, iovector, OT_STATS_TMPSIZE ) ) ) | 546 | if( !( r = iovec_increase( iovec_entries, iovector, OT_STATS_TMPSIZE ) ) ) |
547 | return; | 547 | return; |
548 | 548 | ||
549 | switch( mode & TASK_TASK_MASK ) { | 549 | switch( mode & TASK_TASK_MASK ) { |
550 | case TASK_STATS_TORRENTS: r += stats_torrents_mrtg( r ); break; | 550 | case TASK_STATS_TORRENTS: r += stats_torrents_mrtg( r ); break; |
551 | case TASK_STATS_PEERS: r += stats_peers_mrtg( r ); break; | 551 | case TASK_STATS_PEERS: r += stats_peers_mrtg( r ); break; |
552 | case TASK_STATS_SLASH24S: r += stats_slash24s_txt( r, 25, 16 ); break; | 552 | case TASK_STATS_SLASH24S: r += stats_slash24s_txt( r, 25, 16 ); break; |
553 | case TASK_STATS_TOP10: r += stats_top10_txt( r ); break; | 553 | case TASK_STATS_TOP10: r += stats_top10_txt( r ); break; |
554 | case TASK_STATS_MEMORY: r += stats_vector_usage( r ); break; | 554 | case TASK_STATS_MEMORY: r += stats_vector_usage( r ); break; |
@@ -609,9 +609,9 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uint32_t event_ | |||
609 | static void * stats_worker( void * args ) { | 609 | static void * stats_worker( void * args ) { |
610 | int iovec_entries; | 610 | int iovec_entries; |
611 | struct iovec *iovector; | 611 | struct iovec *iovector; |
612 | 612 | ||
613 | args = args; | 613 | args = args; |
614 | 614 | ||
615 | while( 1 ) { | 615 | while( 1 ) { |
616 | ot_tasktype tasktype = TASK_STATS; | 616 | ot_tasktype tasktype = TASK_STATS; |
617 | ot_taskid taskid = mutex_workqueue_poptask( &tasktype ); | 617 | ot_taskid taskid = mutex_workqueue_poptask( &tasktype ); |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_STATS_H__ | 6 | #ifndef __OT_STATS_H__ |
@@ -30,7 +30,7 @@ enum { | |||
30 | CODE_HTTPERROR_403_IP, | 30 | CODE_HTTPERROR_403_IP, |
31 | CODE_HTTPERROR_404, | 31 | CODE_HTTPERROR_404, |
32 | CODE_HTTPERROR_500, | 32 | CODE_HTTPERROR_500, |
33 | 33 | ||
34 | CODE_HTTPERROR_COUNT | 34 | CODE_HTTPERROR_COUNT |
35 | }; | 35 | }; |
36 | 36 | ||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_SYNC_H__ | 6 | #ifndef __OT_SYNC_H__ |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_UDP_H__ | 6 | #ifndef __OT_UDP_H__ |
diff --git a/ot_vector.c b/ot_vector.c index e60b27c..0e65d09 100644 --- a/ot_vector.c +++ b/ot_vector.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
diff --git a/ot_vector.h b/ot_vector.h index ec053fa..32ec26a 100644 --- a/ot_vector.h +++ b/ot_vector.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_VECTOR_H__ | 6 | #ifndef __OT_VECTOR_H__ |
diff --git a/scan_urlencoded_query.c b/scan_urlencoded_query.c index e84fbfd..2bf957e 100644 --- a/scan_urlencoded_query.c +++ b/scan_urlencoded_query.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #include "scan.h" | 6 | #include "scan.h" |
diff --git a/scan_urlencoded_query.h b/scan_urlencoded_query.h index a253aaa..86ce93e 100644 --- a/scan_urlencoded_query.h +++ b/scan_urlencoded_query.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __SCAN_URLENCODED_QUERY_H__ | 6 | #ifndef __SCAN_URLENCODED_QUERY_H__ |
7 | #define __SCAN_URLENCODED_QUERY_H__ | 7 | #define __SCAN_URLENCODED_QUERY_H__ |
8 | 8 | ||
diff --git a/trackerlogic.c b/trackerlogic.c index 8e33695..3d9ca5e 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | /* System */ | 6 | /* System */ |
@@ -277,7 +277,7 @@ size_t remove_peer_from_torrent( ot_hash *hash, ot_peer *peer, char *reply, PROT | |||
277 | ot_torrent *torrent = binary_search( hash, torrents_list->data, torrents_list->size, sizeof( ot_torrent ), OT_HASH_COMPARE_SIZE, &exactmatch ); | 277 | ot_torrent *torrent = binary_search( hash, torrents_list->data, torrents_list->size, sizeof( ot_torrent ), OT_HASH_COMPARE_SIZE, &exactmatch ); |
278 | ot_peerlist *peer_list; | 278 | ot_peerlist *peer_list; |
279 | 279 | ||
280 | #ifdef WANT_SYNC_LIVE | 280 | #ifdef WANT_SYNC_LIVE |
281 | if( proto != FLAG_MCA ) | 281 | if( proto != FLAG_MCA ) |
282 | livesync_tell( hash, peer, PEER_FLAG_STOPPED ); | 282 | livesync_tell( hash, peer, PEER_FLAG_STOPPED ); |
283 | #endif | 283 | #endif |
@@ -294,7 +294,7 @@ size_t remove_peer_from_torrent( ot_hash *hash, ot_peer *peer, char *reply, PROT | |||
294 | ((uint32_t*)reply)[3] = ((uint32_t*)reply)[4] = 0; | 294 | ((uint32_t*)reply)[3] = ((uint32_t*)reply)[4] = 0; |
295 | return (size_t)20; | 295 | return (size_t)20; |
296 | } | 296 | } |
297 | 297 | ||
298 | if( proto == FLAG_MCA ) | 298 | if( proto == FLAG_MCA ) |
299 | return 0; | 299 | return 0; |
300 | } | 300 | } |
@@ -343,7 +343,7 @@ int trackerlogic_init( const char * const serverdir ) { | |||
343 | 343 | ||
344 | srandom( time(NULL) ); | 344 | srandom( time(NULL) ); |
345 | g_tracker_id = random(); | 345 | g_tracker_id = random(); |
346 | 346 | ||
347 | /* Initialise background worker threads */ | 347 | /* Initialise background worker threads */ |
348 | mutex_init( ); | 348 | mutex_init( ); |
349 | clean_init( ); | 349 | clean_init( ); |
diff --git a/trackerlogic.h b/trackerlogic.h index 4461a85..3d7bcb5 100644 --- a/trackerlogic.h +++ b/trackerlogic.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> | 1 | /* This software was written by Dirk Engling <erdgeist@erdgeist.org> |
2 | It is considered beerware. Prost. Skol. Cheers or whatever. | 2 | It is considered beerware. Prost. Skol. Cheers or whatever. |
3 | 3 | ||
4 | $id$ */ | 4 | $id$ */ |
5 | 5 | ||
6 | #ifndef __OT_TRACKERLOGIC_H__ | 6 | #ifndef __OT_TRACKERLOGIC_H__ |