Browse Source

Test

etomic
jl777 7 years ago
parent
commit
6c76ad6eec
  1. 4
      iguana/exchanges/LP_nativeDEX.c
  2. 6
      iguana/exchanges/stats.c

4
iguana/exchanges/LP_nativeDEX.c

@ -29,7 +29,7 @@ struct LP_millistats
double lastmilli,millisum,threshold;
uint32_t count;
char name[64];
} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,stats_rpcloop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloop_statsBTC,LP_coinsloop_statsKMD,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats;
} LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloop_statsBTC,LP_coinsloop_statsKMD,LP_pubkeysloop_stats,LP_privkeysloop_stats,LP_swapsloop_stats;
void LP_millistats_update(struct LP_millistats *mp)
{
@ -838,7 +838,7 @@ void LP_reserved_msgs(void *ignore)
bits256 zero; int32_t flag; struct nn_pollfd pfd;
memset(zero.bytes,0,sizeof(zero));
strcpy(LP_reserved_msgs_stats.name,"LP_reserved_msgs");
LP_reserved_msgs_stats.threshold = 10.;
LP_reserved_msgs_stats.threshold = 20.;
while ( 1 )
{
LP_millistats_update(&LP_reserved_msgs_stats);

6
iguana/exchanges/stats.c

@ -728,7 +728,6 @@ void LP_rpc_processreq(void *_ptr)
}
free(space);
free(jsonbuf);
closesocket(sock);
}
void stats_rpcloop(void *args)
@ -755,7 +754,6 @@ void stats_rpcloop(void *args)
continue;
}
memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits));
//printf("remote RPC request from (%s) %x\n",remoteaddr,ipbits);
arg64 = ((uint64_t)ipbits << 32) | (sock & 0xffffffff);
arg64ptr = malloc(sizeof(arg64));
memcpy(arg64ptr,&arg64,sizeof(arg64));
@ -763,6 +761,10 @@ void stats_rpcloop(void *args)
{
LP_rpc_processreq((void *)&arg64);
free(arg64ptr);
closesocket(sock);
char remoteaddr[64];
expand_ipbits(remoteaddr,ipbits);
printf("finished RPC request from (%s) %x\n",remoteaddr,ipbits);
}
else if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_rpc_processreq,arg64ptr) != 0 )
{

Loading…
Cancel
Save