MXS-2220 Move server_update_address inside class

Should be moved to internal class once blr is cleaned up.
This commit is contained in:
Esa Korhonen
2019-01-07 17:55:40 +02:00
parent 46eddc8102
commit df17619722
6 changed files with 25 additions and 23 deletions

View File

@ -790,21 +790,19 @@ std::unique_ptr<ResultSet> serverGetList()
return set;
}
/*
* Update the address value of a specific server
*
* @param server The server to update
* @param address The new address
*
*/
void server_update_address(SERVER* server, const char* address)
bool SERVER::server_update_address(const string& new_address)
{
Guard guard(this_unit.all_servers_lock);
if (server && address)
bool rval = false;
if (new_address.length() <= MAX_ADDRESS_LEN)
{
strcpy(server->address, address);
careful_strcpy(address, MAX_ADDRESS_LEN, new_address);
rval = true;
}
else
{
MXS_ERROR(ERR_TOO_LONG_CONFIG_VALUE, CN_ADDRESS, MAX_ADDRESS_LEN);
}
return rval;
}
void SERVER::update_port(int new_port)