Merge branch 'develop' into MAX-324

Conflicts:
	utils/skygw_utils.cc
This commit is contained in:
Markus Makela
2015-03-06 17:07:39 +02:00
8 changed files with 68 additions and 6 deletions

View File

@ -150,6 +150,7 @@ static struct option long_options[] = {
{"config", required_argument, 0, 'f'},
{"nodaemon", no_argument, 0, 'd'},
{"log", required_argument, 0, 'l'},
{"syslog", required_argument, 0, 's'},
{"version", no_argument, 0, 'v'},
{"help", no_argument, 0, '?'},
{0, 0, 0, 0}
@ -995,6 +996,8 @@ static void usage(void)
" (default: $MAXSCALE_HOME/etc/MaxScale.cnf)\n"
" -l|--log=... log to file or shared memory\n"
" -lfile or -lshm - defaults to shared memory\n"
" -s|--syslog= log messages to syslog"
" true or false - defaults to true"
" -v|--version print version info and exit\n"
" -?|--help show this help\n"
, progname);
@ -1057,6 +1060,7 @@ int main(int argc, char **argv)
void* log_flush_thr = NULL;
int option_index;
int logtofile = 0; /* Use shared memory or file */
int syslog_enabled = 1; /** Log to syslog */
ssize_t log_flush_timeout_ms = 0;
sigset_t sigset;
sigset_t sigpipe_mask;
@ -1096,7 +1100,7 @@ int main(int argc, char **argv)
goto return_main;
}
}
while ((opt = getopt_long(argc, argv, "dc:f:l:v?",
while ((opt = getopt_long(argc, argv, "dc:f:l:vs:?",
long_options, &option_index)) != -1)
{
bool succp = true;
@ -1201,7 +1205,17 @@ int main(int argc, char **argv)
succp = false;
}
break;
case 's':
if(strstr(optarg,"="))
{
strtok(optarg,"= ");
syslog_enabled = config_truth_value(strtok(NULL,"= "));
}
else
{
syslog_enabled = config_truth_value(optarg);
}
break;
case '?':
usage();
rc = EXIT_SUCCESS;
@ -1563,6 +1577,8 @@ int main(int argc, char **argv)
argv[0] = "MaxScale";
argv[1] = "-j";
argv[2] = buf;
logmanager_enable_syslog(syslog_enabled);
if (logtofile)
{

View File

@ -116,9 +116,20 @@ HKTASK *task, *ptr;
ptr = ptr->next;
}
if (ptr)
{
if (strcmp(ptr->name, name) == 0)
{
spinlock_release(&tasklock);
free(task->name);
free(task);
return 0;
}
ptr->next = task;
}
else
{
tasks = task;
}
spinlock_release(&tasklock);
return task->nextdue;

View File

@ -290,6 +290,7 @@ struct router_client_session {
int rses_capabilities; /*< input type, for example */
bool rses_autocommit_enabled;
bool rses_transaction_active;
DCB* client_dcb;
#if defined(PREP_STMT_CACHING)
HASHTABLE* rses_prep_stmt[2];
#endif

View File

@ -790,6 +790,7 @@ static void* newSession(
#endif
client_rses->router = router;
client_rses->client_dcb = session->client;
/**
* If service config has been changed, reload config from service to
* router instance first.
@ -4353,8 +4354,10 @@ static bool route_session_write(
LOGFILE_TRACE,
"Router session exceeded session command history limit. "
"Closing router session. <")));
router_cli_ses->rses_closed = true;
gwbuf_free(querybuf);
rses_end_locked_router_action(router_cli_ses);
router_cli_ses->client_dcb->func.hangup(router_cli_ses->client_dcb);
goto return_succp;
}