summaryrefslogtreecommitdiff
path: root/ot_mutex.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2009-03-04 14:35:21 +0000
committerDirk Engling <erdgeist@erdgeist.org>2009-03-04 14:35:21 +0000
commitabe840d52997e6d47610ca6adf5d6e357bf9cbc5 (patch)
treef2d5a2375e1b49c6e6cdfd53c10968986222f39b /ot_mutex.c
parente6b16afb19cf398fbaee5f52e2190b5cf796fd28 (diff)
downloadopentracker-abe840d52997e6d47610ca6adf5d6e357bf9cbc5.tar.gz
opentracker-abe840d52997e6d47610ca6adf5d6e357bf9cbc5.zip
Add a stat option the count bucket stalls
Add an iterator for all torrents. It's slower but for stats it's okay. Move some stats collection stuff to the new iterator. More to come. Start a "report all stats" page. Start fixing the code to identify "busy" networks. Add the concept of hosts allowed to proxy. Add a parser for the X-Forwarded-For: HTTP header. Clean up HTTP Header handling code. (Remove some left overs of now vanished sync code).
Diffstat (limited to 'ot_mutex.c')
-rw-r--r--ot_mutex.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ot_mutex.c b/ot_mutex.c
index 6a8e25a..9ae5e14 100644
--- a/ot_mutex.c
+++ b/ot_mutex.c
@@ -18,6 +18,7 @@
/* Opentracker */
#include "trackerlogic.h"
#include "ot_mutex.h"
+#include "ot_stats.h"
/* #define MTX_DBG( STRING ) fprintf( stderr, STRING ) */
#define MTX_DBG( STRING )
@@ -47,8 +48,10 @@ static int bucket_check( int bucket ) {
/* See, if bucket is already locked */
for( i=0; i<bucket_locklist_count; ++i )
- if( bucket_locklist[ i ] == bucket )
+ if( bucket_locklist[ i ] == bucket ) {
+ stats_issue_event( EVENT_BUCKET_LOCKED, 0, 0 );
return -1;
+ }
return 0;
}
@@ -330,4 +333,4 @@ void mutex_deinit( ) {
byte_zero( all_torrents, sizeof( all_torrents ) );
}
-const char *g_version_mutex_c = "$Source: /home/cvsroot/opentracker/ot_mutex.c,v $: $Revision: 1.21 $\n";
+const char *g_version_mutex_c = "$Source: /home/cvsroot/opentracker/ot_mutex.c,v $: $Revision: 1.22 $\n";