mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Merge with Subversion repository as of r7098.
This commit is contained in:
parent
e95adb8055
commit
b0cb05de64
6 changed files with 35 additions and 7 deletions
20
src/File.cc
20
src/File.cc
|
@ -217,11 +217,8 @@ bool BroFile::Open(FILE* file)
|
|||
return false;
|
||||
}
|
||||
|
||||
val_list* vl = new val_list;
|
||||
Ref(this);
|
||||
vl->append(new Val(this));
|
||||
Event* event = new ::Event(::file_opened, vl);
|
||||
mgr.Dispatch(event, true);
|
||||
RaiseOpenEvent();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -299,6 +296,7 @@ FILE* BroFile::BringIntoCache()
|
|||
return f;
|
||||
}
|
||||
|
||||
RaiseOpenEvent();
|
||||
UpdateFileSize();
|
||||
|
||||
if ( fseek(f, position, SEEK_SET) < 0 )
|
||||
|
@ -783,6 +781,18 @@ int BroFile::Write(const char* data, int len)
|
|||
return true;
|
||||
}
|
||||
|
||||
void BroFile::RaiseOpenEvent()
|
||||
{
|
||||
if ( ! ::file_opened )
|
||||
return;
|
||||
|
||||
val_list* vl = new val_list;
|
||||
Ref(this);
|
||||
vl->append(new Val(this));
|
||||
Event* event = new ::Event(::file_opened, vl);
|
||||
mgr.Dispatch(event, true);
|
||||
}
|
||||
|
||||
void BroFile::UpdateFileSize()
|
||||
{
|
||||
struct stat s;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue