summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2009-02-03 17:00:51 +0000
committererdgeist <>2009-02-03 17:00:51 +0000
commit1a40cebcbde3919704f148e1f41985fb36bedc9b (patch)
tree6cfdcc1dabb7e9663796ba01e0acee91f34cde7e
parent4c0d5c1c084e007973cfa52085e2168ab651d985 (diff)
Read action codes from correct location and tell ot_stats the correct number of incoming peers.
-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;