"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "auxil/broker/src/status_subscriber.cc" between
zeek-4.0.2.tar.gz and zeek-4.0.3.tar.gz

About: Zeek (formerly Bro) is a flexible network analysis framework focusing on network security monitoring. LTS (Long Term Support) release.

status_subscriber.cc  (zeek-4.0.2):status_subscriber.cc  (zeek-4.0.3)
skipping to change at line 13 skipping to change at line 13
#include <limits> #include <limits>
#include <caf/send.hpp> #include <caf/send.hpp>
#include <caf/event_based_actor.hpp> #include <caf/event_based_actor.hpp>
#include "broker/atoms.hh" #include "broker/atoms.hh"
#include "broker/endpoint.hh" #include "broker/endpoint.hh"
#define BROKER_RETURN_CONVERTED_MSG() \ #define BROKER_RETURN_CONVERTED_MSG() \
auto& t = get_topic(msg); \ auto& t = get_topic(msg); \
if (t == topics::errors) { \ if (t == topic::errors_str) { \
if (auto value = to<error>(get_data(msg))) \ if (auto value = to<error>(get_data(msg))) \
return value_type{std::move(*value)}; \ return value_type{std::move(*value)}; \
BROKER_WARNING("received malformed error"); \ BROKER_WARNING("received malformed error"); \
} else { \ } else { \
if (auto value = to<status>(get_data(msg))) \ if (auto value = to<status>(get_data(msg))) \
return value_type{std::move(*value)}; \ return value_type{std::move(*value)}; \
BROKER_WARNING("received malformed status"); \ BROKER_WARNING("received malformed status"); \
} }
#define BROKER_APPEND_CONVERTED_MSG() \ #define BROKER_APPEND_CONVERTED_MSG() \
auto& t = get_topic(msg); \ auto& t = get_topic(msg); \
if (t == topics::errors) { \ if (t == topic::errors_str) { \
if (auto value = to<error>(get_data(msg))) \ if (auto value = to<error>(get_data(msg))) \
result.emplace_back(std::move(*value)); \ result.emplace_back(std::move(*value)); \
else \ else \
BROKER_WARNING("received malformed error"); \ BROKER_WARNING("received malformed error"); \
} else { \ } else { \
if (auto value = to<status>(get_data(msg))) \ if (auto value = to<status>(get_data(msg))) \
result.emplace_back(std::move(*value)); \ result.emplace_back(std::move(*value)); \
else \ else \
BROKER_WARNING("received malformed status"); \ BROKER_WARNING("received malformed status"); \
} }
using namespace caf; using namespace caf;
namespace broker { namespace broker {
namespace { namespace {
std::vector<topic> make_status_topics(bool receive_statuses) { std::vector<topic> make_status_topics(bool receive_statuses) {
std::vector<topic> result; std::vector<topic> result;
result.reserve(2); result.reserve(2);
result.emplace_back(topics::errors); result.emplace_back(topic::errors());
if (receive_statuses) if (receive_statuses)
result.emplace_back(topics::statuses); result.emplace_back(topic::statuses());
return result; return result;
} }
using value_type = status_subscriber::value_type; using value_type = status_subscriber::value_type;
} // namespace } // namespace
status_subscriber::status_subscriber(endpoint& ep, bool receive_statuses) status_subscriber::status_subscriber(endpoint& ep, bool receive_statuses)
: impl_(ep, make_status_topics(receive_statuses), : impl_(ep, make_status_topics(receive_statuses),
std::numeric_limits<long>::max()) { std::numeric_limits<long>::max()) {
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)