MXS-1220: Fix minor bugs

Destroyed servers were still shown as a part of the servers resource
collection.

If a parameter defined in persisted configurations was replaced, the value
would be appended to itself after it was replaced.

Return correct error codes for internal errors.

The server check was checking for old parameter locations.
This commit is contained in:
Markus Mäkelä
2017-04-27 18:21:35 +03:00
parent d248c7e081
commit fdf279265a
4 changed files with 35 additions and 17 deletions

View File

@ -1370,16 +1370,19 @@ json_t* server_list_to_json(const char* host)
for (SERVER* server = allServers; server; server = server->next)
{
json_t* srv_json = server_to_json(server, host);
if (srv_json == NULL)
if (SERVER_IS_ACTIVE(server))
{
json_decref(rval);
rval = NULL;
break;
}
json_t* srv_json = server_to_json(server, host);
json_array_append_new(rval, srv_json);
if (srv_json == NULL)
{
json_decref(rval);
rval = NULL;
break;
}
json_array_append_new(rval, srv_json);
}
}
spinlock_release(&server_spin);