mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Make sure to always delete the remote serializer.
There were two problems actually: the iomanager wasn't properly deleting sourcesl; and in some situations, the remote serialize wasn't registered with it to begin with. Addresses BIT-1306 and probably also BIT-1356.
This commit is contained in:
parent
1132470b05
commit
0620bc970a
5 changed files with 36 additions and 4 deletions
|
@ -542,6 +542,9 @@ RemoteSerializer::RemoteSerializer()
|
|||
current_msgtype = 0;
|
||||
current_args = 0;
|
||||
source_peer = 0;
|
||||
|
||||
// Register as a "dont-count" source first, we may change that later.
|
||||
iosource_mgr->Register(this, true);
|
||||
}
|
||||
|
||||
RemoteSerializer::~RemoteSerializer()
|
||||
|
@ -571,8 +574,6 @@ void RemoteSerializer::Enable()
|
|||
|
||||
Fork();
|
||||
|
||||
iosource_mgr->Register(this);
|
||||
|
||||
Log(LogInfo, fmt("communication started, parent pid is %d, child pid is %d", getpid(), child_pid));
|
||||
initialized = 1;
|
||||
}
|
||||
|
@ -612,6 +613,9 @@ void RemoteSerializer::Fork()
|
|||
if ( child_pid )
|
||||
return;
|
||||
|
||||
// Register as a "does-count" source now.
|
||||
iosource_mgr->Register(this, false);
|
||||
|
||||
// If we are re-forking, remove old entries
|
||||
loop_over_list(peers, i)
|
||||
RemovePeer(peers[i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue