Merge branch 'release-1.0GA' into MAX-324

Conflicts:
	server/MaxScale_template.cnf
	server/core/service.c
This commit is contained in:
Markus Makela
2015-01-06 04:45:30 +02:00
96 changed files with 2931 additions and 1001 deletions

View File

@ -124,7 +124,8 @@ typedef enum skygw_chk_t {
CHK_NUM_BACKEND,
CHK_NUM_BACKEND_REF,
CHK_NUM_PREP_STMT,
CHK_NUM_PINFO
CHK_NUM_PINFO,
CHK_NUM_MYSQLSES
} skygw_chk_t;
# define STRBOOL(b) ((b) ? "true" : "false")
@ -279,6 +280,14 @@ typedef enum skygw_chk_t {
((t) == HINT_ROUTE_TO_ALL ? "HINT_ROUTE_TO_ALL" : \
((t) == HINT_PARAMETER ? "HINT_PARAMETER" : "UNKNOWN HINT TYPE"))))))
#define STRDCBREASON(r) ((r) == DCB_REASON_CLOSE ? "DCB_REASON_CLOSE" : \
((r) == DCB_REASON_DRAINED ? "DCB_REASON_DRAINED" : \
((r) == DCB_REASON_HIGH_WATER ? "DCB_REASON_HIGH_WATER" : \
((r) == DCB_REASON_LOW_WATER ? "DCB_REASON_LOW_WATER" : \
((r) == DCB_REASON_ERROR ? "DCB_REASON_ERROR" : \
((r) == DCB_REASON_HUP ? "DCB_REASON_HUP" : \
((r) == DCB_REASON_NOT_RESPONDING ? "DCB_REASON_NOT_RESPONDING" : \
"Unknown DCB reason")))))))
#define CHK_MLIST(l) { \
ss_info_dassert((l->mlist_chk_top == CHK_NUM_MLIST && \
@ -535,6 +544,11 @@ typedef enum skygw_chk_t {
"Parsing info struct has invalid check fields"); \
}
#define CHK_MYSQL_SESSION(s) { \
ss_info_dassert((s)->myses_chk_top == CHK_NUM_MYSQLSES && \
(s)->myses_chk_tail == CHK_NUM_MYSQLSES, \
"MYSQL session struct has invalid check fields"); \
}
#if defined(FAKE_CODE)

View File

@ -20,6 +20,7 @@
#include <math.h>
#include <stdbool.h>
#include <ctype.h>
#define SECOND_USEC (1024*1024L)
#define MSEC_USEC (1024L)

View File

@ -2058,11 +2058,29 @@ size_t get_decimal_len(
return value > 0 ? (size_t) log10 ((double) value) + 1 : 1;
}
/**
* Check if the provided pathname is POSIX-compliant. The valid characters
* are [a-z A-Z 0-9._-].
* @param path A null-terminated string
* @return true if it is a POSIX-compliant pathname, otherwise false
*/
bool is_valid_posix_path(char* path)
{
char* ptr = path;
while (*ptr != '\0')
{
if (isalnum (*ptr) ||
*ptr == '/' ||
*ptr == '.' ||
*ptr == '-' ||
*ptr == '_')
{
ptr++;
}
else
{
return false;
}
}
return true;
}

View File

@ -198,7 +198,7 @@ size_t get_decimal_len(size_t s);
char* replace_literal(char* haystack,
const char* needle,
const char* replacement);
bool is_valid_posix_path(char* path);
EXTERN_C_BLOCK_END
#endif /* SKYGW_UTILS_H */