Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
9266d1c641
  1. 10
      basilisk/basilisk_MSG.c
  2. 4
      iguana/main.c

10
basilisk/basilisk_MSG.c

@ -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; int32_t i,msglen,len=0; uint8_t num,keylen,*msg,*key;
if ( (num= data[len++]) > 0 ) 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++) for (i=0; i<num; i++)
{ {
keylen = data[len++]; 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); printf("illegal msglen.%d or len.%d > %d\n",msglen,len,datalen);
return(0); 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); 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); datalen += iguana_rwnum(1,&data[datalen],sizeof(msg->datalen),&msg->datalen);
if ( maxlen > 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; memcpy(&data[datalen],msg->data,msg->datalen), datalen += msg->datalen;
} }
else else
@ -112,7 +112,7 @@ char *basilisk_respond_getmessage(struct supernet_info *myinfo,uint8_t *key,int3
{ {
jadd(retjson,"message",msgjson); jadd(retjson,"message",msgjson);
jaddstr(retjson,"result","success"); 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","couldnt add message");
} else jaddstr(retjson,"error","no message"); } else jaddstr(retjson,"error","no message");
portable_mutex_unlock(&myinfo->messagemutex); 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]; int32_t keylen; uint8_t key[64];
keylen = basilisk_messagekey(key,hash,valsobj); 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)); //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)); return(basilisk_respond_addmessage(myinfo,key,keylen,data,datalen,1));
} }

4
iguana/main.c

@ -1501,9 +1501,9 @@ FOUR_STRINGS(SuperNET,login,handle,password,permanentfile,passphrase)
void iguana_relays_init(struct supernet_info *myinfo) void iguana_relays_init(struct supernet_info *myinfo)
{ {
char *str; char *str;
if ( (str= basilisk_addrelay_info(myinfo,0,(uint32_t)calc_ipbits("78.47.196.146"),GENESIS_PUBKEY)) != 0 ) if ( (str= basilisk_addrelay_info(myinfo,0,(uint32_t)calc_ipbits("89.248.160.237"),GENESIS_PUBKEY)) != 0 ) //"78.47.196.146"
free(str); free(str);
if ( (str= basilisk_addrelay_info(myinfo,0,(uint32_t)calc_ipbits("5.9.102.210"),GENESIS_PUBKEY)) != 0 ) if ( (str= basilisk_addrelay_info(myinfo,0,(uint32_t)calc_ipbits("89.248.160.238"),GENESIS_PUBKEY)) != 0 ) //"5.9.102.210"
free(str); free(str);
} }

Loading…
Cancel
Save