mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Rewrite the btest for when-statement timeouts
To avoid a memory leak in DNS lookups that's hard to work around and does not otherwise effect typical operation when Zeek is allowed to continue to run after zeek_init().
This commit is contained in:
parent
09578c6176
commit
d917737766
2 changed files with 13 additions and 11 deletions
|
@ -1,19 +1,21 @@
|
||||||
# @TEST-EXEC: unset ZEEK_DNS_FAKE && unset BRO_DNS_FAKE && zeek -b %INPUT >out
|
# @TEST-EXEC: btest-bg-run zeek zeek -b %INPUT
|
||||||
# @TEST-EXEC: btest-diff out
|
# @TEST-EXEC: btest-bg-wait 10
|
||||||
|
# @TEST-EXEC: btest-diff zeek/.stdout
|
||||||
|
|
||||||
|
redef exit_only_after_terminate=T;
|
||||||
|
|
||||||
|
global myset = set("yes");
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local h1: addr = 1.2.3.4;
|
when ( "no" in myset )
|
||||||
|
|
||||||
when ( local h1name = lookup_addr(h1) )
|
|
||||||
{
|
{
|
||||||
print "lookup successful";
|
print "lookup successful";
|
||||||
|
terminate();
|
||||||
}
|
}
|
||||||
timeout 3 secs
|
timeout 0.25sec
|
||||||
{
|
{
|
||||||
print "timeout";
|
print "timeout";
|
||||||
|
terminate();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue