diff --git a/server/core/gateway.c b/server/core/gateway.c index 9845713e1..9d0e6f908 100644 --- a/server/core/gateway.c +++ b/server/core/gateway.c @@ -935,7 +935,7 @@ int main(int argc, char **argv) char* tmp_var; int option_index; int logtofile = 0; /* Use shared memory or file */ - int syslog_enabled = 1; /** Log to syslog */ + int syslog_enabled = 0; /** Log to syslog */ int maxscalelog_enabled = 1; /** Log with MaxScale */ ssize_t log_flush_timeout_ms = 0; sigset_t sigset; @@ -1078,26 +1078,34 @@ int main(int argc, char **argv) } break; case 'S': - if(strstr(optarg,"=")) - { - strtok(optarg,"= "); - maxscalelog_enabled = config_truth_value(strtok(NULL,"= ")); - } - else - { - maxscalelog_enabled = config_truth_value(optarg); - } + { + char* tok = strstr(optarg,"="); + if(tok) + { + tok++; + if(tok) + maxscalelog_enabled = config_truth_value(tok); + } + else + { + maxscalelog_enabled = config_truth_value(optarg); + } + } break; case 's': - if(strstr(optarg,"=")) - { - strtok(optarg,"= "); - syslog_enabled = config_truth_value(strtok(NULL,"= ")); - } - else - { - syslog_enabled = config_truth_value(optarg); - } + { + char* tok = strstr(optarg,"="); + if(tok) + { + tok++; + if(tok) + syslog_enabled = config_truth_value(tok); + } + else + { + syslog_enabled = config_truth_value(optarg); + } + } break; case 'U': if(set_user(optarg) != 0) diff --git a/server/modules/filter/qlafilter.c b/server/modules/filter/qlafilter.c index a2d16d914..3c358cda1 100644 --- a/server/modules/filter/qlafilter.c +++ b/server/modules/filter/qlafilter.c @@ -305,7 +305,9 @@ char *remote, *userName; sprintf(my_session->filename, "%s.%d", my_instance->filebase, my_instance->sessions); - atomic_add(&my_instance->sessions,1); + + // Multiple sessions can try to update my_instance->sessions simultaneously + atomic_add(&(my_instance->sessions), 1); if (my_session->active) {