diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index fc1a85c10..cab863324 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -844,7 +844,7 @@ void basilisk_requests_poll(struct supernet_info *myinfo) //printf("Call incoming\n"); if ( (retstr= InstantDEX_incoming(myinfo,0,0,0,0)) != 0 ) { - //printf("poll.(%s)\n",retstr); + printf("poll.(%s)\n",retstr); if ( (retjson= cJSON_Parse(retstr)) != 0 ) { if ( (outerarray= jarray(&n,retjson,"responses")) != 0 ) diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index d5258a8b7..72b92bd37 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -495,10 +495,10 @@ INT_ARG(InstantDEX,automatched,requestid) int32_t InstantDEX_incoming_func(struct supernet_info *myinfo,void *ptr,uint8_t *data,int32_t datalen) { - int32_t i; - for (i=0; imessagemutex); HASH_ITER(hh,myinfo->messagetable,msg,tmpmsg) { @@ -110,6 +111,7 @@ char *basilisk_iterate_MSG(struct supernet_info *myinfo,uint32_t channel,uint32_ } } //printf("iterate_MSG allflag.%d width.%d channel.%d msgid.%d src.%llx -> %llx\n",allflag,origwidth,channel,msgid,(long long)srchash.txid,(long long)desthash.txid); + fprintf(stderr,"["); for (i=0; imessagemutex); + fprintf(stderr,"}"); if ( cJSON_GetArraySize(array) > 0 ) { retjson = cJSON_CreateObject(); @@ -174,7 +178,7 @@ char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int3 duration = INSTANTDEX_LOCKTIME*2; portable_mutex_lock(&myinfo->messagemutex); HASH_FIND(hh,myinfo->messagetable,key,keylen,msg); - if ( msg == 0 || msg->datalen != datalen ) + if ( msg == 0 )//|| msg->datalen != datalen ) { if ( msg != 0 ) { @@ -195,13 +199,13 @@ char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int3 msg->expiration = (uint32_t)time(NULL) + duration; HASH_ADD_KEYPTR(hh,myinfo->messagetable,msg->key,msg->keylen,msg); QUEUEITEMS++; - } else memcpy(msg->data,data,datalen); + for (i=0; iexpiration,msg,msg->hh.next,msg->hh.prev); + if ( sendping != 0 ) + queue_enqueue("basilisk_message",&myinfo->msgQ,&msg->DL,0); + } //else memcpy(msg->data,data,datalen); portable_mutex_unlock(&myinfo->messagemutex); - for (i=0; iexpiration,msg,msg->hh.next,msg->hh.prev); - if ( sendping != 0 ) - queue_enqueue("basilisk_message",&myinfo->msgQ,&msg->DL,0); return(clonestr("{\"result\":\"message added to hashtable\"}")); }