From 9732ead314536dc0324717ac05b24f807812ec44 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 13 Oct 2009 23:12:21 -0400 Subject: Cookie is optional --- config/haproxy/haproxy.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'config/haproxy/haproxy.inc') diff --git a/config/haproxy/haproxy.inc b/config/haproxy/haproxy.inc index bb5886ff..e42f7460 100644 --- a/config/haproxy/haproxy.inc +++ b/config/haproxy/haproxy.inc @@ -178,8 +178,13 @@ function haproxy_configure() { if(is_array($a_servers)) { foreach ($a_servers as $server) { if($server['backend']==$backend['name']) { - if($server['status']=='active') - fwrite ($fd, "\tserver\t\t\t".$server['name']." ".$server['address'].":".$server['port']." cookie ".$server['cookie']." check inter 1000 weight ".$server['weight']."\n"); + if($server['status']=='active') { + if($server['cookie']) + $cookie = " cookie {$server['cookie']} "; + else + $cookie = ""; + fwrite ($fd, "\tserver\t\t\t".$server['name']." ".$server['address'].":".$server['port']." $cookie "." check inter 1000 weight ".$server['weight']."\n"); + } } } } -- cgit v1.2.3