Merge with Subversion repository as of r7098.

This commit is contained in:
Robin Sommer 2010-11-27 12:21:17 -08:00
parent e95adb8055
commit b0cb05de64
6 changed files with 35 additions and 7 deletions

View file

@ -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;