Browse code

htable: Add response for rpc flush failed and success states

Olle E. Johansson authored on 03/01/2022 13:33:16
Showing 1 changed files
... ...
@@ -1809,7 +1809,11 @@ static void  htable_rpc_flush(rpc_t* rpc, void* c)
1809 1809
 		rpc->fault(c, 500, "No such htable");
1810 1810
 		return;
1811 1811
 	}
1812
-	ht_reset_content(ht);
1812
+	if(ht_reset_content(ht) < 0) {
1813
+		rpc->fault(c, 500, "Htable flush failed.");
1814
+		return;
1815
+	}
1816
+	rpc->rpl_printf(c, "Ok. Htable flushed.");
1813 1817
 }
1814 1818
 
1815 1819
 /*! \brief RPC htable.reload command to reload content of a hash table */