From 899c59ea8c13ad2014a57479d86c50be67325353 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 30 Jun 2016 17:22:09 -0300 Subject: [PATCH] test --- basilisk/basilisk_MSG.c | 7 +++++-- iguana/tests/get | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/basilisk/basilisk_MSG.c b/basilisk/basilisk_MSG.c index 7a24a7a5e..0665fcecc 100755 --- a/basilisk/basilisk_MSG.c +++ b/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); if ( msg != 0 ) { - if ( basilisk_addhexstr(&ptr,retjson,strbuf,sizeof(strbuf),msg->data,msg->datalen) != 0 ) - jaddstr(retjson,"result","success"); + if ( basilisk_addhexstr(&ptr,retjson,strbuf,sizeof(strbuf),msg->data,msg->datalen) != 0 ) + { + jaddstr(retjson,"result","success"); + printf("getmessage.(%s)\n",jprint(retjson,0)); + } else jaddstr(retjson,"error","couldnt add message"); } else jaddstr(retjson,"error","no message"); portable_mutex_unlock(&myinfo->messagemutex); diff --git a/iguana/tests/get b/iguana/tests/get index 8ec012705..fa1f49360 100755 --- a/iguana/tests/get +++ b/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}}"