mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-30 16:42:14 +00:00
update(userspace/falco): outputs error handling
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
This commit is contained in:
parent
f2637c8600
commit
aea12f4f3b
@ -278,31 +278,30 @@ void falco_outputs::worker()
|
|||||||
{
|
{
|
||||||
// Block until a message becomes available.
|
// Block until a message becomes available.
|
||||||
m_queue.pop(cmsg);
|
m_queue.pop(cmsg);
|
||||||
|
|
||||||
|
if (cmsg.type == ctrl_msg_type::CTRL_MSG_STOP)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for(auto it = m_outputs.cbegin(); it != m_outputs.cend(); ++it)
|
||||||
|
{
|
||||||
|
try {
|
||||||
switch(cmsg.type)
|
switch(cmsg.type)
|
||||||
{
|
{
|
||||||
case ctrl_msg_type::CTRL_MSG_OUTPUT:
|
case ctrl_msg_type::CTRL_MSG_OUTPUT:
|
||||||
for(auto it = m_outputs.cbegin(); it != m_outputs.cend(); ++it)
|
|
||||||
{
|
|
||||||
(*it)->output(&cmsg);
|
(*it)->output(&cmsg);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ctrl_msg_type::CTRL_MSG_CLEANUP:
|
case ctrl_msg_type::CTRL_MSG_CLEANUP:
|
||||||
for(auto it = m_outputs.cbegin(); it != m_outputs.cend(); ++it)
|
|
||||||
{
|
|
||||||
(*it)->cleanup();
|
(*it)->cleanup();
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ctrl_msg_type::CTRL_MSG_REOPEN:
|
case ctrl_msg_type::CTRL_MSG_REOPEN:
|
||||||
for(auto it = m_outputs.cbegin(); it != m_outputs.cend(); ++it)
|
|
||||||
{
|
|
||||||
(*it)->reopen();
|
(*it)->reopen();
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ctrl_msg_type::CTRL_MSG_STOP:
|
|
||||||
return;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
falco_logger::log(LOG_DEBUG, "Outputs worker received an unknown message type\n");
|
||||||
|
}
|
||||||
|
} catch(const exception &e) {
|
||||||
|
falco_logger::log(LOG_ERR, (*it)->get_name() + ": " + string(e.what()) + "\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user