jl777 8 years ago
parent
commit
82f899c38f
  1. 4
      iguana/main.c

4
iguana/main.c

@ -221,7 +221,7 @@ char *iguana_blockingjsonstr(struct supernet_info *myinfo,struct iguana_info *co
{ {
queue_t *Q; struct iguana_jsonitem *ptr; int32_t len,allocsize; double expiration; queue_t *Q; struct iguana_jsonitem *ptr; int32_t len,allocsize; double expiration;
expiration = OS_milliseconds() + maxmillis; expiration = OS_milliseconds() + maxmillis;
//printf("blocking case.(%s) %.0f maxmillis.%d\n",jsonstr,OS_milliseconds(),maxmillis); printf("blocking case.(%s) %.0f maxmillis.%d\n",jsonstr,OS_milliseconds(),maxmillis);
len = (int32_t)strlen(jsonstr); len = (int32_t)strlen(jsonstr);
allocsize = sizeof(*ptr) + len + 1; allocsize = sizeof(*ptr) + len + 1;
ptr = mycalloc('J',1,allocsize); ptr = mycalloc('J',1,allocsize);
@ -231,7 +231,7 @@ char *iguana_blockingjsonstr(struct supernet_info *myinfo,struct iguana_info *co
ptr->retjsonstr = 0; ptr->retjsonstr = 0;
safecopy(ptr->remoteaddr,remoteaddr,sizeof(ptr->remoteaddr)); safecopy(ptr->remoteaddr,remoteaddr,sizeof(ptr->remoteaddr));
memcpy(ptr->jsonstr,jsonstr,len+1); memcpy(ptr->jsonstr,jsonstr,len+1);
if ( coin == 0 || (coin->FULLNODE == 0 && coin->VALIDATENODE == 0) ) if ( coin == 0 || coin->FULLNODE < 0 || (coin->FULLNODE == 0 && coin->VALIDATENODE == 0) )
Q = &JSON_Q; Q = &JSON_Q;
else Q = &coin->jsonQ; else Q = &coin->jsonQ;
queue_enqueue("jsonQ",Q,&ptr->DL,0); queue_enqueue("jsonQ",Q,&ptr->DL,0);

Loading…
Cancel
Save