Merge branch '2.1' into develop

This commit is contained in:
Markus Mäkelä
2017-03-09 10:02:36 +02:00
19 changed files with 210 additions and 42 deletions

View File

@ -3302,40 +3302,51 @@ bool config_param_is_valid(const MXS_MODULE_PARAM *params, const char *key,
break;
case MXS_MODULE_PARAM_INT:
strtol(value, &endptr, 10);
if (endptr != value && *endptr == '\0')
{
valid = true;
errno = 0;
long int v = strtol(value, &endptr, 10);
(void)v; // error: ignoring return value of 'strtol'
if ((errno == 0) && (endptr != value) && (*endptr == '\0'))
{
valid = true;
}
}
break;
case MXS_MODULE_PARAM_SIZE:
strtoll(value, &endptr, 10);
if (endptr != value)
{
switch (*endptr)
errno = 0;
long long int v = strtoll(value, &endptr, 10);
(void)v; // error: ignoring return value of 'strtoll'
if (errno == 0)
{
case 'T':
case 't':
case 'G':
case 'g':
case 'M':
case 'm':
case 'K':
case 'k':
if (*(endptr + 1) == '\0' ||
((*(endptr + 1) == 'i' || *(endptr + 1) == 'I') && *(endptr + 2) == '\0'))
if (endptr != value)
{
valid = true;
switch (*endptr)
{
case 'T':
case 't':
case 'G':
case 'g':
case 'M':
case 'm':
case 'K':
case 'k':
if (*(endptr + 1) == '\0' ||
((*(endptr + 1) == 'i' || *(endptr + 1) == 'I') && *(endptr + 2) == '\0'))
{
valid = true;
}
break;
case '\0':
valid = true;
break;
default:
break;
}
}
break;
case '\0':
valid = true;
break;
default:
break;
}
}
break;

View File

@ -2708,7 +2708,7 @@ dcb_accept(DCB *listener)
client_dcb->fd = c_sock;
// get client address
if (((struct sockaddr *)&client_conn)->sa_family == AF_UNIX)
if (client_conn.ss_family == AF_UNIX)
{
// client address
client_dcb->remote = MXS_STRDUP_A("localhost_from_socket");

View File

@ -1368,6 +1368,18 @@ int main(int argc, char **argv)
case 'V':
rc = EXIT_SUCCESS;
printf("MaxScale %s - %s\n", MAXSCALE_VERSION, maxscale_commit);
if (strcmp(MAXSCALE_SOURCE, " ") != 0)
{
printf("Source: %s\n", MAXSCALE_SOURCE);
}
if (strcmp(MAXSCALE_CMAKE_FLAGS, "") != 0)
{
printf("CMake flags: %s\n", MAXSCALE_CMAKE_FLAGS);
}
if (strcmp(MAXSCALE_JENKINS_BUILD_TAG, "") != 0)
{
printf("Jenkins build: %s\n", MAXSCALE_JENKINS_BUILD_TAG);
}
goto return_main;
case 'l':

View File

@ -769,6 +769,7 @@ sessionRowCallback(RESULTSET *set, void *data)
SESSIONFILTER *cbdata = (SESSIONFILTER*)data;
RESULT_ROW *row = NULL;
cbdata->current = 0;
dcb_foreach(dcb_iter_cb, cbdata);
if (cbdata->row)