Skip to content

Commit daaee85

Browse files
author
erdgeist
committed
Whitespace fixes
1 parent 55d03b9 commit daaee85

27 files changed

+57
-57
lines changed

opentracker.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static void server_mainloop( ) {
220220
}
221221

222222
livesync_ticker();
223-
223+
224224
/* See if we need to move our pools */
225225
if( NOW != ot_last_clean_time ) {
226226
ot_last_clean_time = NOW;
@@ -254,10 +254,10 @@ static int64_t ot_try_bind( char ip[4], uint16_t port, PROTO_FLAG proto ) {
254254

255255
io_wantread( s );
256256

257-
#ifdef _DEBUG
257+
#ifdef _DEBUG
258258
fputs( " success.\n", stderr);
259259
#endif
260-
260+
261261
return s;
262262
}
263263

@@ -291,19 +291,19 @@ int parse_configfile( char * config_filename ) {
291291
int bound = 0;
292292

293293
accesslist_filehandle = fopen( config_filename, "r" );
294-
294+
295295
if( accesslist_filehandle == NULL ) {
296296
fprintf( stderr, "Warning: Can't open config file: %s.", config_filename );
297297
return 0;
298298
}
299-
299+
300300
while( fgets( inbuf, sizeof(inbuf), accesslist_filehandle ) ) {
301301
char *newl;
302302
char *p = inbuf;
303303

304304
/* Skip white spaces */
305305
while(isspace(*p)) ++p;
306-
306+
307307
/* Ignore comments and empty lines */
308308
if((*p=='#')||(*p=='\n')||(*p==0)) continue;
309309

@@ -360,7 +360,7 @@ int parse_configfile( char * config_filename ) {
360360
fprintf( stderr, "Unhandled line in config file: %s\n", inbuf );
361361
continue;
362362
parse_error:
363-
fprintf( stderr, "Parse error in config file: %s\n", inbuf);
363+
fprintf( stderr, "Parse error in config file: %s\n", inbuf);
364364
}
365365
fclose( accesslist_filehandle );
366366
return bound;
@@ -371,7 +371,7 @@ int main( int argc, char **argv ) {
371371
char serverip[4] = {0,0,0,0}, tmpip[4];
372372
int bound = 0, scanon = 1;
373373
uint16_t tmpport;
374-
374+
375375
while( scanon ) {
376376
switch( getopt( argc, argv, ":i:p:A:P:d:r:s:f:v"
377377
#ifdef WANT_ACCESSLIST_BLACK

ot_accesslist.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
/* System */

ot_accesslist.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_ACCESSLIST_H__

ot_clean.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
/* System */

ot_clean.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_CLEAN_H__

ot_fullscrape.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifdef WANT_FULLSCRAPE

ot_fullscrape.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_FULLSCRAPE_H__

ot_http.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
/* System */
@@ -335,7 +335,7 @@ static ssize_t http_handle_stats( const int64 client_socket, char *data, char *d
335335
stats_deliver( client_socket, mode );
336336
return -2;
337337
}
338-
338+
339339
/* Simple stats can be answerred immediately */
340340
if( !( l = return_stats_for_tracker( static_outbuf + SUCCESS_HTTP_HEADER_LENGTH, mode, 0 ) ) ) HTTPERROR_500;
341341

ot_http.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_HTTP_H__

ot_iovec.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
/* System */
@@ -24,7 +24,7 @@ void *iovec_increase( int *iovec_entries, struct iovec **iovector, size_t new_al
2424
if( !new_ptr )
2525
return NULL;
2626
((*iovector)[*iovec_entries]).iov_base = new_ptr;
27-
((*iovector)[*iovec_entries]).iov_len = new_alloc;
27+
((*iovector)[*iovec_entries]).iov_len = new_alloc;
2828
++*iovec_entries;
2929
return new_ptr;
3030
}

ot_iovec.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_IOVEC_H__

ot_livesync.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
/* System */
@@ -54,7 +54,7 @@ void livesync_init( ) {
5454

5555
pthread_create( &thread_id, NULL, livesync_worker, NULL );
5656
}
57-
57+
5858
void livesync_deinit() {
5959
pthread_cancel( thread_id );
6060
}
@@ -106,7 +106,7 @@ void livesync_tell( ot_hash * const info_hash, const ot_peer * const peer, const
106106
stuck when there's not enough traffic to fill udp packets fast
107107
enough */
108108
void livesync_ticker( ) {
109-
if( ( g_now - livesync_lastpacket_time > LIVESYNC_MAXDELAY) &&
109+
if( ( g_now - livesync_lastpacket_time > LIVESYNC_MAXDELAY) &&
110110
( livesync_outbuffer_pos > livesync_outbuffer_start + sizeof( g_tracker_id ) ) )
111111
livesync_issuepacket();
112112
}
@@ -115,7 +115,7 @@ static void * livesync_worker( void * args ) {
115115
uint8_t in_ip[4]; uint16_t in_port;
116116
ssize_t datalen;
117117
int off;
118-
118+
119119
args = args;
120120

121121
while( 1 ) {

ot_livesync.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_LIVESYNC_H__
@@ -24,7 +24,7 @@
2424
0x001c 0x02 peer's port
2525
0x0020 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 )
2626
]*
27-
27+
2828
For N == 24: (aggregator syncs)
2929
0x0000 0x04 id of tracker instance
3030
[ 0x0004 0x14 info_hash
@@ -34,7 +34,7 @@
3434
0x0021 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 )
3535
]+
3636
]*
37-
37+
3838
3939
*/
4040

@@ -61,7 +61,7 @@ void handle_livesync( const int64 serversocket );
6161

6262
#else
6363

64-
/* If no syncing is required, save calling code from #ifdef
64+
/* If no syncing is required, save calling code from #ifdef
6565
constructions */
6666

6767
#define livesync_init()

ot_mutex.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
/* System */
@@ -93,7 +93,7 @@ void mutex_bucket_unlock( int bucket ) {
9393
bucket_remove( bucket );
9494
pthread_cond_broadcast( &bucket_being_unlocked );
9595
pthread_mutex_unlock( &bucket_mutex );
96-
}
96+
}
9797

9898
void mutex_bucket_unlock_by_hash( ot_hash *hash ) {
9999
unsigned char *local_hash = hash[0];
@@ -134,7 +134,7 @@ int mutex_workqueue_pushtask( int64 socket, ot_tasktype tasktype ) {
134134
}
135135

136136
/* Skip to end of list */
137-
tmptask = &tasklist;
137+
tmptask = &tasklist;
138138
while( *tmptask )
139139
tmptask = &(*tmptask)->next;
140140
*tmptask = task;
@@ -267,7 +267,7 @@ int mutex_workqueue_pushresult( ot_taskid taskid, int iovec_entries, struct iove
267267
MTX_DBG( "pushresult unlocks.\n" );
268268
pthread_mutex_unlock( &tasklist_mutex );
269269
MTX_DBG( "pushresult unlocked.\n" );
270-
270+
271271
/* Indicate whether the worker has to throw away results */
272272
return task ? 0 : -1;
273273
}
@@ -291,7 +291,7 @@ int64 mutex_workqueue_popresult( int *iovec_entries, struct iovec ** iovec ) {
291291
*iovec_entries = (*task)->iovec_entries;
292292
*iovec = (*task)->iovec;
293293
socket = (*task)->socket;
294-
294+
295295
*task = (*task)->next;
296296
free( ptask );
297297
}

ot_mutex.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_MUTEX_H__

ot_stats.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
/* System */
@@ -85,7 +85,7 @@ static int stats_shift_down_network_count( stats_network_node **node, int depth,
8585
int i, rest = 0;
8686
if( !*node ) return 0;
8787

88-
if( ++depth == STATS_NETWORK_NODE_MAXDEPTH )
88+
if( ++depth == STATS_NETWORK_NODE_MAXDEPTH )
8989
for( i=0; i<STATS_NETWORK_NODE_COUNT; ++i ) {
9090
rest += ((*node)->counters[i]>>=shift);
9191
return rest;
@@ -487,7 +487,7 @@ static size_t stats_torrents_mrtg( char * reply )
487487

488488
static size_t stats_httperrors_txt ( char * reply ) {
489489
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],
491491
ot_failed_request_counts[3], ot_failed_request_counts[4], ot_failed_request_counts[5],
492492
ot_failed_request_counts[6] );
493493
}
@@ -545,10 +545,10 @@ static void stats_make( int *iovec_entries, struct iovec **iovector, ot_tasktype
545545
*iovector = NULL;
546546
if( !( r = iovec_increase( iovec_entries, iovector, OT_STATS_TMPSIZE ) ) )
547547
return;
548-
548+
549549
switch( mode & TASK_TASK_MASK ) {
550550
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;
552552
case TASK_STATS_SLASH24S: r += stats_slash24s_txt( r, 25, 16 ); break;
553553
case TASK_STATS_TOP10: r += stats_top10_txt( r ); break;
554554
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_
609609
static void * stats_worker( void * args ) {
610610
int iovec_entries;
611611
struct iovec *iovector;
612-
612+
613613
args = args;
614-
614+
615615
while( 1 ) {
616616
ot_tasktype tasktype = TASK_STATS;
617617
ot_taskid taskid = mutex_workqueue_poptask( &tasktype );

ot_stats.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_STATS_H__
@@ -30,7 +30,7 @@ enum {
3030
CODE_HTTPERROR_403_IP,
3131
CODE_HTTPERROR_404,
3232
CODE_HTTPERROR_500,
33-
33+
3434
CODE_HTTPERROR_COUNT
3535
};
3636

ot_sync.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
/* System */

ot_sync.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_SYNC_H__

ot_udp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
/* System */

ot_udp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_UDP_H__

ot_vector.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
/* System */

ot_vector.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* This software was written by Dirk Engling <[email protected]>
22
It is considered beerware. Prost. Skol. Cheers or whatever.
3-
3+
44
$id$ */
55

66
#ifndef __OT_VECTOR_H__

0 commit comments

Comments
 (0)