Ticket #3932 Use array_map to get more parallelism when there are many entries. This makes it not reach the execution timeout with large entries.

This commit is contained in:
Ermal LUÇI 2015-01-12 10:38:17 +01:00
parent 7001542e3e
commit aa685f7a6d

View File

@ -1028,13 +1028,9 @@ function captiveportal_passthrumac_configure($lock = false) {
$rules = "";
if (is_array($config['captiveportal'][$cpzone]['passthrumac'])) {
$nentries = count($config['captiveportal'][$cpzone]['passthrumac']);
foreach ($config['captiveportal'][$cpzone]['passthrumac'] as $macent) {
if ($nentries > 100)
$rules .= captiveportal_passthrumac_configure_entry($macent, true);
else
$rules .= captiveportal_passthrumac_configure_entry($macent);
}
$tmprules = array_map('captiveportal_passthrumac_configure_entry', $config['captiveportal'][$cpzone]['passthrumac']);
$rules = implode("\n", $tmprules);
unset($tmprules);
}
return $rules;