From 3f12bdd4f8d78d40b7bf21974fdcdf9eb2b8ebeb Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 29 Jan 2015 11:33:11 +0100 Subject: [PATCH] tenants: apply added/removed tenant Apply to the engine. --- src/runmode-unix-socket.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/runmode-unix-socket.c b/src/runmode-unix-socket.c index 2e9a6c0f41..2a0d651a2d 100644 --- a/src/runmode-unix-socket.c +++ b/src/runmode-unix-socket.c @@ -479,6 +479,11 @@ TmEcode UnixSocketRegisterTenant(json_t *cmd, json_t* answer, void *data) DetectEngineAddToMaster(de_ctx); /* 3C for each thread, replace det_ctx */ + if (DetectEngineMTApply() < 0) { + json_object_set_new(answer, "message", json_string("couldn't apply settings")); + // TODO cleanup + return TM_ECODE_FAILED; + } json_object_set_new(answer, "message", json_string("work in progress")); return TM_ECODE_OK; @@ -519,7 +524,11 @@ TmEcode UnixSocketUnregisterTenant(json_t *cmd, json_t* answer, void *data) DetectEngineDeReference(&de_ctx); /* update the threads */ - /** TODO */ + if (DetectEngineMTApply() < 0) { + json_object_set_new(answer, "message", json_string("couldn't apply settings")); + // TODO cleanup + return TM_ECODE_FAILED; + } /* walk free list, freeing the removed de_ctx */ DetectEnginePruneFreeList();