Serialize server weighting parameters

The server weighting parameters couldn't be altered online and they
weren't serialized to disk. Only servers that are created online will have
their weighting parameters persisted to disk.
This commit is contained in:
Markus Mäkelä
2016-12-19 18:14:47 +02:00
parent 180728dde6
commit ae8c21929f
5 changed files with 94 additions and 14 deletions

View File

@ -286,7 +286,20 @@ bool runtime_alter_server(SERVER *server, char *key, char *value)
}
else
{
valid = false;
if (!serverRemoveParameter(server, key) && !value[0])
{
valid = false;
}
else if (value[0])
{
serverAddParameter(server, key, value);
/**
* It's likely that this parameter is used as a weighting parameter.
* We need to update the weights of services that use this.
*/
service_update_weights();
}
}
if (valid)