Changes to open-file caching limits and uncached file unserialization.

- Unserializing files that were previously kicked out of the open-file
  cache would cause them to be fopen'd with the original access
  permissions which is usually 'w' and causes truncation.  They
  are now opened in 'a' mode.  (addresses #780)

- Add 'max_files_in_cache' script option to manually set the maximum
  amount of opened files to keep cached.  Mainly this just helped
  to create a simple test case for the above change.

- Remove unused NO_HAVE_SETRLIMIT preprocessor switch.

- On systems that don't enforce a limit on number of files opened for
  the process, raise default max size of open-file cache from
  32 to 512.
This commit is contained in:
Jon Siwek 2012-05-03 13:13:58 -05:00
parent 8766a2e2fc
commit bbac44a6a4
12 changed files with 104 additions and 11 deletions

View file

@ -87,7 +87,13 @@ protected:
BroFile() { Init(); }
void Init();
bool Open(FILE* f = 0); // if file is given, it's an open file to use
/**
* If file is given, it's an open file to use already.
* If file is not given and mode is, the filename will be opened with that
* access mode.
*/
bool Open(FILE* f = 0, const char* mode = 0);
BroFile* Prev() { return prev; }
BroFile* Next() { return next; }