From c63d23f3af359731cbd79c1519415d832a95f994 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Thu, 5 Apr 2012 15:30:40 -0700 Subject: [PATCH] Preventing Bro processes that do neither local logging nor request remote logs from spawning threads. This applies to the proxy, which was still opening all the log files with then idle threads. --- src/RemoteSerializer.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/RemoteSerializer.cc b/src/RemoteSerializer.cc index bf195e9d3a..61be8a9e8f 100644 --- a/src/RemoteSerializer.cc +++ b/src/RemoteSerializer.cc @@ -2503,6 +2503,9 @@ bool RemoteSerializer::SendLogCreateWriter(PeerID peer_id, EnumVal* id, EnumVal* if ( peer->phase != Peer::HANDSHAKE && peer->phase != Peer::RUNNING ) return false; + if ( ! peer->logs_requested ) + return false; + BinarySerializationFormat fmt; fmt.StartWrite(); @@ -2625,6 +2628,9 @@ error: bool RemoteSerializer::FlushLogBuffer(Peer* p) { + if ( ! p->logs_requested ) + return false; + last_flush = network_time; if ( p->state == Peer::CLOSING )