jl777 8 years ago
parent
commit
07a9d8def9
  1. 2
      basilisk/basilisk.c
  2. 4
      basilisk/basilisk_MSG.c

2
basilisk/basilisk.c

@ -750,7 +750,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende
{ {
if ( (retstr= (*basilisk_services[i][1])(myinfo,type,addr,remoteaddr,basilisktag,valsobj,data,datalen,hash,from_basilisk)) != 0 ) if ( (retstr= (*basilisk_services[i][1])(myinfo,type,addr,remoteaddr,basilisktag,valsobj,data,datalen,hash,from_basilisk)) != 0 )
{ {
//printf("from_basilisk.%d ret.(%s)\n",from_basilisk,retstr); printf("%s from_basilisk.%d ret.(%s)\n",addr->ipaddr,from_basilisk,retstr);
//if ( from_basilisk != 0 || strcmp(CMD,"GET") == 0 ) //if ( from_basilisk != 0 || strcmp(CMD,"GET") == 0 )
basilisk_sendback(myinfo,CMD,symbol,remoteaddr,basilisktag,retstr); basilisk_sendback(myinfo,CMD,symbol,remoteaddr,basilisktag,retstr);
if ( retstr != 0 ) if ( retstr != 0 )

4
basilisk/basilisk_MSG.c

@ -246,7 +246,7 @@ HASH_ARRAY_STRING(basilisk,sendmessage,hash,vals,hexstr)
int32_t keylen,datalen; uint8_t key[BASILISK_KEYSIZE],space[16384],*data,*ptr = 0; char *retstr=0; int32_t keylen,datalen; uint8_t key[BASILISK_KEYSIZE],space[16384],*data,*ptr = 0; char *retstr=0;
if ( myinfo->IAMNOTARY != 0 && myinfo->NOTARY.RELAYID >= 0 ) if ( myinfo->IAMNOTARY != 0 && myinfo->NOTARY.RELAYID >= 0 )
{ {
keylen = basilisk_messagekey(key,juint(vals,"channel"),juint(vals,"msgid"),jbits256(vals,"srchash"),hash); keylen = basilisk_messagekey(key,juint(vals,"channel"),juint(vals,"msgid"),jbits256(vals,"srchash"),jbits256(vals,"desthash"));
if ( (data= get_dataptr(BASILISK_HDROFFSET,&ptr,&datalen,space,sizeof(space),hexstr)) != 0 ) if ( (data= get_dataptr(BASILISK_HDROFFSET,&ptr,&datalen,space,sizeof(space),hexstr)) != 0 )
{ {
retstr = basilisk_respond_addmessage(myinfo,key,keylen,data,datalen,0,juint(vals,"duration")); retstr = basilisk_respond_addmessage(myinfo,key,keylen,data,datalen,0,juint(vals,"duration"));
@ -258,7 +258,7 @@ HASH_ARRAY_STRING(basilisk,sendmessage,hash,vals,hexstr)
} }
if ( vals != 0 && juint(vals,"fanout") == 0 ) if ( vals != 0 && juint(vals,"fanout") == 0 )
jaddnum(vals,"fanout",MAX(8,(int32_t)sqrt(myinfo->NOTARY.NUMRELAYS)+2)); jaddnum(vals,"fanout",MAX(8,(int32_t)sqrt(myinfo->NOTARY.NUMRELAYS)+2));
return(basilisk_standardservice("OUT",myinfo,0,hash,vals,hexstr,0)); return(basilisk_standardservice("OUT",myinfo,0,jbits256(vals,"desthash"),vals,hexstr,0));
} }
#include "../includes/iguana_apiundefs.h" #include "../includes/iguana_apiundefs.h"

Loading…
Cancel
Save