Added session timeouts.
The parameter 'connection_timeout' for services takes a value as seconds. All sessions that have been idle for longer than this will be disconnected.
This commit is contained in:
@ -40,6 +40,7 @@
|
||||
* internal router suppression of messages
|
||||
* 30/10/14 Massimiliano Pinto Added disable_master_failback parameter
|
||||
* 07/11/14 Massimiliano Pinto Addition of monitor timeouts for connect/read/write
|
||||
* 20/02/15 Markus Mäkelä Added connection_timeout parameter for services
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
@ -278,6 +279,7 @@ int error_count = 0;
|
||||
char *user;
|
||||
char *auth;
|
||||
char *enable_root_user;
|
||||
char *connection_timeout;
|
||||
char *weightby;
|
||||
char *version_string;
|
||||
bool is_rwsplit = false;
|
||||
@ -288,6 +290,9 @@ int error_count = 0;
|
||||
enable_root_user = config_get_value(
|
||||
obj->parameters,
|
||||
"enable_root_user");
|
||||
connection_timeout = config_get_value(
|
||||
obj->parameters,
|
||||
"connection_timeout");
|
||||
weightby = config_get_value(obj->parameters, "weightby");
|
||||
|
||||
version_string = config_get_value(obj->parameters,
|
||||
@ -332,6 +337,11 @@ int error_count = 0;
|
||||
serviceEnableRootUser(
|
||||
obj->element,
|
||||
config_truth_value(enable_root_user));
|
||||
if (connection_timeout)
|
||||
serviceSetTimeout(
|
||||
obj->element,
|
||||
atoi(connection_timeout));
|
||||
|
||||
if (weightby)
|
||||
serviceWeightBy(obj->element, weightby);
|
||||
|
||||
@ -1281,13 +1291,15 @@ SERVER *server;
|
||||
char *user;
|
||||
char *auth;
|
||||
char *enable_root_user;
|
||||
char *connection_timeout;
|
||||
char* max_slave_conn_str;
|
||||
char* max_slave_rlag_str;
|
||||
char *version_string;
|
||||
char *allow_localhost_match_wildcard_host;
|
||||
|
||||
enable_root_user = config_get_value(obj->parameters, "enable_root_user");
|
||||
|
||||
connection_timeout = config_get_value(obj->parameters, "connection_timeout");
|
||||
|
||||
user = config_get_value(obj->parameters,
|
||||
"user");
|
||||
auth = config_get_value(obj->parameters,
|
||||
@ -1310,6 +1322,8 @@ SERVER *server;
|
||||
auth);
|
||||
if (enable_root_user)
|
||||
serviceEnableRootUser(service, atoi(enable_root_user));
|
||||
if (connection_timeout)
|
||||
serviceSetTimeout(service, atoi(connection_timeout));
|
||||
|
||||
if (allow_localhost_match_wildcard_host)
|
||||
serviceEnableLocalhostMatchWildcardHost(
|
||||
@ -1415,11 +1429,17 @@ SERVER *server;
|
||||
char *user;
|
||||
char *auth;
|
||||
char *enable_root_user;
|
||||
char *connection_timeout;
|
||||
char *allow_localhost_match_wildcard_host;
|
||||
|
||||
enable_root_user =
|
||||
config_get_value(obj->parameters,
|
||||
"enable_root_user");
|
||||
|
||||
connection_timeout =
|
||||
config_get_value(obj->parameters,
|
||||
"connection_timeout");
|
||||
|
||||
allow_localhost_match_wildcard_host =
|
||||
config_get_value(obj->parameters, "localhost_match_wildcard_host");
|
||||
|
||||
@ -1438,6 +1458,9 @@ SERVER *server;
|
||||
if (enable_root_user)
|
||||
serviceEnableRootUser(obj->element, atoi(enable_root_user));
|
||||
|
||||
if (connection_timeout)
|
||||
serviceSetTimeout(obj->element, atoi(connection_timeout));
|
||||
|
||||
if (allow_localhost_match_wildcard_host)
|
||||
serviceEnableLocalhostMatchWildcardHost(
|
||||
obj->element,
|
||||
@ -1661,6 +1684,7 @@ static char *service_params[] =
|
||||
"user",
|
||||
"passwd",
|
||||
"enable_root_user",
|
||||
"connection_timeout",
|
||||
"localhost_match_wildcard_host",
|
||||
"max_slave_connections",
|
||||
"max_slave_replication_lag",
|
||||
|
||||
Reference in New Issue
Block a user