|
|
@ -42,7 +42,7 @@ int32_t basilisk_ping_processMSG(struct supernet_info *myinfo,uint32_t senderipb |
|
|
|
int32_t i,msglen,len=0; uint8_t num,keylen,*msg,*key; |
|
|
|
if ( (num= data[len++]) > 0 ) |
|
|
|
{ |
|
|
|
//printf("processMSG num.%d datalen.%d\n",num,datalen);
|
|
|
|
printf("processMSG num.%d datalen.%d\n",num,datalen); |
|
|
|
for (i=0; i<num; i++) |
|
|
|
{ |
|
|
|
keylen = data[len++]; |
|
|
@ -64,7 +64,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); |
|
|
|
} |
|
|
|
} |
|
|
@ -82,7 +82,7 @@ int32_t basilisk_ping_genMSG(struct supernet_info *myinfo,uint8_t *data,int32_t |
|
|
|
datalen += iguana_rwnum(1,&data[datalen],sizeof(msg->datalen),&msg->datalen); |
|
|
|
if ( maxlen > datalen+msg->datalen ) |
|
|
|
{ |
|
|
|
//printf("SEND keylen.%d msglen.%d\n",msg->keylen,msg->datalen);
|
|
|
|
printf("SEND keylen.%d msglen.%d\n",msg->keylen,msg->datalen); |
|
|
|
memcpy(&data[datalen],msg->data,msg->datalen), datalen += msg->datalen; |
|
|
|
} |
|
|
|
else |
|
|
@ -112,7 +112,7 @@ char *basilisk_respond_getmessage(struct supernet_info *myinfo,uint8_t *key,int3 |
|
|
|
{ |
|
|
|
jadd(retjson,"message",msgjson); |
|
|
|
jaddstr(retjson,"result","success"); |
|
|
|
//printf("havemessage len.%d\n",msg->datalen);
|
|
|
|
printf("havemessage len.%d\n",msg->datalen); |
|
|
|
} else jaddstr(retjson,"error","couldnt add message"); |
|
|
|
} else jaddstr(retjson,"error","no message"); |
|
|
|
portable_mutex_unlock(&myinfo->messagemutex); |
|
|
@ -136,7 +136,7 @@ char *basilisk_respond_OUT(struct supernet_info *myinfo,char *CMD,void *addr,cha |
|
|
|
{ |
|
|
|
int32_t keylen; uint8_t key[64]; |
|
|
|
keylen = basilisk_messagekey(key,hash,valsobj); |
|
|
|
//printf("keylen.%d datalen.%d\n",keylen,datalen);
|
|
|
|
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)); |
|
|
|
} |
|
|
|