From 6eee5ded6112ee296f63e0595ca915531038d1cc Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 15 Jan 2019 12:12:09 -0600 Subject: [PATCH] GH-172: fix broxygen not merging bif and script identifier comments Fixes GH-172 --- CHANGES | 4 ++++ VERSION | 2 +- doc/scripts/base/frameworks/input/main.bro.rst | 3 ++- src/broker/comm.bif | 1 - src/broker/store.bif | 1 - src/broxygen/Manager.cc | 11 ++++++++--- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 50d0e3da00..74c7b9a19f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ +2.6-76 | 2019-01-15 12:12:09 -0600 + + * GH-172: fix broxygen not merging bif and script identifier comments (Jon Siwek, Corelight) + 2.6-75 | 2019-01-15 10:30:06 -0600 * GH-213: change type of vector for-loop index to a count (Jon Siwek, Corelight) diff --git a/VERSION b/VERSION index 0e19640273..391b67856f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.6-75 +2.6-76 diff --git a/doc/scripts/base/frameworks/input/main.bro.rst b/doc/scripts/base/frameworks/input/main.bro.rst index 2c320ca7fd..3875b675db 100644 --- a/doc/scripts/base/frameworks/input/main.bro.rst +++ b/doc/scripts/base/frameworks/input/main.bro.rst @@ -36,7 +36,7 @@ Types ========================================================== =================================================================== :bro:type:`Input::AnalysisDescription`: :bro:type:`record` A file analysis input stream type used to forward input data to the file analysis framework. -:bro:type:`Input::Event`: :bro:type:`enum` +:bro:type:`Input::Event`: :bro:type:`enum` Type that describes what kind of change occurred. :bro:type:`Input::EventDescription`: :bro:type:`record` An event input stream type used to send input data to a Bro event. :bro:type:`Input::Mode`: :bro:type:`enum` Type that defines the input stream read mode. :bro:type:`Input::TableDescription`: :bro:type:`record` A table input stream type used to send data to a Bro table. @@ -182,6 +182,7 @@ Types Previously existing data has been removed. + Type that describes what kind of change occurred. .. bro:type:: Input::EventDescription diff --git a/src/broker/comm.bif b/src/broker/comm.bif index 28ed862b7c..ce9862c141 100644 --- a/src/broker/comm.bif +++ b/src/broker/comm.bif @@ -40,7 +40,6 @@ enum ErrorCode %{ CAF_ERROR = 100, %} -## The possible states of a peer endpoint. enum PeerStatus %{ INITIALIZING, CONNECTING, diff --git a/src/broker/store.bif b/src/broker/store.bif index af17ceebae..228e70aac0 100644 --- a/src/broker/store.bif +++ b/src/broker/store.bif @@ -28,7 +28,6 @@ type Broker::QueryResult: record; type Broker::BackendOptions: record; -## Enumerates the possible storage backends. enum BackendType %{ MEMORY, SQLITE, diff --git a/src/broxygen/Manager.cc b/src/broxygen/Manager.cc index 4fd28d60f5..c54b05754e 100644 --- a/src/broxygen/Manager.cc +++ b/src/broxygen/Manager.cc @@ -211,7 +211,8 @@ void Manager::ModuleUsage(const string& path, const string& module) IdentifierInfo* Manager::CreateIdentifierInfo(ID* id, ScriptInfo* script) { - IdentifierInfo* rval = new IdentifierInfo(id, script); + auto prev = identifiers.GetInfo(id->Name()); + IdentifierInfo* rval = prev ? prev : new IdentifierInfo(id, script); rval->AddComments(comment_buffer); comment_buffer.clear(); @@ -224,8 +225,12 @@ IdentifierInfo* Manager::CreateIdentifierInfo(ID* id, ScriptInfo* script) comment_buffer_map.erase(it); } - all_info.push_back(rval); - identifiers.map[id->Name()] = rval; + if ( ! prev ) + { + all_info.push_back(rval); + identifiers.map[id->Name()] = rval; + } + last_identifier_seen = rval; if ( script )