Module: sip-router Branch: master Commit: 43de8b203c569f8ebe47f28a9049d671a92852ea URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=43de8b20...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Tue Sep 9 12:28:09 2014 +0200
jsonrpc: reset the local reply structure before executing new commands
---
modules/jsonrpc-s/jsonrpc-s_mod.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules/jsonrpc-s/jsonrpc-s_mod.c b/modules/jsonrpc-s/jsonrpc-s_mod.c index 1951845..b004108 100644 --- a/modules/jsonrpc-s/jsonrpc-s_mod.c +++ b/modules/jsonrpc-s/jsonrpc-s_mod.c @@ -1003,7 +1003,6 @@ static int jsonrpc_exec(sip_msg_t* msg, char* cmd, char* s2) LM_ERR("Failed to init the json document\n"); return -1; } - ctx->jreq->buf = scmd; ctx->jreq->root = srjson_Parse(ctx->jreq, ctx->jreq->buf.s); if(ctx->jreq->root == NULL) @@ -1014,6 +1013,8 @@ static int jsonrpc_exec(sip_msg_t* msg, char* cmd, char* s2) } ret = -1; if (jsonrpc_init_reply(ctx) < 0) goto send_reply; + jsonrpc_reset_plain_reply(ctx->jrpl->free_fn); +
/* sanity checks on jsonrpc request */ nj = srjson_GetObjectItem(ctx->jreq, ctx->jreq->root, "jsonrpc");