Serialize repurposed servers

When a destroyed server is taken into use, it needs to be serialized. This
will allow the server to be created on restart.
This commit is contained in:
Markus Makela
2016-11-12 13:56:31 +02:00
parent 8b692b0754
commit a651eff633

View File

@ -1287,15 +1287,19 @@ bool server_create(const char *name, const char *address, const char *port,
server->is_active = true; server->is_active = true;
rval = true; rval = true;
} }
else if ((server = server_alloc(name, address, atoi(port), protocol, authenticator, else
authenticator_options)))
{ {
if (server_serialize(server)) /**
{ * server_alloc will add the server to the global list of
/** server_alloc will add the server to the global list of * servers so we don't need to manually add it.
* servers so we don't need to manually add it. */ */
rval = true; server = server_alloc(name, address, atoi(port), protocol,
} authenticator, authenticator_options);
}
if (server && server_serialize(server))
{
rval = true;
} }
} }