|
|
@ -524,12 +524,12 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po |
|
|
|
#ifdef FROM_MARKETMAKER |
|
|
|
if ( strcmp(remoteaddr,"127.0.0.1") == 0 || LP_valid_remotemethod(argjson) > 0 ) |
|
|
|
{ |
|
|
|
buf = jprint(argjson,0); |
|
|
|
LP_queuecommand(&retstr,buf,-1,1); |
|
|
|
free(buf); |
|
|
|
while ( retstr == 0 ) |
|
|
|
usleep(10000); |
|
|
|
//if ( (retstr= stats_JSON(ctx,myipaddr,-1,argjson,remoteaddr,port)) != 0 )
|
|
|
|
//buf = jprint(argjson,0);
|
|
|
|
//LP_queuecommand(&retstr,buf,-1,1);
|
|
|
|
//free(buf);
|
|
|
|
//while ( retstr == 0 )
|
|
|
|
// usleep(10000);
|
|
|
|
if ( (retstr= stats_JSON(ctx,myipaddr,-1,argjson,remoteaddr,port)) != 0 ) |
|
|
|
{ |
|
|
|
if ( (retitem= cJSON_Parse(retstr)) != 0 ) |
|
|
|
jaddi(retarray,retitem); |
|
|
@ -537,12 +537,12 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po |
|
|
|
} |
|
|
|
} else retstr = clonestr("{\"error\":\"invalid remote method\"}"); |
|
|
|
#else |
|
|
|
buf = jprint(argjson,0); |
|
|
|
LP_queuecommand(&retstr,buf,-1,1); |
|
|
|
free(buf); |
|
|
|
while ( retstr == 0 ) |
|
|
|
usleep(10000); |
|
|
|
//if ( (retstr= stats_JSON(ctx,myipaddr,-1,argjson,remoteaddr,port)) != 0 )
|
|
|
|
//buf = jprint(argjson,0);
|
|
|
|
//LP_queuecommand(&retstr,buf,-1,1);
|
|
|
|
//free(buf);
|
|
|
|
//while ( retstr == 0 )
|
|
|
|
// usleep(10000);
|
|
|
|
if ( (retstr= stats_JSON(ctx,myipaddr,-1,argjson,remoteaddr,port)) != 0 ) |
|
|
|
{ |
|
|
|
if ( (retitem= cJSON_Parse(retstr)) != 0 ) |
|
|
|
jaddi(retarray,retitem); |
|
|
@ -569,20 +569,20 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po |
|
|
|
#ifdef FROM_MARKETMAKER |
|
|
|
if ( strcmp(remoteaddr,"127.0.0.1") == 0 || LP_valid_remotemethod(arg) > 0 ) |
|
|
|
{ |
|
|
|
buf = jprint(arg,0); |
|
|
|
LP_queuecommand(&retstr,buf,-1,1); |
|
|
|
free(buf); |
|
|
|
while ( retstr == 0 ) |
|
|
|
usleep(10000); |
|
|
|
//retstr = stats_JSON(ctx,myipaddr,-1,arg,remoteaddr,port);
|
|
|
|
//buf = jprint(arg,0);
|
|
|
|
//LP_queuecommand(&retstr,buf,-1,1);
|
|
|
|
//free(buf);
|
|
|
|
//while ( retstr == 0 )
|
|
|
|
// usleep(10000);
|
|
|
|
retstr = stats_JSON(ctx,"127.0.0.1",-1,arg,remoteaddr,port); |
|
|
|
} else retstr = clonestr("{\"error\":\"invalid remote method\"}"); |
|
|
|
#else |
|
|
|
buf = jprint(arg,0); |
|
|
|
LP_queuecommand(&retstr,buf,-1,1); |
|
|
|
free(buf); |
|
|
|
while ( retstr == 0 ) |
|
|
|
usleep(10000); |
|
|
|
//retstr = stats_JSON(ctx,myipaddr,-1,arg,remoteaddr,port);
|
|
|
|
//buf = jprint(arg,0);
|
|
|
|
//LP_queuecommand(&retstr,buf,-1,1);
|
|
|
|
//free(buf);
|
|
|
|
//while ( retstr == 0 )
|
|
|
|
// usleep(10000);
|
|
|
|
retstr = stats_JSON(ctx,myipaddr,-1,arg,remoteaddr,port); |
|
|
|
#endif |
|
|
|
} |
|
|
|
free_json(argjson); |
|
|
|