mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Add methods to queue events without handler existence check
Added ConnectionEventFast() and QueueEventFast() methods to avoid redundant event handler existence checks. It's common practice for caller to already check for event handler existence before doing all the work of constructing the arguments, so it's desirable to not have to check for existence again. E.g. going through ConnectionEvent() means 3 existence checks: one you do yourself before calling it, one in ConnectionEvent(), and then another in QueueEvent(). The existence check itself can be more than a few operations sometimes as it needs to check a few flags that determine if it's enabled, has a local body, or has any remote receivers in the old comm. system or has been flagged as something to publish in the new comm. system.
This commit is contained in:
parent
8bc65f09ec
commit
b6862c5c59
72 changed files with 771 additions and 524 deletions
|
@ -149,7 +149,7 @@ int NFS_Interp::RPC_BuildReply(RPC_CallInfo* c, BifEnum::rpc_status rpc_status,
|
|||
{
|
||||
auto vl = event_common_vl(c, rpc_status, nfs_status,
|
||||
start_time, last_time, reply_len, 0);
|
||||
analyzer->ConnectionEvent(nfs_reply_status, std::move(vl));
|
||||
analyzer->ConnectionEventFast(nfs_reply_status, std::move(vl));
|
||||
}
|
||||
|
||||
if ( ! rpc_success )
|
||||
|
@ -285,7 +285,7 @@ int NFS_Interp::RPC_BuildReply(RPC_CallInfo* c, BifEnum::rpc_status rpc_status,
|
|||
if ( reply )
|
||||
vl.append(reply);
|
||||
|
||||
analyzer->ConnectionEvent(event, std::move(vl));
|
||||
analyzer->ConnectionEventFast(event, std::move(vl));
|
||||
}
|
||||
else
|
||||
Unref(reply);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue