net/relayd: merge version 1.2 from master

This commit is contained in:
Franco Fichtner 2017-12-05 08:58:12 +01:00
parent 4998f3c67b
commit d570503b80
2 changed files with 7 additions and 6 deletions

View file

@ -1,6 +1,5 @@
PLUGIN_NAME= relayd
PLUGIN_VERSION= 1.1
PLUGIN_REVISION= 1
PLUGIN_VERSION= 1.2
PLUGIN_DEPENDS= relayd
PLUGIN_COMMENT= Relayd Load Balancer
PLUGIN_MAINTAINER= franco@opnsense.org

View file

@ -140,14 +140,14 @@ function relayd_configure_do($kill_first = false)
foreach ($monitors_a as $type) {
$type['options'] = isset($type['options']) ? $type['options'] : array();
switch($type['type']) {
switch ($type['type']) {
case 'icmp':
case 'tcp':
$check_a[$type['name']] = 'check ' . $type['type'];
$check_a[$type['name']] = "check {$type['type']} ";
break;
case 'http':
case 'https':
$check_a[$type['name']] = 'check ' . $type['type']. " ";
$check_a[$type['name']] = "check {$type['type']} ";
if (!empty($type['options']['path'])) {
$check_a[$type['name']] .= "'".$type['options']['path'] . "' ";
}
@ -157,11 +157,13 @@ function relayd_configure_do($kill_first = false)
$check_a[$type['name']] .= "code " . $type['options']['code'];
break;
case 'send':
$check_a[$type['name']] = "send ";
$check_a[$type['name']] = "check {$type['type']} ";
$check_a[$type['name']] .= !empty($type['options']['send']) ? "\"{$type['options']['send']}\"" : "\"\"" ;
$check_a[$type['name']] .= " expect ";
$check_a[$type['name']] .= !empty($type['options']['expect']) ? "\"{$type['options']['expect']}\"" : "\"\"" ;
break;
default:
break;
}
}