summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2017-06-21 15:21:18 +0200
committerJim Jagielski <jim@apache.org>2017-06-21 15:21:18 +0200
commit30923668d17fed5fc259c5f034b69308a0fb1438 (patch)
tree431e307f5b693d5f35e97669b19855cd4f7b259b /modules
parentAllow WatchdogInterval to be sub 1 second (diff)
downloadapache2-30923668d17fed5fc259c5f034b69308a0fb1438.tar.xz
apache2-30923668d17fed5fc259c5f034b69308a0fb1438.zip
Allow finer control over hcheck intervals... minimum is whatever
the watchdog slice is. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799437 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/proxy/mod_proxy_hcheck.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/modules/proxy/mod_proxy_hcheck.c b/modules/proxy/mod_proxy_hcheck.c
index 4ad2b62d0e..279c3ac526 100644
--- a/modules/proxy/mod_proxy_hcheck.c
+++ b/modules/proxy/mod_proxy_hcheck.c
@@ -155,14 +155,18 @@ static const char *set_worker_hc_param(apr_pool_t *p,
return "Unknown method";
}
else if (!strcasecmp(key, "hcinterval")) {
- ival = atoi(val);
- if (ival < HCHECK_WATHCHDOG_INTERVAL)
- return apr_psprintf(p, "Interval must be a positive value greater than %d seconds",
- HCHECK_WATHCHDOG_INTERVAL);
+ apr_interval_time_t hci;
+ apr_status_t rv;
+ rv = ap_timeout_parameter_parse(val, &hci, "s");
+ if (rv != APR_SUCCESS)
+ return "Unparse-able hcinterval setting";
+ if (hci < AP_WD_TM_SLICE)
+ return apr_psprintf(p, "Interval must be a positive value greater than %"
+ APR_TIME_T_FMT "ms", apr_time_as_msec(AP_WD_TM_SLICE));
if (worker) {
- worker->s->interval = apr_time_from_sec(ival);
+ worker->s->interval = hci;
} else {
- temp->interval = apr_time_from_sec(ival);
+ temp->interval = hci;
}
}
else if (!strcasecmp(key, "hcpasses")) {
@@ -1022,7 +1026,7 @@ static int hc_post_config(apr_pool_t *p, apr_pool_t *plog,
continue;
}
rv = hc_watchdog_register_callback(watchdog,
- apr_time_from_sec(HCHECK_WATHCHDOG_INTERVAL),
+ apr_time_from_sec(AP_WD_TM_SLICE),
ctx,
hc_watchdog_callback);
if (rv) {