[sr-dev] git:5.0:1dfe6bdf: htable: fix rpc dump json format

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


Module: kamailio
Branch: 5.0
Commit: 1dfe6bdf427fa497508697c91d1f90d586473590
URL: https://github.com/kamailio/kamailio/commit/1dfe6bdf427fa497508697c91d1f90d586473590

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

htable: fix rpc dump json format

- slot items have to be inside an array

(cherry picked from commit 0956257ae6fdc0a801ce109017089ac18018e63b)

---

Modified: src/modules/htable/htable.c

---

Diff:  https://github.com/kamailio/kamailio/commit/1dfe6bdf427fa497508697c91d1f90d586473590.diff
Patch: https://github.com/kamailio/kamailio/commit/1dfe6bdf427fa497508697c91d1f90d586473590.patch

---

diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c
index 14973ee3f0..c6c7318337 100644
--- a/src/modules/htable/htable.c
+++ b/src/modules/htable/htable.c
@@ -856,7 +856,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)
@@ -866,8 +866,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