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.
This commit is contained in:
Markus Mäkelä 2018-08-21 22:59:25 +03:00
parent 276ff70506
commit 5485f83e75
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
3 changed files with 9 additions and 0 deletions

View File

@ -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;
}

View File

@ -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)

View File

@ -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);