From 3d0266eec6f5e24c73fc96c323b03d84edf890bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 30 Aug 2016 01:24:56 -0300 Subject: [PATCH] test --- basilisk/basilisk.c | 2 +- basilisk/basilisk_MSG.c | 9 ++++++--- basilisk/basilisk_ping.c | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index a2b286c5d..c8ed2f139 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -623,9 +623,9 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende //origcmd[0] = 0; if ( myinfo->RELAYID >= 0 ) { - printf("MSGPROCESS %s.(%s) tag.%d\n",CMD,(char *)data,basilisktag); if ( basilisk_specialcmd(CMD) == 0 ) return; + printf("MSGPROCESS %s.(%s) tag.%d\n",CMD,(char *)data,basilisktag); } symbol = "BTCD"; if ( senderipbits == 0 ) diff --git a/basilisk/basilisk_MSG.c b/basilisk/basilisk_MSG.c index 68679362d..2ecb4a39d 100755 --- a/basilisk/basilisk_MSG.c +++ b/basilisk/basilisk_MSG.c @@ -17,7 +17,7 @@ char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int32_t keylen,uint8_t *data,int32_t datalen,int32_t sendping,uint32_t duration) { - struct basilisk_message *msg; + struct basilisk_message *msg; int32_t i; if ( keylen == BASILISK_KEYSIZE ) { msg = calloc(1,sizeof(*msg) + datalen); @@ -33,6 +33,9 @@ char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int3 memcpy(msg->data,data,datalen); portable_mutex_lock(&myinfo->messagemutex); HASH_ADD_KEYPTR(hh,myinfo->messagetable,msg->key,msg->keylen,msg); + for (i=0; imessagemutex); if ( sendping != 0 ) @@ -85,8 +88,8 @@ char *basilisk_respond_OUT(struct supernet_info *myinfo,char *CMD,void *addr,cha keylen = basilisk_messagekey(key,juint(valsobj,"channel"),juint(valsobj,"msgid"),senderhash,hash); if( bits256_nonz(senderhash) == 0 && bits256_nonz(hash) == 0 && duration > BASILISK_MSGDURATION ) duration = BASILISK_MSGDURATION; - printf("OUT keylen.%d datalen.%d\n",keylen,datalen); - //char str[65]; printf("add message.[%d] channel.%u msgid.%x %s\n",datalen,juint(valsobj,"channel"),juint(valsobj,"msgid"),bits256_str(str,hash)); + // printf("OUT keylen.%d datalen.%d\n",keylen,datalen); + // char str[65]; printf("add message.[%d] channel.%u msgid.%x %s\n",datalen,juint(valsobj,"channel"),juint(valsobj,"msgid"),bits256_str(str,hash)); return(basilisk_respond_addmessage(myinfo,key,keylen,data,datalen,1,duration)); } diff --git a/basilisk/basilisk_ping.c b/basilisk/basilisk_ping.c index 3907547e0..0c0af3a32 100755 --- a/basilisk/basilisk_ping.c +++ b/basilisk/basilisk_ping.c @@ -133,7 +133,7 @@ int32_t basilisk_ping_processMSG(struct supernet_info *myinfo,uint32_t senderipb printf("illegal msglen.%d or len.%d > %d\n",msglen,len,datalen); return(0); } - printf("i.%d: keylen.%d msglen.%d\n",i,keylen,msglen); + //printf("i.%d: keylen.%d msglen.%d\n",i,keylen,msglen); basilisk_respond_addmessage(myinfo,key,keylen,msg,msglen,0,duration); } }