diff options
author | Arno Töll <arno@debian.org> | 2013-12-23 23:50:09 -1100 |
---|---|---|
committer | Arno Töll <arno@debian.org> | 2013-12-23 23:50:09 -1100 |
commit | 86d5cc79d9d6750da8771fdb0c9ab22c19b8ad45 (patch) | |
tree | 5037da70bf37c0ee93f0ea09f054bdfb278befe0 /modules/proxy/mod_proxy.c | |
parent | 4a336a5b117419c33c29eadd6409c69df78cd586 (diff) | |
download | apache2-86d5cc79d9d6750da8771fdb0c9ab22c19b8ad45.tar.gz |
Imported Upstream version 2.4.7upstream/2.4.7
Diffstat (limited to 'modules/proxy/mod_proxy.c')
-rw-r--r-- | modules/proxy/mod_proxy.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 0ee2ff35..88ddb899 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -177,15 +177,17 @@ static const char *set_worker_param(apr_pool_t *p, else if (!strcasecmp(key, "route")) { /* Worker route. */ - if (strlen(val) >= PROXY_WORKER_MAX_ROUTE_SIZE) - return "Route length must be < 64 characters"; + if (strlen(val) >= sizeof(worker->s->route)) + return apr_psprintf(p, "Route length must be < %d characters", + (int)sizeof(worker->s->route)); PROXY_STRNCPY(worker->s->route, val); } else if (!strcasecmp(key, "redirect")) { /* Worker redirection route. */ - if (strlen(val) >= PROXY_WORKER_MAX_ROUTE_SIZE) - return "Redirect length must be < 64 characters"; + if (strlen(val) >= sizeof(worker->s->redirect)) + return apr_psprintf(p, "Redirect length must be < %d characters", + (int)sizeof(worker->s->redirect)); PROXY_STRNCPY(worker->s->redirect, val); } else if (!strcasecmp(key, "status")) { @@ -256,8 +258,9 @@ static const char *set_worker_param(apr_pool_t *p, worker->s->conn_timeout_set = 1; } else if (!strcasecmp(key, "flusher")) { - if (strlen(val) >= PROXY_WORKER_MAX_SCHEME_SIZE) - return "flusher name length must be < 16 characters"; + if (strlen(val) >= sizeof(worker->s->flusher)) + apr_psprintf(p, "flusher name length must be < %d characters", + (int)sizeof(worker->s->flusher)); PROXY_STRNCPY(worker->s->flusher, val); } else { @@ -280,8 +283,9 @@ static const char *set_balancer_param(proxy_server_conf *conf, * Set to something like JSESSIONID or * PHPSESSIONID, etc.., */ - if (strlen(val) > (PROXY_BALANCER_MAX_STICKY_SIZE-1)) - return "stickysession length must be < 64 characters"; + if (strlen(val) >= sizeof(balancer->s->sticky_path)) + apr_psprintf(p, "stickysession length must be < %d characters", + (int)sizeof(balancer->s->sticky_path)); PROXY_STRNCPY(balancer->s->sticky_path, val); PROXY_STRNCPY(balancer->s->sticky, val); @@ -1700,19 +1704,19 @@ static const char * New->name = apr_pstrdup(parms->pool, arg); New->hostaddr = NULL; - if (ap_proxy_is_ipaddr(New, parms->pool)) { + if (ap_proxy_is_ipaddr(New, parms->pool)) { #if DEBUGGING - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "Parsed addr %s", inet_ntoa(New->addr)); - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "Parsed mask %s", inet_ntoa(New->mask)); + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + "Parsed addr %s", inet_ntoa(New->addr)); + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + "Parsed mask %s", inet_ntoa(New->mask)); #endif - } - else if (ap_proxy_is_domainname(New, parms->pool)) { - ap_str_tolower(New->name); + } + else if (ap_proxy_is_domainname(New, parms->pool)) { + ap_str_tolower(New->name); #if DEBUGGING - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "Parsed domain %s", New->name); + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + "Parsed domain %s", New->name); #endif } else if (ap_proxy_is_hostname(New, parms->pool)) { @@ -2435,7 +2439,7 @@ static int proxy_status_hook(request_rec *r, int flags) proxy_balancer *balancer = NULL; proxy_worker **worker = NULL; - if (flags & AP_STATUS_SHORT || conf->balancers->nelts == 0 || + if ((flags & AP_STATUS_SHORT) || conf->balancers->nelts == 0 || conf->proxy_status == status_off) return OK; |