Browse Source

Read action codes from correct location and tell ot_stats the correct number of incoming peers.

dynamic-accesslists
erdgeist 16 years ago
parent
commit
1a40cebcbd
  1. 6
      ot_livesync.c

6
ot_livesync.c

@ -173,7 +173,9 @@ static void livesync_handle_peersync( ssize_t datalen ) { @@ -173,7 +173,9 @@ static void livesync_handle_peersync( ssize_t datalen ) {
off += sizeof( ot_hash ) + sizeof( ot_peer );
}
stats_issue_event(EVENT_SYNC, 0, datalen / ((ssize_t)sizeof( ot_hash ) + (ssize_t)sizeof( ot_peer )));
stats_issue_event(EVENT_SYNC, 0,
(datalen - sizeof( g_tracker_id ) - sizeof( uint32_t ) ) /
((ssize_t)sizeof( ot_hash ) + (ssize_t)sizeof( ot_peer )));
}
#ifdef WANT_SYNC_SCRAPE
@ -386,7 +388,7 @@ static void * livesync_worker( void * args ) { @@ -386,7 +388,7 @@ static void * livesync_worker( void * args ) {
continue;
}
switch( uint32_read_big( (char*)g_inbuffer ) ) {
switch( uint32_read_big( sizeof( g_tracker_id ) + (char*)g_inbuffer ) ) {
case OT_SYNC_PEER:
livesync_handle_peersync( datalen );
break;

Loading…
Cancel
Save