jl777 7 years ago
parent
commit
97e4a0b01b
  1. 24
      iguana/exchanges/LP_network.c
  2. 4
      iguana/exchanges/stats.c

24
iguana/exchanges/LP_network.c

@ -447,24 +447,14 @@ void LP_commandQ_loop(void *ctx)
{
if ( ptr->responsesock >= 0 )
{
if ( (argjson= cJSON_Parse(ptr->msg)) != 0 )
if ( (result= cJSON_Parse(ptr->msg)) != 0 )
{
if ( (retstr= LP_command_process(ctx,"127.0.0.1",ptr->responsesock,argjson,(uint8_t *)ptr->msg,ptr->msglen,ptr->stats_JSONonly)) != 0 )
{
if ( (result= cJSON_Parse(retstr)) != 0 )
{
free(retstr);
retjson = cJSON_CreateObject();
jaddnum(retjson,"queueid",ptr->queueid);
jadd(retjson,"result",result);
jadd(retjson,"request",argjson);
retstr = jprint(retjson,1);
if ( (size= nn_send(ptr->responsesock,retstr,(int32_t)strlen(retstr),0)) <= 0 )
printf("error sending event\n");
}
free(retstr);
}
free_json(argjson);
retjson = cJSON_CreateObject();
jaddnum(retjson,"queueid",0);
jadd(retjson,"result",result);
retstr = jprint(retjson,1);
if ( (size= nn_send(ptr->responsesock,retstr,(int32_t)strlen(retstr),0)) <= 0 )
printf("error sending event\n");
}
}
}

4
iguana/exchanges/stats.c

@ -573,7 +573,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po
if ( IPC_ENDPOINT >= 0 && (queueid= juint(arg,"queueid")) > 0 )
{
buf = jprint(arg,0);
LP_queuecommand(&retstr,buf,IPC_ENDPOINT,-1,queueid);
LP_queuecommand(&retstr,buf,IPC_ENDPOINT,1,queueid);
free(buf);
retstr = clonestr("{\"result\":\"success\",\"status\":\"queued\"}");
} else retstr = stats_JSON(ctx,"127.0.0.1",-1,arg,remoteaddr,port);
@ -582,7 +582,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po
if ( IPC_ENDPOINT >= 0 && (queueid= juint(arg,"queueid")) > 0 )
{
buf = jprint(arg,0);
LP_queuecommand(&retstr,buf,IPC_ENDPOINT,-1,queueid);
LP_queuecommand(&retstr,buf,IPC_ENDPOINT,1,queueid);
free(buf);
} else retstr = stats_JSON(ctx,myipaddr,-1,arg,remoteaddr,port);
#endif

Loading…
Cancel
Save