A few more small tweaks.

This commit is contained in:
Robin Sommer 2013-05-14 16:19:41 -07:00
parent 1459216b20
commit 8220d70e88
4 changed files with 6 additions and 8 deletions

View file

@ -19,10 +19,8 @@ file_analysis::Analyzer* DataEvent::Instantiate(RecordVal* args, File* file)
{ {
using BifType::Record::FileAnalysis::AnalyzerArgs; using BifType::Record::FileAnalysis::AnalyzerArgs;
const char* chunk_field = "chunk_event"; int chunk_off = AnalyzerArgs->FieldOffset("chunk_event");
const char* stream_field = "stream_event"; int stream_off = AnalyzerArgs->FieldOffset("stream_event");
int chunk_off = AnalyzerArgs->FieldOffset(chunk_field);
int stream_off = AnalyzerArgs->FieldOffset(stream_field);
Val* chunk_val = args->Lookup(chunk_off); Val* chunk_val = args->Lookup(chunk_off);
Val* stream_val = args->Lookup(stream_off); Val* stream_val = args->Lookup(stream_off);

View file

@ -30,8 +30,7 @@ Extract::~Extract()
file_analysis::Analyzer* Extract::Instantiate(RecordVal* args, File* file) file_analysis::Analyzer* Extract::Instantiate(RecordVal* args, File* file)
{ {
using BifType::Record::FileAnalysis::AnalyzerArgs; using BifType::Record::FileAnalysis::AnalyzerArgs;
const char* field = "extract_filename"; Val* v = args->Lookup(AnalyzerArgs->FieldOffset("extract_filename"));
Val* v = args->Lookup(AnalyzerArgs->FieldOffset(field));
if ( ! v ) if ( ! v )
return 0; return 0;

View file

@ -325,7 +325,8 @@ void Manager::GetFileHandle(AnalyzerTag::Tag tag, Connection* c, bool is_orig)
{ {
current_handle.clear(); current_handle.clear();
if ( ! get_file_handle ) return; if ( ! get_file_handle )
return;
val_list* vl = new val_list(); val_list* vl = new val_list();
vl->append(new Val(tag, TYPE_COUNT)); vl->append(new Val(tag, TYPE_COUNT));

View file

@ -172,7 +172,7 @@ private:
StrSet ignored; /**< Ignored files. Will be finally removed on EOF. */ StrSet ignored; /**< Ignored files. Will be finally removed on EOF. */
string current_handle; /**< Last file handle set by get_file_handle event.*/ string current_handle; /**< Last file handle set by get_file_handle event.*/
static TableVal* disabled; /**< Table of disabled analyzers. */ static TableVal* disabled; /**< Table of disabled analyzers. */
}; };
} // namespace file_analysis } // namespace file_analysis