aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-dev/haproxy.inc
diff options
context:
space:
mode:
authorthompsa <andy@fud.org.nz>2010-03-12 18:03:09 +1300
committerthompsa <andy@fud.org.nz>2010-03-12 18:03:09 +1300
commite0953a42d46724313fdc072a16756d8909ddad77 (patch)
tree61dcae32c82c2d3cfee5281c701656d56ffc8d4c /config/haproxy-dev/haproxy.inc
parente455a5327161728e87d8b214c0b31d9007d5e90a (diff)
downloadpfsense-packages-e0953a42d46724313fdc072a16756d8909ddad77.tar.gz
pfsense-packages-e0953a42d46724313fdc072a16756d8909ddad77.tar.bz2
pfsense-packages-e0953a42d46724313fdc072a16756d8909ddad77.zip
Make unique pools if svrport is set.
Diffstat (limited to 'config/haproxy-dev/haproxy.inc')
-rw-r--r--config/haproxy-dev/haproxy.inc16
1 files changed, 13 insertions, 3 deletions
diff --git a/config/haproxy-dev/haproxy.inc b/config/haproxy-dev/haproxy.inc
index ed8da06d..84a927c7 100644
--- a/config/haproxy-dev/haproxy.inc
+++ b/config/haproxy-dev/haproxy.inc
@@ -383,7 +383,6 @@ function haproxy_writeconf() {
$a_bind[$bname]['config'] = array();
// Settings which are constant for a merged frontend
$a_bind[$bname]['name'] = $backend['name'];
- $a_bind[$bname]['defaultpool'] = $backend['pool'] . "_" . strtolower($backend['type']);
$a_bind[$bname]['extaddr'] = $backend['extaddr'];
$a_bind[$bname]['port'] = $backend['port'];
}
@@ -465,9 +464,9 @@ function haproxy_writeconf() {
if($bind['client_timeout'])
fwrite ($fd, "\tclitimeout\t\t" . $bind['client_timeout'] . "\n");
- fwrite ($fd, "\tdefault_backend\t\t" . $bind['defaultpool'] . "\n");
// Combine the rest of the listener configs
+ $default_once = 0;
$i = 0;
foreach ($bind['config'] as $bconfig) {
$a_acl=&$bconfig['ha_acls']['item'];
@@ -475,6 +474,17 @@ function haproxy_writeconf() {
$a_acl=array();
$poolname = $bconfig['pool'] . "_" . strtolower($bconfig['type']);
+
+ // Create different pools if the svrport is set
+ if ($bconfig['svrport'] > 0)
+ $poolname .= "_" . $bconfig['svrport'];
+
+ // Write this out once, and must be before any backend config text
+ if ($default_once == 0) {
+ fwrite ($fd, "\tdefault_backend\t\t" . $poolname . "\n");
+ $default_once++;
+ }
+
if (!isset($a_pendingpl[$poolname])) {
$a_pendingpl[$poolname] = array();
$a_pendingpl[$poolname]['name'] = $poolname;
@@ -573,7 +583,7 @@ function haproxy_check_run($reload) {
}
log_error("Starting haproxy on CARP master.");
/* fallthrough */
- } else if ($reload == 0))
+ } else if ($reload == 0)
return (0);
if (haproxy_is_running()) {