Changed all atoi calls to config_truth_value when they were used to generate boolean values.

This commit is contained in:
Markus Makela
2015-04-30 10:58:35 +03:00
parent 6e4aa9862d
commit 360db8b235
3 changed files with 12 additions and 12 deletions

View File

@ -1308,7 +1308,7 @@ int i;
}
else if (strcmp(name, "ms_timestamp") == 0)
{
skygw_set_highp(atoi(value));
skygw_set_highp(config_truth_value(value));
}
else
{
@ -1316,7 +1316,7 @@ int i;
{
if (strcasecmp(name, lognames[i].logname) == 0)
{
if (atoi(value))
if (config_truth_value(value))
skygw_log_enable(lognames[i].logfile);
else
skygw_log_disable(lognames[i].logfile);
@ -1495,10 +1495,10 @@ SERVER *server;
user,
auth);
if (enable_root_user)
serviceEnableRootUser(service, atoi(enable_root_user));
serviceEnableRootUser(service, config_truth_value(enable_root_user));
if (connection_timeout)
serviceSetTimeout(service, atoi(connection_timeout));
serviceSetTimeout(service, config_truth_value(connection_timeout));
if(auth_all_servers)
@ -1511,7 +1511,7 @@ SERVER *server;
if (allow_localhost_match_wildcard_host)
serviceEnableLocalhostMatchWildcardHost(
service,
atoi(allow_localhost_match_wildcard_host));
config_truth_value(allow_localhost_match_wildcard_host));
/** Read, validate and set max_slave_connections */
max_slave_conn_str =
@ -1651,7 +1651,7 @@ SERVER *server;
user,
auth);
if (enable_root_user)
serviceEnableRootUser(obj->element, atoi(enable_root_user));
serviceEnableRootUser(obj->element, config_truth_value(enable_root_user));
if (connection_timeout)
serviceSetTimeout(obj->element, atoi(connection_timeout));
@ -1659,7 +1659,7 @@ SERVER *server;
if (allow_localhost_match_wildcard_host)
serviceEnableLocalhostMatchWildcardHost(
obj->element,
atoi(allow_localhost_match_wildcard_host));
config_truth_value(allow_localhost_match_wildcard_host));
}
}
}

View File

@ -95,7 +95,7 @@ static FILTER_OBJECT MyObject = {
* are logged.
*
* To this base a session number is attached such that each session will
* have a nique name.
* have a unique name.
*/
typedef struct {
int sessions; /* The count of sessions */

View File

@ -41,10 +41,10 @@ extern __thread log_info_t tls_log_info;
* Two optional parameters that define the behavior after a data modifying query
* is executed:
*
* count=<number of queries> Queries to route to master after data modification.
* time=<time period> Seconds to wait before queries are routed to slaves.
* match=<regex> Regex for matching
* ignore=<regex> Regex for ignoring
* count=<number of queries> Queries to route to master after data modification.
* time=<time period> Seconds to wait before queries are routed to slaves.
* match=<regex> Regex for matching
* ignore=<regex> Regex for ignoring
*
* The filter also has two options: @c case, which makes the regex case-sensitive, and @c ignorecase, which does the opposite.
* Date Who Description