mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00

* Some methods mistakenly returned a bool instead of QueryResult when passed an invalid `opaque of Broker::Store` handle. * Now generates a runtime exception for store_name() and is_closed() calls that pass an invalid `opaque of Broker::Store` handle as any returned value can't be reasonably used in any subsequent logic. * Descriptions of any invalid arguments are now given in the error message.
34 lines
541 B
Text
34 lines
541 B
Text
# @TEST-EXEC: zeek -b %INPUT >out 2>&1
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
|
|
|
|
function print_keys(a: any)
|
|
{
|
|
when ( local s = Broker::keys(a) )
|
|
{
|
|
print "keys", s;
|
|
}
|
|
timeout 2sec
|
|
{
|
|
print fmt("<timeout for print keys>");
|
|
}
|
|
}
|
|
|
|
function checkit(a: any)
|
|
{
|
|
if ( Broker::is_closed(a) )
|
|
print "this shouldn't get printed";
|
|
else
|
|
print "this shouldn't get printed either";
|
|
}
|
|
|
|
global a: int = 0;
|
|
|
|
event zeek_init() &priority=10
|
|
{
|
|
checkit(a);
|
|
}
|
|
|
|
event zeek_init()
|
|
{
|
|
print_keys(a);
|
|
}
|