From 1dfe6bdf427fa497508697c91d1f90d586473590 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Fri, 3 Nov 2017 18:10:22 +0100 Subject: [PATCH] htable: fix rpc dump json format - slot items have to be inside an array (cherry picked from commit 0956257ae6fdc0a801ce109017089ac18018e63b) --- src/modules/htable/htable.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c index 14973ee3f09..c6c7318337a 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;