summaryrefslogtreecommitdiff
path: root/modules/proxy/mod_proxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/proxy/mod_proxy.c')
-rw-r--r--modules/proxy/mod_proxy.c49
1 files changed, 38 insertions, 11 deletions
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c
index 00bcfeba..45365364 100644
--- a/modules/proxy/mod_proxy.c
+++ b/modules/proxy/mod_proxy.c
@@ -71,6 +71,8 @@ static const char *set_worker_param(apr_pool_t *p,
{
int ival;
+ apr_interval_time_t timeout;
+
if (!strcasecmp(key, "loadfactor")) {
/* Normalized load factor. Used with BalancerMamber,
* it is a number between 1 and 100.
@@ -92,7 +94,7 @@ static const char *set_worker_param(apr_pool_t *p,
}
else if (!strcasecmp(key, "ttl")) {
/* Time in seconds that will destroy all the connections
- * that exced the smax
+ * that exceed the smax
*/
ival = atoi(val);
if (ival < 1)
@@ -126,14 +128,15 @@ static const char *set_worker_param(apr_pool_t *p,
worker->smax = ival;
}
else if (!strcasecmp(key, "acquire")) {
- /* Acquire timeout in milliseconds.
+ /* Acquire in given unit (default is milliseconds).
* If set this will be the maximum time to
* wait for a free connection.
*/
- ival = atoi(val);
- if (ival < 1)
- return "Acquire must be at least one mili second";
- worker->acquire = apr_time_make(0, ival * 1000);
+ if (ap_timeout_parameter_parse(val, &timeout, "ms") != APR_SUCCESS)
+ return "Acquire timeout has wrong format";
+ if (timeout < 1000)
+ return "Acquire must be at least one millisecond";
+ worker->acquire = timeout;
worker->acquire_set = 1;
}
else if (!strcasecmp(key, "timeout")) {
@@ -267,14 +270,26 @@ static const char *set_worker_param(apr_pool_t *p,
worker->lbset = ival;
}
else if (!strcasecmp(key, "ping")) {
- /* Ping/Pong timeout in seconds.
+ /* Ping/Pong timeout in given unit (default is second).
*/
- ival = atoi(val);
- if (ival < 1)
- return "Ping/Pong timeout must be at least one second";
- worker->ping_timeout = apr_time_from_sec(ival);
+ if (ap_timeout_parameter_parse(val, &timeout, "s") != APR_SUCCESS)
+ return "Ping/Pong timeout has wrong format";
+ if (timeout < 1000)
+ return "Ping/Pong timeout must be at least one millisecond";
+ worker->ping_timeout = timeout;
worker->ping_timeout_set = 1;
}
+ else if (!strcasecmp(key, "connectiontimeout")) {
+ /* Request timeout in given unit (default is second).
+ * Defaults to connection timeout
+ */
+ if (ap_timeout_parameter_parse(val, &timeout, "s") != APR_SUCCESS)
+ return "Connectiontimeout has wrong format";
+ if (timeout < 1000)
+ return "Connectiontimeout must be at least one millisecond.";
+ worker->conn_timeout = timeout;
+ worker->conn_timeout_set = 1;
+ }
else {
return "unknown Worker parameter";
}
@@ -338,6 +353,18 @@ static const char *set_balancer_param(proxy_server_conf *conf,
}
return "unknown lbmethod";
}
+ else if (!strcasecmp(key, "scolonpathdelim")) {
+ /* If set to 'on' then ';' will also be
+ * used as a session path separator/delim (ala
+ * mod_jk)
+ */
+ if (!strcasecmp(val, "on"))
+ balancer->scolonsep = 1;
+ else if (!strcasecmp(val, "off"))
+ balancer->scolonsep = 0;
+ else
+ return "scolonpathdelim must be On|Off";
+ }
else {
return "unknown Balancer parameter";
}