diff options
author | erdgeist <> | 2010-08-13 12:47:15 +0000 |
---|---|---|
committer | erdgeist <> | 2010-08-13 12:47:15 +0000 |
commit | 8d025a174519d30f6904888ec4daaa19cce69c46 (patch) | |
tree | 0b0363911cbc92834da618663f94430184249749 | |
parent | 730d4bb6ae908f06ab57ec9a5fbc5330415868fe (diff) |
Tidy up sync proxy code
-rw-r--r-- | proxy.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 | ||
38 | ot_ip6 g_serverip; | 40 | ot_ip6 g_serverip; |
39 | uint16_t g_serverport = 9009; | 41 | uint16_t g_serverport = 9009; |
40 | uint32_t g_tracker_id; | 42 | uint32_t g_tracker_id; |
41 | char groupip_1[4] = { 224,0,23,5 }; | 43 | char 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 | ||
62 | enum { OT_SYNC_PEER = 0xbeef }; | 64 | enum { OT_SYNC_PEER }; |
63 | enum { FLAG_SERVERSOCKET = 1 }; | 65 | enum { 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; |