Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
1108243f1f
  1. 1
      iguana/iguana_rpc.c
  2. 6
      iguana/main.c

1
iguana/iguana_rpc.c

@ -34,6 +34,7 @@ char *sglue(GLUEARGS,char *agent,char *method)
{ {
if ( (retjson= cJSON_Parse(retstr)) != 0 ) if ( (retjson= cJSON_Parse(retstr)) != 0 )
{ {
if ( jobj(retjson,"tag") != 0 )
jdelete(retjson,"tag"); jdelete(retjson,"tag");
///printf("RPCret.(%s) n.%d\n",jprint(retjson,0),cJSON_GetArraySize(retjson)); ///printf("RPCret.(%s) n.%d\n",jprint(retjson,0),cJSON_GetArraySize(retjson));
result = cJSON_GetObjectItem(retjson,"result"); result = cJSON_GetObjectItem(retjson,"result");

6
iguana/main.c

@ -303,6 +303,8 @@ char *SuperNET_processJSON(struct supernet_info *myinfo,cJSON *json,char *remote
if ( retjsonstr != 0 ) if ( retjsonstr != 0 )
{ {
if ( (retjsonstr[0] == '{' || retjsonstr[0] == '[') && (retjson= cJSON_Parse(retjsonstr)) != 0 ) if ( (retjsonstr[0] == '{' || retjsonstr[0] == '[') && (retjson= cJSON_Parse(retjsonstr)) != 0 )
{
if ( is_cJSON_Array(retjson) == 0 )
{ {
if ( j64bits(retjson,"tag") != tag ) if ( j64bits(retjson,"tag") != tag )
{ {
@ -312,7 +314,9 @@ char *SuperNET_processJSON(struct supernet_info *myinfo,cJSON *json,char *remote
} }
retstr = jprint(retjson,1); retstr = jprint(retjson,1);
//printf("retstr.(%s) retjsonstr.%p retjson.%p\n",retstr,retjsonstr,retjson); //printf("retstr.(%s) retjsonstr.%p retjson.%p\n",retstr,retjsonstr,retjson);
free(retjsonstr);//,strlen(retjsonstr)+1); }
else retstr = retjsonstr;
free(retjsonstr);
} else retstr = retjsonstr; } else retstr = retjsonstr;
} }
free(jsonstr); free(jsonstr);

Loading…
Cancel
Save