From 0b5407ec0f13d7631a5273171338628b44814498 Mon Sep 17 00:00:00 2001 From: "Olle E. Johansson" Date: Mon, 3 Jan 2022 14:33:16 +0100 Subject: [PATCH] htable: Add response for rpc flush failed and success states --- src/modules/htable/htable.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c index 78f151daf31..bd6d474e9d0 100644 --- a/src/modules/htable/htable.c +++ b/src/modules/htable/htable.c @@ -1809,7 +1809,11 @@ static void htable_rpc_flush(rpc_t* rpc, void* c) rpc->fault(c, 500, "No such htable"); return; } - ht_reset_content(ht); + if(ht_reset_content(ht) < 0) { + rpc->fault(c, 500, "Htable flush failed."); + return; + } + rpc->rpl_printf(c, "Ok. Htable flushed."); } /*! \brief RPC htable.reload command to reload content of a hash table */