Remove repurposing of servers

This was not very safe or correct. For example statistics and parameters
were reused by a new server.
This commit is contained in:
Markus Mäkelä
2018-08-16 21:28:06 +03:00
parent 6a06654ee9
commit eddae78b42
3 changed files with 1 additions and 50 deletions

View File

@ -1252,27 +1252,6 @@ bool server_serialize(const SERVER *server)
return rval;
}
SERVER* server_repurpose_destroyed(const char *name, const char *protocol, const char *authenticator,
const char *address, const char *port)
{
Guard guard(server_lock);
for (Server* server : all_servers)
{
if (!server->is_active &&
strcmp(server->name, name) == 0 &&
strcmp(server->protocol, protocol) == 0 &&
strcmp(server->authenticator, authenticator) == 0)
{
snprintf(server->address, sizeof(server->address), "%s", address);
server->port = atoi(port);
server->is_active = true;
return server;
}
}
return nullptr;
}
/**
* Set a status bit in the server under a lock. This ensures synchronization
* with the server monitor thread. Calling this inside the monitor will likely