Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
816158de00
  1. 3
      iguana/SuperNET.c
  2. 4
      iguana/main.c

3
iguana/SuperNET.c

@ -273,7 +273,7 @@ int32_t SuperNET_destination(struct supernet_info *myinfo,uint32_t *destipbitsp,
char *SuperNET_JSON(struct supernet_info *myinfo,cJSON *json,char *remoteaddr) char *SuperNET_JSON(struct supernet_info *myinfo,cJSON *json,char *remoteaddr)
{ {
int32_t destflag,maxdelay; bits256 destpub; uint32_t destipbits; cJSON *retjson; int32_t destflag,maxdelay; bits256 destpub; uint32_t destipbits; cJSON *retjson;
char *forwardstr=0,*retstr=0,*agent,*method,*message,*jsonstr=0; char *forwardstr=0,*retstr=0,*agent=0,*method=0,*message,*jsonstr=0;
if ( remoteaddr != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 ) if ( remoteaddr != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 )
remoteaddr = 0; remoteaddr = 0;
printf("SuperNET_JSON.(%s) remote.(%s)\n",jprint(json,0),remoteaddr!=0?remoteaddr:""); printf("SuperNET_JSON.(%s) remote.(%s)\n",jprint(json,0),remoteaddr!=0?remoteaddr:"");
@ -305,6 +305,7 @@ char *SuperNET_JSON(struct supernet_info *myinfo,cJSON *json,char *remoteaddr)
} }
} else printf("null retstr from SuperNET_JSON\n"); } else printf("null retstr from SuperNET_JSON\n");
} }
printf("retstr.%p forwardstr.%p jsonstr.%p\n",retstr,forwardstr,jsonstr);
if ( retstr == 0 ) if ( retstr == 0 )
retstr = forwardstr, forwardstr = 0; retstr = forwardstr, forwardstr = 0;
if ( forwardstr != 0 ) if ( forwardstr != 0 )

4
iguana/main.c

@ -137,7 +137,7 @@ char *iguana_blockingjsonstr(struct supernet_info *myinfo,char *jsonstr,uint64_t
char *SuperNET_processJSON(struct supernet_info *myinfo,cJSON *json,char *remoteaddr) char *SuperNET_processJSON(struct supernet_info *myinfo,cJSON *json,char *remoteaddr)
{ {
cJSON *retjson; uint64_t tag; uint32_t timeout; char *jsonstr; char *retjsonstr,*retstr = 0; cJSON *retjson; uint64_t tag; uint32_t timeout; char *jsonstr; char *retjsonstr,*retstr = 0;
//printf("SuperNET_JSON.(%s) remoteaddr.(%s)\n",jprint(json,0),remoteaddr!=0?remoteaddr:""); printf("SuperNET_JSON.(%s) remoteaddr.(%s)\n",jprint(json,0),remoteaddr!=0?remoteaddr:"");
if ( json != 0 ) if ( json != 0 )
{ {
if ( (tag= j64bits(json,"tag")) == 0 ) if ( (tag= j64bits(json,"tag")) == 0 )
@ -158,7 +158,7 @@ char *SuperNET_processJSON(struct supernet_info *myinfo,cJSON *json,char *remote
jdelete(retjson,"tag"); jdelete(retjson,"tag");
jadd64bits(retjson,"tag",tag); jadd64bits(retjson,"tag",tag);
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); free(retjsonstr);//,strlen(retjsonstr)+1);
} else retstr = retjsonstr; } else retstr = retjsonstr;
} }

Loading…
Cancel
Save