Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
KEP-743 audit module crashes when logging after sending stats
Browse files Browse the repository at this point in the history
  • Loading branch information
ebruck committed Oct 26, 2018
1 parent 681c658 commit 2ee3b96
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions audit/audit.cpp
Expand Up @@ -209,10 +209,14 @@ audit::send_to_monitor(const std::string& stat)
std::shared_ptr<boost::asio::const_buffer> buffer = std::make_shared<boost::asio::const_buffer>(stat.c_str(), stat.size());

this->socket->async_send_to(*buffer, *(this->monitor_endpoint),
[buffer](const boost::system::error_code& error, std::size_t bytes)
{
LOG(error) << boost::format("UDP send failed, sent %1% bytes, '%2'") % error.message() % bytes;
}
[buffer](const boost::system::error_code& ec, std::size_t bytes)
{
if (ec)
{
LOG(error) << boost::format("UDP send failed, sent %1% bytes, '%2%'") %
ec.message() % bytes;
}
}
);

}
Expand Down

0 comments on commit 2ee3b96

Please sign in to comment.