From 0252ba13e4630f164977a792cbbc3c61c84db16c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 3 Sep 2016 05:33:20 -0300 Subject: [PATCH] test --- basilisk/basilisk.c | 2 +- basilisk/basilisk_MSG.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index 9911433f2..6211bd77f 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -844,7 +844,7 @@ void basilisks_loop(void *arg) //printf(">>>>>>>>>>>>> update finished\n"); } } - if ( 0 && RELAYID < 0 && myinfo->expiration != 0 ) + if ( RELAYID < 0 && myinfo->expiration != 0 ) basilisk_requests_poll(myinfo); now = (uint32_t)time(NULL); portable_mutex_lock(&myinfo->messagemutex); diff --git a/basilisk/basilisk_MSG.c b/basilisk/basilisk_MSG.c index a0e7ed489..c1cfdf25e 100755 --- a/basilisk/basilisk_MSG.c +++ b/basilisk/basilisk_MSG.c @@ -50,7 +50,6 @@ char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int3 cJSON *basilisk_respond_getmessage(struct supernet_info *myinfo,uint8_t *key,int32_t keylen) { cJSON *msgjson=0; struct basilisk_message *msg; char *ptr = 0,strbuf[32768]; - {int32_t i; for (i=0; imessagemutex); HASH_FIND(hh,myinfo->messagetable,key,keylen,msg); if ( msg != 0 ) @@ -60,7 +59,8 @@ cJSON *basilisk_respond_getmessage(struct supernet_info *myinfo,uint8_t *key,int msgjson = cJSON_CreateObject(); jaddnum(msgjson,"expiration",msg->expiration); jaddnum(msgjson,"duration",msg->duration); - printf("havemessage len.%d\n",msg->datalen); + {int32_t i; for (i=0; idatalen); } } else printf("basilisk_respond_getmessage: couldnt basilisk_addhexstr\n"); } portable_mutex_unlock(&myinfo->messagemutex); @@ -154,6 +154,7 @@ char *basilisk_respond_MSG(struct supernet_info *myinfo,char *CMD,void *addr,cha HASH_ARRAY_STRING(basilisk,getmessage,hash,vals,hexstr) { uint32_t msgid,width,channel; + jaddbits256(vals,"sender",myinfo->myaddr.persistent); if ( (msgid= juint(vals,"msgid")) == 0 ) { msgid = (uint32_t)time(NULL); @@ -165,7 +166,7 @@ HASH_ARRAY_STRING(basilisk,getmessage,hash,vals,hexstr) channel = juint(vals,"channel"); width = juint(vals,"width"); return(basilisk_iterate_MSG(myinfo,channel,msgid,hash,myinfo->myaddr.persistent,width)); - } else return(basilisk_standardservice("MSG",myinfo,0,myinfo->myaddr.persistent,vals,hexstr,1)); + } else return(basilisk_standardservice("MSG",myinfo,0,hash,vals,hexstr,1)); } HASH_ARRAY_STRING(basilisk,sendmessage,hash,vals,hexstr)