]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
Whitespace fixes
authorerdgeist <>
Tue, 28 Oct 2008 01:27:22 +0000 (01:27 +0000)
committererdgeist <>
Tue, 28 Oct 2008 01:27:22 +0000 (01:27 +0000)
27 files changed:
opentracker.c
ot_accesslist.c
ot_accesslist.h
ot_clean.c
ot_clean.h
ot_fullscrape.c
ot_fullscrape.h
ot_http.c
ot_http.h
ot_iovec.c
ot_iovec.h
ot_livesync.c
ot_livesync.h
ot_mutex.c
ot_mutex.h
ot_stats.c
ot_stats.h
ot_sync.c
ot_sync.h
ot_udp.c
ot_udp.h
ot_vector.c
ot_vector.h
scan_urlencoded_query.c
scan_urlencoded_query.h
trackerlogic.c
trackerlogic.h

index a831b061d1bc1a239eb0cda8392a67537cb9d10b..f76c042edc8dbf35e7f3a8543244a4bf9c9460fc 100644 (file)
@@ -220,7 +220,7 @@ static void server_mainloop( ) {
     }
 
     livesync_ticker();
-    
+
     /* See if we need to move our pools */
     if( NOW != ot_last_clean_time ) {
       ot_last_clean_time = NOW;
@@ -254,10 +254,10 @@ static int64_t ot_try_bind( char ip[4], uint16_t port, PROTO_FLAG proto ) {
 
   io_wantread( s );
 
-#ifdef _DEBUG 
+#ifdef _DEBUG
   fputs( " success.\n", stderr);
 #endif
-  
+
   return s;
 }
 
@@ -291,19 +291,19 @@ int parse_configfile( char * config_filename ) {
   int     bound = 0;
 
   accesslist_filehandle = fopen( config_filename, "r" );
-    
+
   if( accesslist_filehandle == NULL ) {
     fprintf( stderr, "Warning: Can't open config file: %s.", config_filename );
     return 0;
   }
-  
+
   while( fgets( inbuf, sizeof(inbuf), accesslist_filehandle ) ) {
     char *newl;
     char *p = inbuf;
 
     /* Skip white spaces */
     while(isspace(*p)) ++p;
-    
+
     /* Ignore comments and empty lines */
     if((*p=='#')||(*p=='\n')||(*p==0)) continue;
 
@@ -360,7 +360,7 @@ int parse_configfile( char * config_filename ) {
       fprintf( stderr, "Unhandled line in config file: %s\n", inbuf );
     continue;
   parse_error:
-      fprintf( stderr, "Parse error in config file: %s\n", inbuf);    
+      fprintf( stderr, "Parse error in config file: %s\n", inbuf);
   }
   fclose( accesslist_filehandle );
   return bound;
@@ -371,7 +371,7 @@ int main( int argc, char **argv ) {
   char serverip[4] = {0,0,0,0}, tmpip[4];
   int bound = 0, scanon = 1;
   uint16_t tmpport;
-  
+
 while( scanon ) {
     switch( getopt( argc, argv, ":i:p:A:P:d:r:s:f:v"
 #ifdef WANT_ACCESSLIST_BLACK
index 91e99b314a47afd0e6717c7165f9d2979c2ecaf1..59d3659a975ad4fbacfe5c0b2bd7769186f5e330 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 /* System */
index 5d163c21ca5df38a43f92d594053a370c4cdf073..8d87710e7ed046bf4cbc1f1c2d8552038e7a4653 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_ACCESSLIST_H__
index f8bb6375b1d7eed734f1c41fec8621f211ef09ff..7ac86a8503efe4b49f9efd62ab00250efbe19fde 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 /* System */
index a06891ea57deb34d45c5aefe822a566184a56e6c..7fefddbb8cb035dbf695dd91a6066dc103847692 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_CLEAN_H__
index abd8ceec5ad85060e193badc620ed843d6fab374..fa17d61af60a7873d61a7a3a843930416369341d 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifdef WANT_FULLSCRAPE
index 4025be1dff9c15321c79d678165de176296e1264..3f5dc7dd098a8276bd40f8fda5012b8bb60f5ae0 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_FULLSCRAPE_H__
index 54564c758a2efe6d79e8963e892869fc1d918d6a..09e93dd258253d53e032c8de1baf43ff1acdcd88 100644 (file)
--- a/ot_http.c
+++ b/ot_http.c
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 /* System */
@@ -335,7 +335,7 @@ static ssize_t http_handle_stats( const int64 client_socket, char *data, char *d
     stats_deliver( client_socket, mode );
     return -2;
   }
-  
+
   /* Simple stats can be answerred immediately */
   if( !( l = return_stats_for_tracker( static_outbuf + SUCCESS_HTTP_HEADER_LENGTH, mode, 0 ) ) ) HTTPERROR_500;
 
index 35700424b719b28d086cffb50157bf1509353c8e..4d97769900987b7e84669f4ee1d6ab6f6c2ef345 100644 (file)
--- a/ot_http.h
+++ b/ot_http.h
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_HTTP_H__
index 70e017cc136dd36e2f1de0fa15c810b0240f45b1..8f9c480ba1f4132ddf16bd85bf873f524c81b4c5 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 /* System */
@@ -24,7 +24,7 @@ void *iovec_increase( int *iovec_entries, struct iovec **iovector, size_t new_al
   if( !new_ptr )
     return NULL;
   ((*iovector)[*iovec_entries]).iov_base = new_ptr;
-  ((*iovector)[*iovec_entries]).iov_len  = new_alloc;  
+  ((*iovector)[*iovec_entries]).iov_len  = new_alloc;
   ++*iovec_entries;
   return new_ptr;
 }
index 02373e77364a896ae46c07384bcdb7b5dc0807ca..d5cf158cbef13c00afd861ebf519f9b856d3bcbf 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_IOVEC_H__
index 92c947c435625afd3fcfa1a29ddecdbfafc61072..3e27c9af4160ac56e8a924e8336130c2ace18158 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
  It is considered beerware. Prost. Skol. Cheers or whatever.
+
  $id$ */
 
 /* System */
@@ -54,7 +54,7 @@ void livesync_init( ) {
 
   pthread_create( &thread_id, NULL, livesync_worker, NULL );
 }
-       
+
 void livesync_deinit() {
   pthread_cancel( thread_id );
 }
@@ -106,7 +106,7 @@ void livesync_tell( ot_hash * const info_hash, const ot_peer * const peer, const
  stuck when there's not enough traffic to fill udp packets fast
  enough */
 void livesync_ticker( ) {
-       if( ( g_now - livesync_lastpacket_time > LIVESYNC_MAXDELAY) &&
+  if( ( g_now - livesync_lastpacket_time > LIVESYNC_MAXDELAY) &&
       ( livesync_outbuffer_pos > livesync_outbuffer_start + sizeof( g_tracker_id ) ) )
     livesync_issuepacket();
 }
@@ -115,7 +115,7 @@ static void * livesync_worker( void * args ) {
   uint8_t in_ip[4]; uint16_t in_port;
   ssize_t datalen;
   int off;
-  
+
   args = args;
 
   while( 1 ) {
index 27070d64437adfe6822c88bb128a7777bccecc3a..8c3c96da2138519548d845f7445312ab7270539f 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
  It is considered beerware. Prost. Skol. Cheers or whatever.
+
  $id$ */
 
 #ifndef __OT_LIVESYNC_H__
@@ -24,7 +24,7 @@
     0x001c 0x02 peer's port
     0x0020 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 )
   ]*
+
   For N == 24: (aggregator syncs)
     0x0000 0x04 id of tracker instance
   [ 0x0004 0x14 info_hash
@@ -34,7 +34,7 @@
       0x0021 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 )
     ]+
   ]*
+
 
  */
 
@@ -61,7 +61,7 @@ void handle_livesync( const int64 serversocket );
 
 #else
 
-/* If no syncing is required, save calling code from #ifdef 
+/* If no syncing is required, save calling code from #ifdef
    constructions */
 
 #define livesync_init()
index fb24fe7099921c64c1f3d3f4fbddd772cc885588..a7b583b4822d54606c723804ae63d465cd747f66 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 /* System */
@@ -93,7 +93,7 @@ void mutex_bucket_unlock( int bucket ) {
   bucket_remove( bucket );
   pthread_cond_broadcast( &bucket_being_unlocked );
   pthread_mutex_unlock( &bucket_mutex );
-}   
+}
 
 void mutex_bucket_unlock_by_hash( ot_hash *hash ) {
   unsigned char *local_hash = hash[0];
@@ -134,7 +134,7 @@ int mutex_workqueue_pushtask( int64 socket, ot_tasktype tasktype ) {
   }
 
   /* Skip to end of list */
-  tmptask = &tasklist; 
+  tmptask = &tasklist;
   while( *tmptask )
     tmptask = &(*tmptask)->next;
   *tmptask = task;
@@ -267,7 +267,7 @@ int mutex_workqueue_pushresult( ot_taskid taskid, int iovec_entries, struct iove
   MTX_DBG( "pushresult unlocks.\n" );
   pthread_mutex_unlock( &tasklist_mutex );
   MTX_DBG( "pushresult unlocked.\n" );
-  
+
   /* Indicate whether the worker has to throw away results */
   return task ? 0 : -1;
 }
@@ -291,7 +291,7 @@ int64 mutex_workqueue_popresult( int *iovec_entries, struct iovec ** iovec ) {
     *iovec_entries = (*task)->iovec_entries;
     *iovec         = (*task)->iovec;
     socket         = (*task)->socket;
-    
+
     *task = (*task)->next;
     free( ptask );
   }
index 5865765a07d6ce3472642c12e1ae1938b709ad40..c05bdfef7127c37cf720526b59df7f761cde8170 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_MUTEX_H__
index 30eb9148e1a07b96cda93b2dcb0b09ede3273a96..5d9dab26168113e4f11890a265b8789e6c3a4a54 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 /* System */
@@ -85,7 +85,7 @@ static int stats_shift_down_network_count( stats_network_node **node, int depth,
   int i, rest = 0;
   if( !*node ) return 0;
 
-  if( ++depth == STATS_NETWORK_NODE_MAXDEPTH ) 
+  if( ++depth == STATS_NETWORK_NODE_MAXDEPTH )
     for( i=0; i<STATS_NETWORK_NODE_COUNT; ++i ) {
       rest += ((*node)->counters[i]>>=shift);
     return rest;
@@ -487,7 +487,7 @@ static size_t stats_torrents_mrtg( char * reply )
 
 static size_t stats_httperrors_txt ( char * reply ) {
   return sprintf( reply, "302 RED %llu\n400 ... %llu\n400 PAR %llu\n400 COM %llu\n403 IP  %llu\n404 INV %llu\n500 SRV %llu\n",
-  ot_failed_request_counts[0], ot_failed_request_counts[1], ot_failed_request_counts[2], 
+  ot_failed_request_counts[0], ot_failed_request_counts[1], ot_failed_request_counts[2],
   ot_failed_request_counts[3], ot_failed_request_counts[4], ot_failed_request_counts[5],
   ot_failed_request_counts[6] );
 }
@@ -545,10 +545,10 @@ static void stats_make( int *iovec_entries, struct iovec **iovector, ot_tasktype
   *iovector      = NULL;
   if( !( r = iovec_increase( iovec_entries, iovector, OT_STATS_TMPSIZE ) ) )
     return;
-  
+
   switch( mode & TASK_TASK_MASK ) {
     case TASK_STATS_TORRENTS:    r += stats_torrents_mrtg( r );             break;
-    case TASK_STATS_PEERS:       r += stats_peers_mrtg( r );                break;      
+    case TASK_STATS_PEERS:       r += stats_peers_mrtg( r );                break;
     case TASK_STATS_SLASH24S:    r += stats_slash24s_txt( r, 25, 16 );      break;
     case TASK_STATS_TOP10:       r += stats_top10_txt( r );                 break;
     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_
 static void * stats_worker( void * args ) {
   int iovec_entries;
   struct iovec *iovector;
-  
+
   args = args;
-  
+
   while( 1 ) {
     ot_tasktype tasktype = TASK_STATS;
     ot_taskid   taskid   = mutex_workqueue_poptask( &tasktype );
index 064fb3610c750a24acad87795d5ad9761aca085f..a21251b87df1dd882aae59bcba27bf4a4246afbb 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_STATS_H__
@@ -30,7 +30,7 @@ enum {
   CODE_HTTPERROR_403_IP,
   CODE_HTTPERROR_404,
   CODE_HTTPERROR_500,
-  
+
   CODE_HTTPERROR_COUNT
 };
 
index 4beb60dfab7ad2c9e7ea0e86012bf20cc27f98de..cd66a46d783d49859b330781f5d490ac17461391 100644 (file)
--- a/ot_sync.c
+++ b/ot_sync.c
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 /* System */
index ae54e6702738b026c62cb95ec09533a77f34b540..81d4d22d2b427d29ad9293839185906ebba9055e 100644 (file)
--- a/ot_sync.h
+++ b/ot_sync.h
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_SYNC_H__
index 1688d69ae25bb4f15203ce8bf0a7375e2c73ed59..db8dfbdfe4267469fb6abfd555ba3cbe57754130 100644 (file)
--- a/ot_udp.c
+++ b/ot_udp.c
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 /* System */
index 364c9d0a87c4dbd74537c46f652686459240cb71..c5f3959acb698227fe17cba9ee6e0d2521d770cc 100644 (file)
--- a/ot_udp.h
+++ b/ot_udp.h
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_UDP_H__
index e60b27c4f1709edfac090883f190a22ced516a17..0e65d09efe7af374946d846d76c6e8938b7aedc7 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 /* System */
index ec053fadcba7532e9ce66664e19c177328b3afa7..32ec26a194197bba449624ff9b1da9ed77d48d2a 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_VECTOR_H__
index e84fbfde48ad5ad3896480876b7a336cf0e64d32..2bf957ee06271d57bb136d6c131876aba7d27ec4 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #include "scan.h"
index a253aaa7e5d79bcc77efaf1ef3f2e4f581f2f86d..86ce93e430f51dc49eed40628f67249716432921 100644 (file)
@@ -1,8 +1,8 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
-   
+
 #ifndef __SCAN_URLENCODED_QUERY_H__
 #define __SCAN_URLENCODED_QUERY_H__
 
index 8e3369571bfbac8d36941d48f5d8ab8f3aa8f33b..3d9ca5e6e56418725cb4225e53c97a15ba52d227 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 /* System */
@@ -277,7 +277,7 @@ size_t remove_peer_from_torrent( ot_hash *hash, ot_peer *peer, char *reply, PROT
   ot_torrent  *torrent = binary_search( hash, torrents_list->data, torrents_list->size, sizeof( ot_torrent ), OT_HASH_COMPARE_SIZE, &exactmatch );
   ot_peerlist *peer_list;
 
-#ifdef WANT_SYNC_LIVE  
+#ifdef WANT_SYNC_LIVE
   if( proto != FLAG_MCA )
     livesync_tell( hash, peer, PEER_FLAG_STOPPED );
 #endif
@@ -294,7 +294,7 @@ size_t remove_peer_from_torrent( ot_hash *hash, ot_peer *peer, char *reply, PROT
       ((uint32_t*)reply)[3] = ((uint32_t*)reply)[4] = 0;
       return (size_t)20;
     }
-    
+
     if( proto == FLAG_MCA )
       return 0;
   }
@@ -343,7 +343,7 @@ int trackerlogic_init( const char * const serverdir ) {
 
   srandom( time(NULL) );
   g_tracker_id = random();
-  
+
   /* Initialise background worker threads */
   mutex_init( );
   clean_init( );
index 4461a852a7fc4349d2b8deafbe31f4eb45d163a9..3d7bcb5c2beb8c7d4845e78e9f6cd3ca5338dc54 100644 (file)
@@ -1,6 +1,6 @@
 /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
    It is considered beerware. Prost. Skol. Cheers or whatever.
-   
+
    $id$ */
 
 #ifndef __OT_TRACKERLOGIC_H__