aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy/haproxy.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-11-20 18:06:22 -0500
committerScott Ullrich <sullrich@pfsense.org>2009-11-20 18:06:22 -0500
commit7840cc8ce79668aa9e479ee0464474269ca04196 (patch)
tree51c05a95f3d3337d50937d2c51ea91cb260ae7e9 /config/haproxy/haproxy.inc
parentb92a11202685093e004c3fe6a3ef35884622e511 (diff)
downloadpfsense-packages-7840cc8ce79668aa9e479ee0464474269ca04196.tar.gz
pfsense-packages-7840cc8ce79668aa9e479ee0464474269ca04196.tar.bz2
pfsense-packages-7840cc8ce79668aa9e479ee0464474269ca04196.zip
Do not clobber backend variable. Do not clobber listenip. Vesoion bump for haproxy
Diffstat (limited to 'config/haproxy/haproxy.inc')
-rw-r--r--config/haproxy/haproxy.inc19
1 files changed, 11 insertions, 8 deletions
diff --git a/config/haproxy/haproxy.inc b/config/haproxy/haproxy.inc
index e5aabb38..f3203ab2 100644
--- a/config/haproxy/haproxy.inc
+++ b/config/haproxy/haproxy.inc
@@ -124,25 +124,28 @@ function haproxy_configure() {
foreach ($a_backends as $backend) {
// Define our backend name
- $backend = "listen {$backend['name']}\n";
+ $backendinfo = "listen {$backend['name']}\n";
// Prepare ports for processing by splitting
- $backend['port'] .= ",";
- $ports = split(",", $backend['port']);
-
+ $portss = "{$backend['port']},";
+ $ports = split(",", $portss);
+
+ // Initialize variable
+ $listenip = "";
+
// Process and add bind directives for ports
foreach($ports as $port) {
if($port) {
if($backend['extaddr'] == "any")
- $listenip = "bind\t\t\t0.0.0.0:" . $port . "\n";
+ $listenip .= "\tbind\t\t\t0.0.0.0:{$port}\n";
elseif($backend['extaddr'])
- $listenip = "bind\t\t\t" . $backend['extaddr'] . ":" . $port ."\n";
+ $listenip .= "\tbind\t\t\t{$backend['extaddr']}:{$port}\n";
else
- $listenip = "bind\t\t\t" . get_current_wan_address('wan').":" . $port ."\n";
+ $listenip .= "\tbind\t\t\t" . get_current_wan_address('wan') . ":{$port}\n";
}
}
- fwrite ($fd, "{$backend}");
+ fwrite ($fd, "{$backendinfo}");
fwrite ($fd, "{$listenip}");
fwrite ($fd, "\tmode\t\t\t".$backend['type'] . "\n");
fwrite ($fd, "\tlog\t\t\tglobal\n");