|
|
@ -443,7 +443,22 @@ void LP_commandQ_loop(void *ctx) |
|
|
|
portable_mutex_lock(&LP_commandQmutex); |
|
|
|
DL_DELETE(LP_commandQ,ptr); |
|
|
|
portable_mutex_unlock(&LP_commandQmutex); |
|
|
|
if ( (argjson= cJSON_Parse(ptr->msg)) != 0 ) |
|
|
|
if ( ptr->stats_JSONonly < 0 ) |
|
|
|
{ |
|
|
|
if ( ptr->responsesock >= 0 ) |
|
|
|
{ |
|
|
|
if ( (result= cJSON_Parse(ptr->msg)) != 0 ) |
|
|
|
{ |
|
|
|
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)+1,0)) <= 0 ) |
|
|
|
printf("error sending event\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if ( (argjson= 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 ) |
|
|
|
{ |
|
|
@ -489,9 +504,7 @@ void LP_queuecommand(char **retstrp,char *buf,int32_t responsesock,int32_t stats |
|
|
|
if ( (ptr->retstrp= retstrp) != 0 ) |
|
|
|
*retstrp = 0; |
|
|
|
ptr->msglen = msglen; |
|
|
|
if ( (ptr->queueid= queueid) != 0 && responsesock < 0 ) |
|
|
|
ptr->responsesock = IPC_ENDPOINT; |
|
|
|
else ptr->responsesock = responsesock; |
|
|
|
ptr->responsesock = responsesock; |
|
|
|
ptr->stats_JSONonly = stats_JSONonly; |
|
|
|
memcpy(ptr->msg,buf,msglen); |
|
|
|
DL_APPEND(LP_commandQ,ptr); |
|
|
|