summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-03-31 21:11:50 +0000
committerErmal <eri@pfsense.org>2010-03-31 21:16:36 +0000
commit9af4b31b7ab9a62e559ee097f77e1ccfb44e0964 (patch)
treed08a53f1ddac98baa4294d2fd75c6758315358eb
parentb42edc09faed9f5c769d7ee8e18cfbbae3bf4fb4 (diff)
downloadpfsense-9af4b31b7ab9a62e559ee097f77e1ccfb44e0964.zip
pfsense-9af4b31b7ab9a62e559ee097f77e1ccfb44e0964.tar.gz
Use stristr as a microoptimization.
-rw-r--r--etc/inc/gwlb.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 1b33cc1..3d95678 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -355,11 +355,11 @@ function return_gateway_groups_array() {
if(($status['name'] != $gwname)) {
continue;
}
- if (preg_match("/down/i", $status['status'])) {
+ if (stristr($status['status'], "down")) {
$msg = "MONITOR: $gwname has high latency, removing from routing group";
log_error($msg);
notify_via_growl($msg);
- } elseif (preg_match("/loss/i", $status['status'])) {
+ } elseif (stristr($status['status'], "loss")) {
if (strstr($group['trigger'], "loss")) {
/* packet loss */
$msg = "MONITOR: $gwname has packet loss, removing from routing group";
@@ -368,7 +368,7 @@ function return_gateway_groups_array() {
} else {
$tiers[$tier][] = $gwname;
}
- } elseif (preg_match("/delay/i", $status['status'])) {
+ } elseif (stristr($status['status'], $delay)) {
if (strstr($group['trigger'] , "latency")) {
/* high latency */
$msg = "MONITOR: $gwname has high latency, removing from routing group";
@@ -377,7 +377,7 @@ function return_gateway_groups_array() {
} else {
$tiers[$tier][] = $gwname;
}
- } elseif (preg_match("/none/i", $status['status'])) {
+ } elseif (stristr($status['status'], "none")) {
/* Online add member */
$tiers[$tier][] = $gwname;
}
OpenPOWER on IntegriCloud