[SR-Users] Missing pipelimit values in data returned by JSONRPC-S

Alex Balashov abalashov at evaristesys.com
Thu Mar 17 22:49:55 CET 2016


Traced this, got it to work for 'pl.stats' ...

[root at allegro-4 pipelimit]# !curl
curl --digest --user xxx:xxx http://10.150.20.6:5060/csrp_rpc/ --data 
'{"jsonrpc": "2.0", "method": "pl.stats", "id": "0xd"}'; echo
{
	"jsonrpc":	"2.0",
	"result":	["PIPE: id=bg350_ingress load=0 counter=0", "PIPE: 
id=bg208_ingress load=0 counter=0"],
	"id":	"0xd"
}

The problem is that the RPC function exports at the bottom of 
pipelimit.c are missing the RET_ARRAY flag:

---
static rpc_export_t rpc_methods[] = {
         {"pl.stats",      rpc_pl_stats,     rpc_pl_stats_doc,     0},
         {"pl.get_pipes",  rpc_pl_get_pipes, rpc_pl_get_pipes_doc, 0},
         {"pl.set_pipe",   rpc_pl_set_pipe,  rpc_pl_set_pipe_doc,  0},
         {"pl.get_pid",    rpc_pl_get_pid,   rpc_pl_get_pid_doc,   0},
         {"pl.set_pid",    rpc_pl_set_pid,   rpc_pl_set_pid_doc,   0},
         {"pl.push_load",  rpc_pl_push_load, rpc_pl_push_load_doc, 0},
         {0, 0, 0, 0}
};
---

Adding it to functions that return multiple values, e.g.

  {"pl.stats", rpc_pl_stats, rpc_pl_stats_doc, RET_ARRAY}

should sort it. I'll submit a pull request.

-- Alex

-- 
Alex Balashov | Principal | Evariste Systems LLC
1447 Peachtree Street NE, Suite 700
Atlanta, GA 30309
United States

Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list