Adding unhandled case for message_visitor (#3811)

This commit is contained in:
clemahieu 2022-05-06 15:38:12 +01:00 committed by GitHub
commit 119ac0cd8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 52 deletions

View file

@ -497,17 +497,51 @@ public:
class message_visitor class message_visitor
{ {
public: public:
virtual void keepalive (nano::keepalive const &) = 0; virtual void keepalive (nano::keepalive const & message)
virtual void publish (nano::publish const &) = 0; {
virtual void confirm_req (nano::confirm_req const &) = 0; default_handler (message);
virtual void confirm_ack (nano::confirm_ack const &) = 0; };
virtual void bulk_pull (nano::bulk_pull const &) = 0; virtual void publish (nano::publish const & message)
virtual void bulk_pull_account (nano::bulk_pull_account const &) = 0; {
virtual void bulk_push (nano::bulk_push const &) = 0; default_handler (message);
virtual void frontier_req (nano::frontier_req const &) = 0; }
virtual void node_id_handshake (nano::node_id_handshake const &) = 0; virtual void confirm_req (nano::confirm_req const & message)
virtual void telemetry_req (nano::telemetry_req const &) = 0; {
virtual void telemetry_ack (nano::telemetry_ack const &) = 0; default_handler (message);
}
virtual void confirm_ack (nano::confirm_ack const & message)
{
default_handler (message);
}
virtual void bulk_pull (nano::bulk_pull const & message)
{
default_handler (message);
}
virtual void bulk_pull_account (nano::bulk_pull_account const & message)
{
default_handler (message);
}
virtual void bulk_push (nano::bulk_push const & message)
{
default_handler (message);
}
virtual void frontier_req (nano::frontier_req const & message)
{
default_handler (message);
}
virtual void node_id_handshake (nano::node_id_handshake const & message)
{
default_handler (message);
}
virtual void telemetry_req (nano::telemetry_req const & message)
{
default_handler (message);
}
virtual void telemetry_ack (nano::telemetry_ack const & message)
{
default_handler (message);
}
virtual void default_handler (nano::message const &){};
virtual ~message_visitor (); virtual ~message_visitor ();
}; };

View file

@ -41,47 +41,7 @@ public:
// the channel to reply to, if a reply is generated // the channel to reply to, if a reply is generated
std::shared_ptr<nano::transport::inproc::channel> channel; std::shared_ptr<nano::transport::inproc::channel> channel;
void keepalive (nano::keepalive const & message) void default_handler (nano::message const & message) override
{
inbound (message, channel);
}
void publish (nano::publish const & message)
{
inbound (message, channel);
}
void confirm_req (nano::confirm_req const & message)
{
inbound (message, channel);
}
void confirm_ack (nano::confirm_ack const & message)
{
inbound (message, channel);
}
void bulk_pull (nano::bulk_pull const & message)
{
inbound (message, channel);
}
void bulk_pull_account (nano::bulk_pull_account const & message)
{
inbound (message, channel);
}
void bulk_push (nano::bulk_push const & message)
{
inbound (message, channel);
}
void frontier_req (nano::frontier_req const & message)
{
inbound (message, channel);
}
void node_id_handshake (nano::node_id_handshake const & message)
{
inbound (message, channel);
}
void telemetry_req (nano::telemetry_req const & message)
{
inbound (message, channel);
}
void telemetry_ack (nano::telemetry_ack const & message)
{ {
inbound (message, channel); inbound (message, channel);
} }