From 68afc108494e46016a37c2a372f367a6a46133ad Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Thu, 20 Mar 2025 20:09:53 +0100 Subject: [PATCH] MT#56025 db_reg_agent: handle `RegistrationActionEvent::Unknown` Handle it in switch-statements. Change-Id: Ib4ea8b9b15867262792c5ac1d8bf52874d782a4c --- apps/db_reg_agent/DBRegAgent.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/db_reg_agent/DBRegAgent.cpp b/apps/db_reg_agent/DBRegAgent.cpp index b231c8fc..3aaaf255 100644 --- a/apps/db_reg_agent/DBRegAgent.cpp +++ b/apps/db_reg_agent/DBRegAgent.cpp @@ -840,6 +840,7 @@ void DBRegAgent::process(AmEvent* ev) { // uses ProcessorDBConnection void DBRegAgent::onRegistrationActionEvent(RegistrationActionEvent* reg_action_ev) { + switch (reg_action_ev->action) { case RegistrationActionEvent::Register: @@ -929,6 +930,11 @@ void DBRegAgent::onRegistrationActionEvent(RegistrationActionEvent* reg_action_e registrations_mut.unlock(); } break; + + case RegistrationActionEvent::Unknown: + { + DBG("Unknown action, cannot handle this in correct way."); + } break; } } @@ -1493,11 +1499,16 @@ void DBRegAgent::timer_cb(RegTimer* timer) { switch (timer->action) { case RegistrationActionEvent::Register: - scheduleRegistration(timer->object_id, timer->type); break; + scheduleRegistration(timer->object_id, timer->type); + break; case RegistrationActionEvent::Deregister: - scheduleDeregistration(timer->object_id, timer->type); break; - default: ERROR("internal: unknown reg_action %d for subscriber %ld timer event\n", - timer->action, timer->object_id); + scheduleDeregistration(timer->object_id, timer->type); + break; + case RegistrationActionEvent::Unknown: + ERROR("internal: unknown reg_action %d for subscriber %ld timer event\n", timer->action, timer->object_id); + break; + default: + ERROR("internal: unknown reg_action %d for subscriber %ld timer event\n", timer->action, timer->object_id); }; }