From: Paul Querna Date: Fri, 5 Dec 2008 09:29:52 +0000 (+0000) Subject: Make the max time from when we last saw a host a compile time option. X-Git-Tag: 2.3.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54d13fef11ea61f89916a86ffaeaa3b6ec2add4a;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/modules/proxy/balancers/mod_lbmethod_heartbeat.c b/modules/proxy/balancers/mod_lbmethod_heartbeat.c index aa88f280dec..48fec263ac0 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; }