| 275 | } |
| 276 | |
| 277 | static const char *set_hc_template(cmd_parms *cmd, void *dummy, const char *arg) |
| 278 | { |
| 279 | char *name = NULL; |
| 280 | char *word, *val; |
| 281 | hc_template_t *template; |
| 282 | sctx_t *ctx; |
| 283 | |
| 284 | const char *err = ap_check_cmd_context(cmd, NOT_IN_HTACCESS); |
| 285 | if (err) |
| 286 | return err; |
| 287 | ctx = (sctx_t *) ap_get_module_config(cmd->server->module_config, |
| 288 | &proxy_hcheck_module); |
| 289 | |
| 290 | name = ap_getword_conf(cmd->temp_pool, &arg); |
| 291 | if (!*name) { |
| 292 | return apr_pstrcat(cmd->temp_pool, "Missing template name for ", |
| 293 | cmd->cmd->name, NULL); |
| 294 | } |
| 295 | |
| 296 | template = (hc_template_t *)apr_array_push(ctx->templates); |
| 297 | |
| 298 | template->name = apr_pstrdup(cmd->pool, name); |
| 299 | template->method = template->passes = template->fails = 1; |
| 300 | template->interval = apr_time_from_sec(HCHECK_WATHCHDOG_DEFAULT_INTERVAL); |
| 301 | template->hurl = NULL; |
| 302 | template->hcexpr = NULL; |
| 303 | while (*arg) { |
| 304 | word = ap_getword_conf(cmd->pool, &arg); |
| 305 | val = strchr(word, '='); |
| 306 | if (!val) { |
| 307 | return "Invalid ProxyHCTemplate parameter. Parameter must be " |
| 308 | "in the form 'key=value'"; |
| 309 | } |
| 310 | else |
| 311 | *val++ = '\0'; |
| 312 | err = set_worker_hc_param(cmd->pool, ctx->s, NULL, word, val, template); |
| 313 | |
| 314 | if (err) { |
| 315 | /* get rid of recently pushed (bad) template */ |
| 316 | apr_array_pop(ctx->templates); |
| 317 | return apr_pstrcat(cmd->temp_pool, "ProxyHCTemplate: ", err, " ", word, "=", val, "; ", name, NULL); |
| 318 | } |
| 319 | /* No error means we have a valid template */ |
| 320 | } |
| 321 | return NULL; |
| 322 | } |
| 323 | |
| 324 | #if HC_USE_THREADS |
| 325 | static const char *set_hc_tpsize (cmd_parms *cmd, void *dummy, const char *arg) |
nothing calls this directly
no test coverage detected