diff options
author | Jim Jagielski <jim@apache.org> | 2017-06-21 14:49:54 +0200 |
---|---|---|
committer | Jim Jagielski <jim@apache.org> | 2017-06-21 14:49:54 +0200 |
commit | 09dc3b73d86786c399a99a58f7891cbf4677fa1d (patch) | |
tree | 779c5a8f02c5b499165d94818d0a28f2ac1c0d90 /modules/core | |
parent | Not an error... last one is honored (diff) | |
download | apache2-09dc3b73d86786c399a99a58f7891cbf4677fa1d.tar.xz apache2-09dc3b73d86786c399a99a58f7891cbf4677fa1d.zip |
Allow WatchdogInterval to be sub 1 second
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799435 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/core')
-rw-r--r-- | modules/core/mod_watchdog.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/core/mod_watchdog.c b/modules/core/mod_watchdog.c index c4f9857000..b6deaba306 100644 --- a/modules/core/mod_watchdog.c +++ b/modules/core/mod_watchdog.c @@ -449,6 +449,9 @@ static int wd_post_config_hook(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_create(&wd_server_conf->pool, ppconf); apr_pool_userdata_set(wd_server_conf, pk, apr_pool_cleanup_null, ppconf); } + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(010033) + "Watchdog: Running with WatchdogInterval %" + APR_TIME_T_FMT "ms", apr_time_as_msec(wd_interval)); wd_server_conf->s = s; if ((wl = ap_list_provider_names(pconf, AP_WATCHDOG_PGROUP, AP_WATCHDOG_PVERSION))) { @@ -596,15 +599,20 @@ static void wd_child_init_hook(apr_pool_t *p, server_rec *s) static const char *wd_cmd_watchdog_int(cmd_parms *cmd, void *dummy, const char *arg) { - int i; + apr_status_t rv; const char *errs = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (errs != NULL) return errs; - if ((i = atoi(arg)) < 1) - return "Invalid WatchdogInterval value"; + rv = ap_timeout_parameter_parse(arg, &wd_interval, "s"); + + if (rv != APR_SUCCESS) + return "Unparse-able WatchdogInterval setting"; + if (wd_interval < AP_WD_TM_SLICE) { + return apr_psprintf(cmd->pool, "Invalid WatchdogInterval: minimal value %" + APR_TIME_T_FMT "ms", apr_time_as_msec(AP_WD_TM_SLICE)); + } - wd_interval = apr_time_from_sec(i); return NULL; } |