mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-23 09:48:05 +02:00
Revert "[Refactor] CpuBoundWork#CpuBoundWork(): require an io_context::strand"
This reverts commit 5ca0d7102af59ca309fa9c071d5280de4e096b5c.
This commit is contained in:
parent
bb380d33e0
commit
7097bdb97d
@ -16,7 +16,7 @@
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
CpuBoundWork::CpuBoundWork(boost::asio::yield_context yc, boost::asio::io_context::strand&)
|
||||
CpuBoundWork::CpuBoundWork(boost::asio::yield_context yc)
|
||||
: m_Done(false)
|
||||
{
|
||||
auto& ioEngine (IoEngine::Get());
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <boost/exception/all.hpp>
|
||||
#include <boost/asio/deadline_timer.hpp>
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/asio/io_context_strand.hpp>
|
||||
#include <boost/asio/spawn.hpp>
|
||||
|
||||
namespace icinga
|
||||
@ -31,7 +30,7 @@ namespace icinga
|
||||
class CpuBoundWork
|
||||
{
|
||||
public:
|
||||
CpuBoundWork(boost::asio::yield_context yc, boost::asio::io_context::strand&);
|
||||
CpuBoundWork(boost::asio::yield_context yc);
|
||||
CpuBoundWork(const CpuBoundWork&) = delete;
|
||||
CpuBoundWork(CpuBoundWork&&) = delete;
|
||||
CpuBoundWork& operator=(const CpuBoundWork&) = delete;
|
||||
|
@ -345,8 +345,7 @@ bool EnsureValidBody(
|
||||
ApiUser::Ptr& authenticatedUser,
|
||||
boost::beast::http::response<boost::beast::http::string_body>& response,
|
||||
bool& shuttingDown,
|
||||
boost::asio::yield_context& yc,
|
||||
boost::asio::io_context::strand& strand
|
||||
boost::asio::yield_context& yc
|
||||
)
|
||||
{
|
||||
namespace http = boost::beast::http;
|
||||
@ -437,14 +436,13 @@ bool ProcessRequest(
|
||||
HttpServerConnection& server,
|
||||
CpuBoundWork*& m_HandlingRequest,
|
||||
bool& hasStartedStreaming,
|
||||
boost::asio::yield_context& yc,
|
||||
boost::asio::io_context::strand& strand
|
||||
boost::asio::yield_context& yc
|
||||
)
|
||||
{
|
||||
namespace http = boost::beast::http;
|
||||
|
||||
try {
|
||||
CpuBoundWork handlingRequest (yc, strand);
|
||||
CpuBoundWork handlingRequest (yc);
|
||||
Defer resetHandlingRequest ([&m_HandlingRequest] { m_HandlingRequest = nullptr; });
|
||||
m_HandlingRequest = &handlingRequest;
|
||||
|
||||
@ -554,13 +552,13 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!EnsureValidBody(*m_Stream, buf, parser, authenticatedUser, response, m_ShuttingDown, yc, m_IoStrand)) {
|
||||
if (!EnsureValidBody(*m_Stream, buf, parser, authenticatedUser, response, m_ShuttingDown, yc)) {
|
||||
break;
|
||||
}
|
||||
|
||||
m_Seen = std::numeric_limits<decltype(m_Seen)>::max();
|
||||
|
||||
if (!ProcessRequest(*m_Stream, request, authenticatedUser, response, *this, m_HandlingRequest, m_HasStartedStreaming, yc, m_IoStrand)) {
|
||||
if (!ProcessRequest(*m_Stream, request, authenticatedUser, response, *this, m_HandlingRequest, m_HasStartedStreaming, yc)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ void JsonRpcConnection::HandleIncomingMessages(boost::asio::yield_context yc)
|
||||
m_Seen = Utility::GetTime();
|
||||
|
||||
try {
|
||||
CpuBoundWork handleMessage (yc, m_IoStrand);
|
||||
CpuBoundWork handleMessage (yc);
|
||||
|
||||
MessageHandler(message);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user