From: Jim Jagielski Date: Wed, 21 Jun 2017 12:49:54 +0000 (+0000) Subject: Allow WatchdogInterval to be sub 1 second X-Git-Tag: 2.5.0-alpha~361 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=09dc3b73d86786c399a99a58f7891cbf4677fa1d;p=apache 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 --- diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index 8e4ede90cc..84fb28fadb 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -10033 +10034 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; }