summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2010-08-13 12:47:15 +0000
committererdgeist <>2010-08-13 12:47:15 +0000
commit8d025a174519d30f6904888ec4daaa19cce69c46 (patch)
tree0b0363911cbc92834da618663f94430184249749
parent730d4bb6ae908f06ab57ec9a5fbc5330415868fe (diff)
Tidy up sync proxy code
-rw-r--r--proxy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/proxy.c b/proxy.c
index d5cbab6..a3cbad2 100644
--- a/proxy.c
+++ b/proxy.c
@@ -32,10 +32,12 @@
32#include "ot_mutex.h" 32#include "ot_mutex.h"
33#include "ot_stats.h" 33#include "ot_stats.h"
34 34
35#ifndef WANT_SYNC_LIVE
35#define WANT_SYNC_LIVE 36#define WANT_SYNC_LIVE
37#endif
36#include "ot_livesync.h" 38#include "ot_livesync.h"
37 39
38ot_ip6 g_serverip; 40ot_ip6 g_serverip;
39uint16_t g_serverport = 9009; 41uint16_t g_serverport = 9009;
40uint32_t g_tracker_id; 42uint32_t g_tracker_id;
41char groupip_1[4] = { 224,0,23,5 }; 43char groupip_1[4] = { 224,0,23,5 };
@@ -59,7 +61,7 @@ int g_self_pipe[2];
59/* So after each bucket wait 1 / OT_BUCKET_COUNT intervals */ 61/* So after each bucket wait 1 / OT_BUCKET_COUNT intervals */
60#define OT_SYNC_SLEEP ( ( ( OT_SYNC_INTERVAL_MINUTES ) * 60 * 1000000 ) / ( OT_BUCKET_COUNT ) ) 62#define OT_SYNC_SLEEP ( ( ( OT_SYNC_INTERVAL_MINUTES ) * 60 * 1000000 ) / ( OT_BUCKET_COUNT ) )
61 63
62enum { OT_SYNC_PEER = 0xbeef }; 64enum { OT_SYNC_PEER };
63enum { FLAG_SERVERSOCKET = 1 }; 65enum { FLAG_SERVERSOCKET = 1 };
64 66
65/* For incoming packets */ 67/* For incoming packets */
@@ -614,7 +616,7 @@ static void * streamsync_worker( void * args ) {
614 mem = 3 * ( 4 + 1 + 1 + 2 ) + ( count_one + count_two ) * 19 + count_def * 20 + 616 mem = 3 * ( 4 + 1 + 1 + 2 ) + ( count_one + count_two ) * 19 + count_def * 20 +
615 ( count_one + 2 * count_two + count_peers ) * 7; 617 ( count_one + 2 * count_two + count_peers ) * 7;
616 618
617 fprintf( stderr, "Mem: %d\n", mem ); 619 fprintf( stderr, "Mem: %zd\n", mem );
618 620
619 ptr = ptr_a = ptr_b = ptr_c = malloc( mem ); 621 ptr = ptr_a = ptr_b = ptr_c = malloc( mem );
620 if( !ptr ) goto unlock_continue; 622 if( !ptr ) goto unlock_continue;