summaryrefslogtreecommitdiff
path: root/ot_livesync.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_livesync.c')
-rw-r--r--ot_livesync.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ot_livesync.c b/ot_livesync.c
index 3f54a4d..45d4160 100644
--- a/ot_livesync.c
+++ b/ot_livesync.c
@@ -173,7 +173,9 @@ static void livesync_handle_peersync( ssize_t datalen ) {
173 off += sizeof( ot_hash ) + sizeof( ot_peer ); 173 off += sizeof( ot_hash ) + sizeof( ot_peer );
174 } 174 }
175 175
176 stats_issue_event(EVENT_SYNC, 0, datalen / ((ssize_t)sizeof( ot_hash ) + (ssize_t)sizeof( ot_peer ))); 176 stats_issue_event(EVENT_SYNC, 0,
177 (datalen - sizeof( g_tracker_id ) - sizeof( uint32_t ) ) /
178 ((ssize_t)sizeof( ot_hash ) + (ssize_t)sizeof( ot_peer )));
177} 179}
178 180
179#ifdef WANT_SYNC_SCRAPE 181#ifdef WANT_SYNC_SCRAPE
@@ -386,7 +388,7 @@ static void * livesync_worker( void * args ) {
386 continue; 388 continue;
387 } 389 }
388 390
389 switch( uint32_read_big( (char*)g_inbuffer ) ) { 391 switch( uint32_read_big( sizeof( g_tracker_id ) + (char*)g_inbuffer ) ) {
390 case OT_SYNC_PEER: 392 case OT_SYNC_PEER:
391 livesync_handle_peersync( datalen ); 393 livesync_handle_peersync( datalen );
392 break; 394 break;