From 5485f83e750b0e5a5662ae20bf36bd1e84aadd64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 21 Aug 2018 22:59:25 +0300 Subject: [PATCH] MXS-1929: Always store the module name parameter Services, monitors and filters all use the parameters for object serialization. This means that when the object is created, the module parameter must be in the parameter list. --- server/core/filter.cc | 3 +++ server/core/monitor.cc | 3 +++ server/core/service.cc | 3 +++ 3 files changed, 9 insertions(+) diff --git a/server/core/filter.cc b/server/core/filter.cc index 70aab02d1..7f8121cfb 100644 --- a/server/core/filter.cc +++ b/server/core/filter.cc @@ -122,6 +122,9 @@ FilterDef::FilterDef(std::string name, std::string module, MXS_FILTER_OBJECT* ob config_add_param(&ctx, p->name, p->value); } + // Store module, used when the filter is serialized + config_replace_param(&ctx, CN_MODULE, module.c_str()); + parameters = ctx.parameters; } diff --git a/server/core/monitor.cc b/server/core/monitor.cc index 7dfd2c361..f26d850cf 100644 --- a/server/core/monitor.cc +++ b/server/core/monitor.cc @@ -155,6 +155,9 @@ MXS_MONITOR* monitor_create(const char *name, const char *module, MXS_CONFIG_PAR monitor_add_user(mon, config_get_string(params, CN_USER), config_get_string(params, CN_PASSWORD)); + // Store module, used when the monitor is serialized + monitor_set_parameter(mon, CN_MODULE, module); + monitor_add_parameters(mon, params); if ((mon->instance = mon->api->createInstance(mon)) == NULL) diff --git a/server/core/service.cc b/server/core/service.cc index 7bfcaaf51..064921d84 100644 --- a/server/core/service.cc +++ b/server/core/service.cc @@ -107,6 +107,9 @@ Service* service_alloc(const char *name, const char *router, MXS_CONFIG_PARAMETE dcb_enable_session_timeouts(); } + // Store router, used when service is serialized + service_add_parameter(service, CN_ROUTER, router); + // Store parameters in the service service_add_parameters(service, params);