Try to do the loading operations as close as possible to avoid any issues coming from it

This commit is contained in:
Ermal 2013-08-06 08:26:24 +00:00
parent 4455188278
commit 71549fa709

View File

@ -298,9 +298,6 @@ function filter_configure_sync($delete_states_if_needed = true) {
$rules .= discover_pkg_rules("filter");
@file_put_contents("{$g['tmp_path']}/rules.limits", $limitrules);
mwexec("/sbin/pfctl -f {$g['tmp_path']}/rules.limits");
if (!@file_put_contents("{$g['tmp_path']}/rules.debug", $rules, LOCK_EX)) {
log_error("WARNING: Could not write new rules!");
unlock($filterlck);
@ -308,12 +305,15 @@ function filter_configure_sync($delete_states_if_needed = true) {
}
unset($rules, $limitrules);
unset($rules_loading, $rules_error);
@file_put_contents("{$g['tmp_path']}/rules.limits", $limitrules);
mwexec("/sbin/pfctl -f {$g['tmp_path']}/rules.limits");
if(isset($config['system']['developerspew'])) {
$mt = microtime();
echo "pfctl being called at $mt\n";
}
unset($rules_loading, $rules_error);
$_grbg = exec("/sbin/pfctl -o basic -f {$g['tmp_path']}/rules.debug 2>&1", $rules_error, $rules_loading);
if(isset($config['system']['developerspew'])) {
$mt = microtime();