From 54d13fef11ea61f89916a86ffaeaa3b6ec2add4a Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 5 Dec 2008 09:29:52 +0000 Subject: [PATCH] Make the max time from when we last saw a host a compile time option. Suggested by: Ruediger Pluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@723685 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/balancers/mod_lbmethod_heartbeat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/proxy/balancers/mod_lbmethod_heartbeat.c b/modules/proxy/balancers/mod_lbmethod_heartbeat.c index aa88f280de..48fec263ac 100644 --- a/modules/proxy/balancers/mod_lbmethod_heartbeat.c +++ b/modules/proxy/balancers/mod_lbmethod_heartbeat.c @@ -20,6 +20,13 @@ #include "apr_version.h" #include "apr_hooks.h" +#ifndef LBM_HEARTBEAT_MAX_LASTSEEN +/* If we haven't seen a heartbeat in the last N seconds, don't count this IP + * as allive. + */ +#define LBM_HEARTBEAT_MAX_LASTSEEN (10) +#endif + module AP_MODULE_DECLARE_DATA lbmethod_heartbeat_module; typedef struct lb_hb_ctx_t @@ -256,7 +263,7 @@ static proxy_worker *find_best_hb(proxy_balancer *balancer, if (PROXY_WORKER_IS_USABLE(worker)) { server->worker = worker; - if (server->seen < 10) { + if (server->seen < LBM_HEARTBEAT_MAX_LASTSEEN) { openslots += server->ready; APR_ARRAY_PUSH(up_servers, hb_server_t *) = server; } -- 2.40.0