Make server creation simpler
Server creation and allocation are now the same apart from the fact that allocation only adds the server to the running configuration where as the creation of a server also persist it to disk. The server serialization should not be seen through the server.h API. This allows the serialization method to change without actually having to change the interfaces.
This commit is contained in:
@ -2730,11 +2730,7 @@ int create_new_server(CONFIG_CONTEXT *obj)
|
||||
|
||||
if (address && port && protocol)
|
||||
{
|
||||
if ((obj->element = server_alloc(address, protocol, atoi(port), auth, auth_opts)))
|
||||
{
|
||||
server_set_unique_name(obj->element, obj->object);
|
||||
}
|
||||
else
|
||||
if ((obj->element = server_alloc(obj->object, address, atoi(port), protocol, auth, auth_opts)) == NULL)
|
||||
{
|
||||
MXS_ERROR("Failed to create a new server, memory allocation failed.");
|
||||
error_count++;
|
||||
|
Reference in New Issue
Block a user