Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
899c59ea8c
  1. 7
      basilisk/basilisk_MSG.c
  2. 2
      iguana/tests/get

7
basilisk/basilisk_MSG.c

@ -98,8 +98,11 @@ char *basilisk_respond_getmessage(struct supernet_info *myinfo,uint8_t *key,int3
HASH_FIND(hh,myinfo->messagetable,key,keylen,msg); HASH_FIND(hh,myinfo->messagetable,key,keylen,msg);
if ( msg != 0 ) if ( msg != 0 )
{ {
if ( basilisk_addhexstr(&ptr,retjson,strbuf,sizeof(strbuf),msg->data,msg->datalen) != 0 ) if ( basilisk_addhexstr(&ptr,retjson,strbuf,sizeof(strbuf),msg->data,msg->datalen) != 0 )
jaddstr(retjson,"result","success"); {
jaddstr(retjson,"result","success");
printf("getmessage.(%s)\n",jprint(retjson,0));
}
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);

2
iguana/tests/get

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"get\",\"vals\":{\"chain\":\"test\"}}" curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"getmessage\",\"vals\":{\"channel\":12345,\"msgid\":1}}"

Loading…
Cancel
Save