Browse Source

Test without command mutex

dev
jl777 7 years ago
parent
commit
32252a0d7b
  1. 8
      iguana/exchanges/LP_nativeDEX.c
  2. 4
      iguana/exchanges/stats.c

8
iguana/exchanges/LP_nativeDEX.c

@ -250,7 +250,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,
if ( duplicate != 0 )
dup++;
else uniq++;
portable_mutex_lock(&LP_commandmutex);
//portable_mutex_lock(&LP_commandmutex);
if ( (LP_rand() % 100000) == 0 )
printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff);
if ( duplicate == 0 )
@ -340,7 +340,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,
free_json(argjson);
}
} //else printf("DUPLICATE.(%s)\n",(char *)ptr);
portable_mutex_unlock(&LP_commandmutex);
//portable_mutex_unlock(&LP_commandmutex);
if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && encrypted == 0 )
free(jsonstr);
return(retstr);
@ -414,13 +414,13 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int
Broadcaststr = 0;
if ( (argjson= cJSON_Parse(str)) != 0 )
{
portable_mutex_lock(&LP_commandmutex);
//portable_mutex_lock(&LP_commandmutex);
if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 )
{
if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 )
free(retstr);
}
portable_mutex_unlock(&LP_commandmutex);
//portable_mutex_unlock(&LP_commandmutex);
free_json(argjson);
}
free(str);

4
iguana/exchanges/stats.c

@ -683,9 +683,9 @@ void LP_rpc_processreq(void *_ptr)
if ( recvlen > 0 )
{
jsonflag = postflag = 0;
portable_mutex_lock(&LP_commandmutex);
//portable_mutex_lock(&LP_commandmutex);
retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,req->port);
portable_mutex_unlock(&LP_commandmutex);
//portable_mutex_unlock(&LP_commandmutex);
if ( filetype[0] != 0 )
{
static cJSON *mimejson; char *tmp,*typestr=0; long tmpsize;

Loading…
Cancel
Save