]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
Simplify includes
authorerdgeist <>
Mon, 3 Dec 2007 00:52:05 +0000 (00:52 +0000)
committererdgeist <>
Mon, 3 Dec 2007 00:52:05 +0000 (00:52 +0000)
ot_clean.c
ot_clean.h
ot_iovec.h
ot_mutex.c
ot_sync.c
ot_vector.h

index e8d2841c903265761bf1c4e3acf7efe76b7fce23..308c8488042da3b57a7eb1de7d5f0592b46135ee 100644 (file)
@@ -5,9 +5,11 @@
 #include <stdlib.h>
 #include <string.h>
 #include <pthread.h>
+#include <sys/uio.h>
 
 /* Libowfat */
 #include "byte.h"
+#include "io.h"
 
 /* Opentracker */
 #include "trackerlogic.h"
index 73dcd10f60e8e2168de282e3e6ea3cc73403eee2..8ad1ae8c5ca21a998f788aa56d2e8f35049cdac8 100644 (file)
@@ -4,8 +4,6 @@
 #ifndef __OT_CLEAN_H__
 #define __OT_CLEAN_H__
 
-#include "trackerlogic.h"
-
 void clean_init( void );
 void clean_deinit( void );
 
index d52a167658a721b216f302b686a5795caeb6a80c..d7105bdf0567bdfc2f22c7bb11de8dfeb66f99c2 100644 (file)
@@ -4,8 +4,6 @@
 #ifndef __OT_IOVEC_H__
 #define __OT_IOVEC_H__
 
-#include <sys/uio.h>
-
 void  *iovec_increase( int *iovec_entries, struct iovec **iovector, size_t new_alloc );
 void   iovec_fixlast( int *iovec_entries, struct iovec **iovector, void *last_ptr );
 void   iovec_free( int *iovec_entries, struct iovec **iovector );
index fb632d7f1541a293bee917d6fb6b491eeb89190a..6bcaf1267c4ad816eff4851867ad8be3faed9652 100644 (file)
@@ -6,9 +6,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/mman.h>
+#include <sys/uio.h>
 
 /* Libowfat */
 #include "byte.h"
+#include "io.h"
 
 /* Opentracker */
 #include "trackerlogic.h"
index 6964098adb29810e2ff3718ee68f86320455f644..ac1664dc2c9371f362e23899074b161776aa6730 100644 (file)
--- a/ot_sync.c
+++ b/ot_sync.c
@@ -4,6 +4,7 @@
 /* System */
 #include <sys/types.h>
 #include <sys/mman.h>
+#include <sys/uio.h>
 #include <stdio.h>
 #include <string.h>
 #include <pthread.h>
 /* Libowfat */
 #include "scan.h"
 #include "byte.h"
+#include "io.h"
 
 /* Opentracker */
 #include "trackerlogic.h"
 #include "ot_mutex.h"
 #include "ot_sync.h"
+#include "ot_stats.h"
+#include "ot_iovec.h"
 
 #ifdef WANT_TRACKER_SYNC
 
@@ -25,9 +29,9 @@
    format: d4:syncd[..]ee
    [..]:   ( 20:01234567890abcdefghij16:XXXXYYYY )+
 */
-int add_changeset_to_tracker( ot_byte *data, size_t len ) {
+int add_changeset_to_tracker( uint8_t *data, size_t len ) {
   ot_hash    *hash;
-  ot_byte    *end = data + len;
+  uint8_t    *end = data + len;
   unsigned long      peer_count;
 
   /* We do know, that the string is \n terminated, so it cant
@@ -135,6 +139,7 @@ static void * sync_worker( void * args) {
     ot_tasktype tasktype = TASK_SYNC_OUT;
     ot_taskid   taskid   = mutex_workqueue_poptask( &tasktype );
     sync_make( &iovec_entries, &iovector );
+    stats_issue_event( EVENT_SYNC_OUT, 1, iovec_length( &iovec_entries, &iovector) );
     if( mutex_workqueue_pushresult( taskid, iovec_entries, iovector ) )
       iovec_free( &iovec_entries, &iovector );
   }
index 0f684887267e771ac200798b16ab1c83f2703014..ed235a3b63989087493aa3ecd64d0ca7b4426f05 100644 (file)
@@ -4,8 +4,6 @@
 #ifndef __OT_VECTOR_H__
 #define __OT_VECTOR_H__
 
-#include "trackerlogic.h"
-
 /* These defines control vectors behaviour */
 #define OT_VECTOR_MIN_MEMBERS   4
 #define OT_VECTOR_GROW_RATIO    8