mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge 1f34645335
into 6af1459f5e
This commit is contained in:
commit
5beaf5d832
1 changed files with 8 additions and 0 deletions
|
@ -239,7 +239,10 @@ function parse(unparsed_version: string): Description
|
||||||
return Description($version=v, $unparsed_version=unparsed_version, $name=alternate_names[software_name]);
|
return Description($version=v, $unparsed_version=unparsed_version, $name=alternate_names[software_name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# A cache for the proxies that stores the result of parsing unparsed_version.
|
||||||
global parse_cache: table[string] of Description &read_expire=65secs;
|
global parse_cache: table[string] of Description &read_expire=65secs;
|
||||||
|
# A suppression cache for the workers to prevent sending the same information to the proxies multiple times.
|
||||||
|
global found_cache: set[Info] &create_expire=10mins;
|
||||||
|
|
||||||
# Call parse, but cache results in the parse_cache table
|
# Call parse, but cache results in the parse_cache table
|
||||||
function parse_with_cache(unparsed_version: string): Description
|
function parse_with_cache(unparsed_version: string): Description
|
||||||
|
@ -523,6 +526,11 @@ function found(id: conn_id, info: Info): bool
|
||||||
if ( ! info$force_log && ! addr_matches_host(info$host, asset_tracking) )
|
if ( ! info$force_log && ! addr_matches_host(info$host, asset_tracking) )
|
||||||
return F;
|
return F;
|
||||||
|
|
||||||
|
# This assumes that callers do not fill in info$ts, none of the current callers do.
|
||||||
|
if ( info in found_cache )
|
||||||
|
return T;
|
||||||
|
add found_cache[info];
|
||||||
|
|
||||||
if ( ! info?$ts )
|
if ( ! info?$ts )
|
||||||
info$ts = network_time();
|
info$ts = network_time();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue