MXS-1731: Persist only non-empty values

When the service configurations are persisted, they need to be valid. This
means that no empty values are written into the file.
This commit is contained in:
Markus Mäkelä
2018-03-21 17:00:01 +02:00
parent 17c26164ce
commit 48e2b50e68

View File

@ -2392,11 +2392,19 @@ static bool create_service_config(const SERVICE *service, const char *filename)
dprintf(file, "%s=%s\n", CN_STRIP_DB_ESC, service->strip_db_esc ? "true" : "false");
dprintf(file, "%s=%s\n", CN_LOCALHOST_MATCH_WILDCARD_HOST,
service->localhost_match_wildcard_host ? "true" : "false");
dprintf(file, "%s=%s\n", CN_VERSION_STRING, service->version_string);
dprintf(file, "%s=%s\n", CN_WEIGHTBY, service->weightby);
dprintf(file, "%s=%s\n", CN_LOG_AUTH_WARNINGS, service->log_auth_warnings ? "true" : "false");
dprintf(file, "%s=%s\n", CN_RETRY_ON_FAILURE, service->retry_start ? "true" : "false");
if (*service->version_string)
{
dprintf(file, "%s=%s\n", CN_VERSION_STRING, service->version_string);
}
if (*service->weightby)
{
dprintf(file, "%s=%s\n", CN_WEIGHTBY, service->weightby);
}
if (service->dbref)
{
dprintf(file, "%s=", CN_SERVERS);