minor NIDS export performance improvement

pull/217/head
Christophe Vandeplas 2013-07-18 11:04:00 +02:00
parent 58f72ab4d1
commit 00d8d24434
2 changed files with 2 additions and 1 deletions

View File

@ -405,7 +405,7 @@ class NidsExportComponent extends Component {
foreach ($explodedNames as &$explodedName) {
// count the lenght of the part, and add |length| before
$length = strlen($explodedName);
if ($length > 255) exit('ERROR: dns name is to long for RFC'); // LATER log correctly without dying
if ($length > 255) $this->log('WARNING: dns name is to long for RFC: '.$name);
$hexLength = dechex($length);
if (1 == strlen($hexLength)) $hexLength = '0' . $hexLength;
$rawName .= '|' . $hexLength . '|' . $explodedName;

View File

@ -1468,6 +1468,7 @@ class EventsController extends AppController {
'recursive' => 0, //int
'group' => array('Attribute.type', 'Attribute.value1'), //fields to GROUP BY
);
unset($this->Attribute->virtualFields['category_order']); // not needed for IDS export and speeds things up
$items = $this->Attribute->find('all', $params);
$rules = $this->NidsExport->export($items, $user['User']['nids_sid']);