Skip to content

Commit

Permalink
Amend clang errors
Browse files Browse the repository at this point in the history
  • Loading branch information
estringana committed Dec 13, 2022
1 parent f1afb83 commit 27492ee
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/helper/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ bool client::handle_command(network::request_init::request &command)
return false;
}

bool client::handle_command(network::config_sync::request &command)
bool client::handle_command(network::config_sync::request & /* command */)
{
if (!service_) {
// This implies a failed client_init, we can't continue.
Expand All @@ -233,7 +233,8 @@ bool client::handle_command(network::config_sync::request &command)
std::vector<std::shared_ptr<network::base_response>> messages;

if (service_->get_service_config()->is_asm_enabled()) {
auto response_cf = std::make_shared<network::config_features::response>();
auto response_cf =
std::make_shared<network::config_features::response>();
response_cf->enabled = true;

SPDLOG_DEBUG("sending config_features to config_sync");
Expand Down
3 changes: 2 additions & 1 deletion src/helper/network/broker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ class broker : public base_broker {

[[nodiscard]] request recv(
std::chrono::milliseconds initial_timeout) const override;
[[nodiscard]] virtual bool send(
[[nodiscard]] bool send(
const std::vector<std::shared_ptr<base_response>> &messages)
const override;

protected:
base_socket::ptr socket_;
};
Expand Down
27 changes: 21 additions & 6 deletions src/helper/network/proto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ struct client_init {
struct response : base_response_generic<response> {
static constexpr response_id id = response_id::client_init;

std::string get_type() const { return "client_init";};
[[nodiscard]] std::string get_type() const override
{
return "client_init";
};
std::string status;
std::string version{dds::php_ddappsec_version};
std::vector<std::string> errors;
Expand Down Expand Up @@ -139,7 +142,10 @@ struct request_init {
struct response : base_response_generic<response> {
static constexpr response_id id = response_id::request_init;

std::string get_type() const { return "request_init";};
[[nodiscard]] std::string get_type() const override
{
return "request_init";
};
std::string verdict;
std::vector<std::string> triggers;
std::unordered_set<std::string> actions;
Expand All @@ -166,7 +172,10 @@ struct config_sync {
struct response : base_response_generic<response> {
static constexpr response_id id = response_id::config_sync;

std::string get_type() const { return "config_sync";};
[[nodiscard]] std::string get_type() const override
{
return "config_sync";
};

MSGPACK_DEFINE();
};
Expand All @@ -176,7 +185,10 @@ struct config_features {
struct response : base_response_generic<response> {
static constexpr response_id id = response_id::config_features;

std::string get_type() const { return "config_features";};
[[nodiscard]] std::string get_type() const override
{
return "config_features";
};
bool enabled;

MSGPACK_DEFINE(enabled);
Expand All @@ -203,7 +215,10 @@ struct request_shutdown {
struct response : base_response_generic<response> {
static constexpr response_id id = response_id::request_shutdown;

std::string get_type() const { return "request_shutdown";};
[[nodiscard]] std::string get_type() const override
{
return "request_shutdown";
};
std::string verdict;
std::vector<std::string> triggers;
std::unordered_set<std::string> actions;
Expand All @@ -222,7 +237,7 @@ struct error {
struct response : base_response_generic<response> {
static constexpr response_id id = response_id::error;

std::string get_type() const { return "error";};
[[nodiscard]] std::string get_type() const override { return "error"; };

MSGPACK_DEFINE();
};
Expand Down

0 comments on commit 27492ee

Please sign in to comment.