Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ native/*/Makefile
native/*/autom4te.cache/
native/*/config.status
native/*/configure
native/build/

# Native testsuite
test/java/node*/
Expand Down
38 changes: 33 additions & 5 deletions native/mod_manager/mod_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
#define SPORBIG "SYNTAX: Port field too big"
#define STYPBIG "SYNTAX: Type field too big"
#define SALIBAD "SYNTAX: Alias without Context"
#define SFLUBAD "SYNTAX: Flushwait field has bad value"
#define SPNGBAD "SYNTAX: Ping field has bad value"
#define STTLBAD "SYNTAX: TTL field has bad value"
#define STIMBAD "SYNTAX: Timeout field has bad value"
#define SCONBAD "SYNTAX: Context without Alias"
#define SBADFLD "SYNTAX: Invalid field \"%s\" in message"
#define SMISFLD "SYNTAX: Mandatory field(s) missing in message"
Expand Down Expand Up @@ -859,6 +863,8 @@ static char * process_config(request_rec *r, char **ptr, int *errtype)
struct cluster_host *vhost;
struct cluster_host *phost;

apr_interval_time_t time;

int i = 0;
int id;
int vid = 1; /* zero and "" is empty */
Expand Down Expand Up @@ -1028,19 +1034,39 @@ static char * process_config(request_rec *r, char **ptr, int *errtype)
}
}
if (strcasecmp(ptr[i], "flushwait") == 0) {
nodeinfo.mess.flushwait = atoi(ptr[i+1]) * 1000;
if (ap_timeout_parameter_parse(ptr[i+1], &time, "ms") != APR_SUCCESS) {
*errtype = TYPESYNTAX;
return SFLUBAD;
} else {
nodeinfo.mess.flushwait = time;
}
}
if (strcasecmp(ptr[i], "ping") == 0) {
nodeinfo.mess.ping = apr_time_from_sec(atoi(ptr[i+1]));
if (ap_timeout_parameter_parse(ptr[i+1], &time, "s") != APR_SUCCESS) {
*errtype = TYPESYNTAX;
return SPNGBAD;
} else {
nodeinfo.mess.ping = time;
}
}
if (strcasecmp(ptr[i], "smax") == 0) {
nodeinfo.mess.smax = atoi(ptr[i+1]);
}
if (strcasecmp(ptr[i], "ttl") == 0) {
nodeinfo.mess.ttl = apr_time_from_sec(atoi(ptr[i+1]));
if (ap_timeout_parameter_parse(ptr[i+1], &time, "s") != APR_SUCCESS) {
*errtype = TYPESYNTAX;
return STTLBAD;
} else {
nodeinfo.mess.ttl = time;
}
}
if (strcasecmp(ptr[i], "Timeout") == 0) {
nodeinfo.mess.timeout = apr_time_from_sec(atoi(ptr[i+1]));
if (ap_timeout_parameter_parse(ptr[i+1], &time, "s") != APR_SUCCESS) {
*errtype = TYPESYNTAX;
return STIMBAD;
} else {
nodeinfo.mess.timeout = time;
}
}

/* Hosts and contexts (optional paramters) */
Expand Down Expand Up @@ -2290,7 +2316,9 @@ static apr_status_t decodeenc(char **ptr)
val = 0;
while (NULL != ptr[val]) {
if (ptr[val][0] == '\0') {
return APR_SUCCESS; /* special case for no characters */
/* special case for no characters */
val++;
continue;
}
for (i = 0, j = 0; ptr[val][i] != '\0'; i++, j++) {
/* decode it if not already done */
Expand Down