-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MMDB code to re-open explicitly opened DBs correctly
The filename from which a DB first gets opened (either via an explicitly specified filename, or via the path sequence now configurable at the script layer) is now "sticky", meaning re-opening won't switch to a different file. This was easiest by moving most state into the MMDB class itself. The previous approach of tracking the two DB instances via a smart pointer and blowing the pointed-to objects away as needed is now instead one of two objects fixed over the lifetime of Zeek, able to open/close/reopen their underlying Maxmind DBs. The MMDB class now only has one Lookup() method since there was no need to break them apart -- it saves the return of a MMDB_lookup_result_s over the stack and there's no need for throwing an exception.
- Loading branch information
Showing
2 changed files
with
161 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.