Fix alteration of new router parameters

If a router parameter has no default value, the previous value would be
returned as an empty string. A debug assertion would be triggered when a
parameter of this type was altered.

When a new router parameter is encountered and the alteration fails, the
modified value in the service need to be removed. Previously, the new
value would have been stored in the service with an empty value which
would have caused problems.
This commit is contained in:
Markus Mäkelä
2018-07-09 14:23:29 +03:00
parent 151c7e19f4
commit 313bb0a5b4
3 changed files with 51 additions and 2 deletions

View File

@ -135,6 +135,14 @@ void service_update(SERVICE *service, char *router, char *user, char *auth);
*/
void service_add_parameters(SERVICE *service, const MXS_CONFIG_PARAMETER *param);
/**
* @brief Remove service parameter
*
* @param service Service to modify
* @param key Parameter to remove
*/
void service_remove_parameter(SERVICE *service, const char* key);
/**
* @brief Replace service parameter
*