[sr-dev] git:master:0956257a: htable: fix rpc dump json format

Daniel-Constantin Mierla miconda at gmail.com
Fri Nov 3 18:11:24 CET 2017


Module: kamailio
Branch: master
Commit: 0956257ae6fdc0a801ce109017089ac18018e63b
URL: https://github.com/kamailio/kamailio/commit/0956257ae6fdc0a801ce109017089ac18018e63b

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-11-03T18:10:22+01:00

htable: fix rpc dump json format

- slot items have to be inside an array

---

Modified: src/modules/htable/htable.c

---

Diff:  https://github.com/kamailio/kamailio/commit/0956257ae6fdc0a801ce109017089ac18018e63b.diff
Patch: https://github.com/kamailio/kamailio/commit/0956257ae6fdc0a801ce109017089ac18018e63b.patch

---

diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c
index bce82e96bb..d14f914896 100644
--- a/src/modules/htable/htable.c
+++ b/src/modules/htable/htable.c
@@ -966,7 +966,7 @@ static void  htable_rpc_dump(rpc_t* rpc, void* c)
 				rpc->fault(c, 500, "Internal error creating rpc");
 				goto error;
 			}
-			if(rpc->struct_add(th, "dd{",
+			if(rpc->struct_add(th, "dd[",
 							"entry", i,
 							"size",  (int)ht->entries[i].esize,
 							"slot",  &ih)<0)
@@ -976,8 +976,7 @@ static void  htable_rpc_dump(rpc_t* rpc, void* c)
 			}
 			while(it)
 			{
-				if(rpc->struct_add(ih, "{",
-							"item", &vh)<0)
+				if(rpc->array_add(ih, "{", &vh)<0)
 				{
 					rpc->fault(c, 500, "Internal error creating rpc");
 					goto error;




More information about the sr-dev mailing list