From 37adca57db41b835b80d8e9eea5545dd6cb694b1 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Mon, 9 Dec 2013 18:15:18 -0200 Subject: varnish3 - fix save lb_director save error on pfsense 2.1 --- config/varnish3/varnish.inc | 7 ++++++- config/varnish3/varnish_backends.xml | 4 ---- config/varnish3/varnish_lb_directors.xml | 3 --- config/varnish3/varnish_settings.xml | 5 ----- config/varnish3/varnish_sync.xml | 1 - 5 files changed, 6 insertions(+), 14 deletions(-) (limited to 'config/varnish3') diff --git a/config/varnish3/varnish.inc b/config/varnish3/varnish.inc index 983804c9..1895d214 100644 --- a/config/varnish3/varnish.inc +++ b/config/varnish3/varnish.inc @@ -65,8 +65,13 @@ function varnish_settings_post_validate($post, $input_errors) { } function varnish_lb_directors_post_validate($post, $input_errors) { - if (preg_match("/[^a-zA-Z0-9]/", $post['directorname'])) + if (preg_match("/[^a-zA-Z0-9]/", $post['directorname'])){ $input_errors[] = "The directorname name must only contain the characters a-Z or 0-9"; + } + else{ + if(empty($post['failover'])) + $_POST['failover'] = $post['directorname']; + } if(stristr($post['directorurl'], 'http')) $input_errors[] = "You do not need to include the http:// string in the director URL"; if($post['grace'] && ! preg_match("/^\d+(h|m|s)$/",$post['grace'])) diff --git a/config/varnish3/varnish_backends.xml b/config/varnish3/varnish_backends.xml index 28e7caca..58216279 100644 --- a/config/varnish3/varnish_backends.xml +++ b/config/varnish3/varnish_backends.xml @@ -155,7 +155,6 @@ BackendSettings - BackendSettings listtopic Backend settings @@ -189,7 +188,6 @@ PerformanceMetrics - PerformanceMetrics listtopic Performance metrics @@ -207,7 +205,6 @@ ProbeInfo - ProbeInfo listtopic Probe settings @@ -250,7 +247,6 @@ Mappings - Mappings listtopic Backend Mappings diff --git a/config/varnish3/varnish_lb_directors.xml b/config/varnish3/varnish_lb_directors.xml index b9d8cc24..99a945d5 100644 --- a/config/varnish3/varnish_lb_directors.xml +++ b/config/varnish3/varnish_lb_directors.xml @@ -137,7 +137,6 @@ DirectorSettings - Director Settings listtopic Director settings @@ -209,7 +208,6 @@ Backendlist - Backendlist listtopic Backend Settings @@ -249,7 +247,6 @@ FailoverSettings - FailoverSettings listtopic Failover Settings diff --git a/config/varnish3/varnish_settings.xml b/config/varnish3/varnish_settings.xml index 38c68a03..bbb8d321 100644 --- a/config/varnish3/varnish_settings.xml +++ b/config/varnish3/varnish_settings.xml @@ -80,7 +80,6 @@ Listening - Listening listtopic Daemon options @@ -112,7 +111,6 @@ StorageTypeLT - StorageTypeLT listtopic Storage type @@ -135,7 +133,6 @@ WorkerThreadLT - WorkerThreadLT listtopic Worker thread configuration @@ -159,7 +156,6 @@ BasicVCLLT - BasicVCLLT listtopic General VCL Settings @@ -245,7 +241,6 @@ ErrorVCLLT - ErrorVCLLT listtopic Error Settings diff --git a/config/varnish3/varnish_sync.xml b/config/varnish3/varnish_sync.xml index fd387fdb..d81851b1 100644 --- a/config/varnish3/varnish_sync.xml +++ b/config/varnish3/varnish_sync.xml @@ -80,7 +80,6 @@ listtopic - temp Enable Varnish configuration sync -- cgit v1.2.3