diff --git a/lib/remote/actionshandler.cpp b/lib/remote/actionshandler.cpp index 5d042fe73..251f8a82e 100644 --- a/lib/remote/actionshandler.cpp +++ b/lib/remote/actionshandler.cpp @@ -13,11 +13,14 @@ using namespace icinga; REGISTER_URLHANDLER("/v1/actions", ActionsHandler); bool ActionsHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/actionshandler.hpp b/lib/remote/actionshandler.hpp index 790796ac3..9c0463035 100644 --- a/lib/remote/actionshandler.hpp +++ b/lib/remote/actionshandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(ActionsHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; }; diff --git a/lib/remote/configfileshandler.cpp b/lib/remote/configfileshandler.cpp index 93b63ecd5..05def8655 100644 --- a/lib/remote/configfileshandler.cpp +++ b/lib/remote/configfileshandler.cpp @@ -13,11 +13,14 @@ using namespace icinga; REGISTER_URLHANDLER("/v1/config/files", ConfigFilesHandler); bool ConfigFilesHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/configfileshandler.hpp b/lib/remote/configfileshandler.hpp index 50b294493..1384c2b58 100644 --- a/lib/remote/configfileshandler.hpp +++ b/lib/remote/configfileshandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(ConfigFilesHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; }; diff --git a/lib/remote/configpackageshandler.cpp b/lib/remote/configpackageshandler.cpp index 606d232dd..2505de36a 100644 --- a/lib/remote/configpackageshandler.cpp +++ b/lib/remote/configpackageshandler.cpp @@ -11,11 +11,14 @@ using namespace icinga; REGISTER_URLHANDLER("/v1/config/packages", ConfigPackagesHandler); bool ConfigPackagesHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/configpackageshandler.hpp b/lib/remote/configpackageshandler.hpp index 395b778eb..2ae184c6a 100644 --- a/lib/remote/configpackageshandler.hpp +++ b/lib/remote/configpackageshandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(ConfigPackagesHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; private: diff --git a/lib/remote/configstageshandler.cpp b/lib/remote/configstageshandler.cpp index 2254511e1..067181f27 100644 --- a/lib/remote/configstageshandler.cpp +++ b/lib/remote/configstageshandler.cpp @@ -12,11 +12,14 @@ using namespace icinga; REGISTER_URLHANDLER("/v1/config/stages", ConfigStagesHandler); bool ConfigStagesHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/configstageshandler.hpp b/lib/remote/configstageshandler.hpp index aec7d4eee..4ee35ad91 100644 --- a/lib/remote/configstageshandler.hpp +++ b/lib/remote/configstageshandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(ConfigStagesHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; private: diff --git a/lib/remote/consolehandler.cpp b/lib/remote/consolehandler.cpp index f513b21c0..430a37cf3 100644 --- a/lib/remote/consolehandler.cpp +++ b/lib/remote/consolehandler.cpp @@ -54,11 +54,14 @@ static void EnsureFrameCleanupTimer() } bool ConsoleHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/consolehandler.hpp b/lib/remote/consolehandler.hpp index 0c0a12399..339f3ed86 100644 --- a/lib/remote/consolehandler.hpp +++ b/lib/remote/consolehandler.hpp @@ -23,11 +23,14 @@ public: DECLARE_PTR_TYPEDEFS(ConsoleHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; static std::vector GetAutocompletionSuggestions(const String& word, ScriptFrame& frame); diff --git a/lib/remote/createobjecthandler.cpp b/lib/remote/createobjecthandler.cpp index bf9cb990e..1f7ab6710 100644 --- a/lib/remote/createobjecthandler.cpp +++ b/lib/remote/createobjecthandler.cpp @@ -15,11 +15,14 @@ using namespace icinga; REGISTER_URLHANDLER("/v1/objects", CreateObjectHandler); bool CreateObjectHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/createobjecthandler.hpp b/lib/remote/createobjecthandler.hpp index 646b07fc6..ff42a62e6 100644 --- a/lib/remote/createobjecthandler.hpp +++ b/lib/remote/createobjecthandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(CreateObjectHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; }; diff --git a/lib/remote/deleteobjecthandler.cpp b/lib/remote/deleteobjecthandler.cpp index 996effea8..15951588e 100644 --- a/lib/remote/deleteobjecthandler.cpp +++ b/lib/remote/deleteobjecthandler.cpp @@ -15,11 +15,14 @@ using namespace icinga; REGISTER_URLHANDLER("/v1/objects", DeleteObjectHandler); bool DeleteObjectHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/deleteobjecthandler.hpp b/lib/remote/deleteobjecthandler.hpp index 97fbbc5be..3ecb0c71b 100644 --- a/lib/remote/deleteobjecthandler.hpp +++ b/lib/remote/deleteobjecthandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(DeleteObjectHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; }; diff --git a/lib/remote/eventshandler.cpp b/lib/remote/eventshandler.cpp index ed829706d..99843d481 100644 --- a/lib/remote/eventshandler.cpp +++ b/lib/remote/eventshandler.cpp @@ -5,8 +5,10 @@ #include "remote/filterutility.hpp" #include "config/configcompiler.hpp" #include "config/expression.hpp" +#include "base/defer.hpp" #include "base/objectlock.hpp" #include "base/json.hpp" +#include #include using namespace icinga; @@ -14,13 +16,17 @@ using namespace icinga; REGISTER_URLHANDLER("/v1/events", EventsHandler); bool EventsHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { + namespace asio = boost::asio; namespace http = boost::beast::http; if (url->GetPath().size() != 2) @@ -75,18 +81,24 @@ bool EventsHandler::HandleRequest( queue->AddClient(&request); + Defer removeClient ([&queue, &request, &queueName]() { + queue->RemoveClient(&request); + EventQueue::UnregisterIfUnused(queueName, queue); + }); + + hasStartedStreaming = true; + response.result(http::status::ok); response.set(http::field::content_type, "application/json"); + http::async_write(stream, response, yc); + stream.async_flush(yc); + + asio::const_buffer newLine ("\n", 1); + for (;;) { Dictionary::Ptr result = queue->WaitForEvent(&request); - if (!response.IsPeerConnected()) { - queue->RemoveClient(&request); - EventQueue::UnregisterIfUnused(queueName, queue); - return true; - } - if (!result) continue; @@ -94,14 +106,11 @@ bool EventsHandler::HandleRequest( boost::algorithm::replace_all(body, "\n", ""); - try { - response.WriteBody(body.CStr(), body.GetLength()); - response.WriteBody("\n", 1); - } catch (const std::exception&) { - queue->RemoveClient(&request); - EventQueue::UnregisterIfUnused(queueName, queue); - throw; - } + asio::const_buffer payload (body.CStr(), body.GetLength()); + + stream.async_write_some(payload, yc); + stream.async_write_some(newLine, yc); + stream.async_flush(yc); } } diff --git a/lib/remote/eventshandler.hpp b/lib/remote/eventshandler.hpp index d95d31bf1..cffeea503 100644 --- a/lib/remote/eventshandler.hpp +++ b/lib/remote/eventshandler.hpp @@ -15,11 +15,14 @@ public: DECLARE_PTR_TYPEDEFS(EventsHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; }; diff --git a/lib/remote/httphandler.cpp b/lib/remote/httphandler.cpp index d6ea3426b..c089c00ea 100644 --- a/lib/remote/httphandler.cpp +++ b/lib/remote/httphandler.cpp @@ -46,9 +46,12 @@ void HttpHandler::Register(const Url::Ptr& url, const HttpHandler::Ptr& handler) } void HttpHandler::ProcessRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, - boost::beast::http::response& response + boost::beast::http::response& response, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { Dictionary::Ptr node = m_UrlTree; @@ -96,7 +99,7 @@ void HttpHandler::ProcessRequest( bool processed = false; for (const HttpHandler::Ptr& handler : handlers) { - if (handler->HandleRequest(user, request, url, response, params)) { + if (handler->HandleRequest(stream, user, request, url, response, params, yc, hasStartedStreaming)) { processed = true; break; } diff --git a/lib/remote/httphandler.hpp b/lib/remote/httphandler.hpp index 7e74329e0..cec5f58cd 100644 --- a/lib/remote/httphandler.hpp +++ b/lib/remote/httphandler.hpp @@ -8,7 +8,9 @@ #include "remote/httpresponse.hpp" #include "remote/apiuser.hpp" #include "base/registry.hpp" +#include "base/tlsstream.hpp" #include +#include #include namespace icinga @@ -25,18 +27,24 @@ public: DECLARE_PTR_TYPEDEFS(HttpHandler); virtual bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) = 0; static void Register(const Url::Ptr& url, const HttpHandler::Ptr& handler); static void ProcessRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, - boost::beast::http::response& response + boost::beast::http::response& response, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ); private: diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp index 87db3da5c..7ea206f5f 100644 --- a/lib/remote/httpserverconnection.cpp +++ b/lib/remote/httpserverconnection.cpp @@ -311,7 +311,7 @@ bool EnsureValidBody( } static inline -void ProcessRequest( +bool ProcessRequest( AsioTlsStream& stream, boost::beast::http::request& request, ApiUser::Ptr& authenticatedUser, @@ -321,11 +321,17 @@ void ProcessRequest( { namespace http = boost::beast::http; + bool hasStartedStreaming = false; + try { CpuBoundWork handlingRequest (yc); - HttpHandler::ProcessRequest(authenticatedUser, request, response); + HttpHandler::ProcessRequest(stream, authenticatedUser, request, response, yc, hasStartedStreaming); } catch (const std::exception& ex) { + if (hasStartedStreaming) { + return false; + } + http::response response; HttpUtility::SendJsonError(response, nullptr, 500, "Unhandled exception" , DiagnosticInformation(ex)); @@ -333,11 +339,17 @@ void ProcessRequest( http::async_write(stream, response, yc); stream.async_flush(yc); - return; + return true; + } + + if (hasStartedStreaming) { + return false; } http::async_write(stream, response, yc); stream.async_flush(yc); + + return true; } void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc) @@ -419,7 +431,9 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc) break; } - ProcessRequest(*m_Stream, request, authenticatedUser, response, yc); + if (!ProcessRequest(*m_Stream, request, authenticatedUser, response, yc)) { + break; + } if (request.version() != 11 || request[http::field::connection] == "close") { break; diff --git a/lib/remote/infohandler.cpp b/lib/remote/infohandler.cpp index c605cca8b..38f99781d 100644 --- a/lib/remote/infohandler.cpp +++ b/lib/remote/infohandler.cpp @@ -9,11 +9,14 @@ using namespace icinga; REGISTER_URLHANDLER("/", InfoHandler); bool InfoHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/infohandler.hpp b/lib/remote/infohandler.hpp index 418bb9b4b..346340d81 100644 --- a/lib/remote/infohandler.hpp +++ b/lib/remote/infohandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(InfoHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; }; diff --git a/lib/remote/modifyobjecthandler.cpp b/lib/remote/modifyobjecthandler.cpp index af800cce1..2150903a1 100644 --- a/lib/remote/modifyobjecthandler.cpp +++ b/lib/remote/modifyobjecthandler.cpp @@ -13,11 +13,14 @@ using namespace icinga; REGISTER_URLHANDLER("/v1/objects", ModifyObjectHandler); bool ModifyObjectHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/modifyobjecthandler.hpp b/lib/remote/modifyobjecthandler.hpp index e63304beb..c9bb21612 100644 --- a/lib/remote/modifyobjecthandler.hpp +++ b/lib/remote/modifyobjecthandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(ModifyObjectHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; }; diff --git a/lib/remote/objectqueryhandler.cpp b/lib/remote/objectqueryhandler.cpp index 63a67d853..2d9b79845 100644 --- a/lib/remote/objectqueryhandler.cpp +++ b/lib/remote/objectqueryhandler.cpp @@ -88,11 +88,14 @@ Dictionary::Ptr ObjectQueryHandler::SerializeObjectAttrs(const Object::Ptr& obje } bool ObjectQueryHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/objectqueryhandler.hpp b/lib/remote/objectqueryhandler.hpp index 86d3ef878..c35ff4066 100644 --- a/lib/remote/objectqueryhandler.hpp +++ b/lib/remote/objectqueryhandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(ObjectQueryHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; private: diff --git a/lib/remote/statushandler.cpp b/lib/remote/statushandler.cpp index 9b1175ba4..cc725e4f4 100644 --- a/lib/remote/statushandler.cpp +++ b/lib/remote/statushandler.cpp @@ -69,11 +69,14 @@ public: }; bool StatusHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/statushandler.hpp b/lib/remote/statushandler.hpp index a26161612..36f5efcf1 100644 --- a/lib/remote/statushandler.hpp +++ b/lib/remote/statushandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(StatusHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; }; diff --git a/lib/remote/templatequeryhandler.cpp b/lib/remote/templatequeryhandler.cpp index 9508163b1..38a225540 100644 --- a/lib/remote/templatequeryhandler.cpp +++ b/lib/remote/templatequeryhandler.cpp @@ -76,11 +76,14 @@ public: }; bool TemplateQueryHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/templatequeryhandler.hpp b/lib/remote/templatequeryhandler.hpp index e98bcd249..e9dec8896 100644 --- a/lib/remote/templatequeryhandler.hpp +++ b/lib/remote/templatequeryhandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(TemplateQueryHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; }; diff --git a/lib/remote/typequeryhandler.cpp b/lib/remote/typequeryhandler.cpp index 70c83f7e7..077113774 100644 --- a/lib/remote/typequeryhandler.cpp +++ b/lib/remote/typequeryhandler.cpp @@ -47,11 +47,14 @@ public: }; bool TypeQueryHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/typequeryhandler.hpp b/lib/remote/typequeryhandler.hpp index 69d65baec..84c04185d 100644 --- a/lib/remote/typequeryhandler.hpp +++ b/lib/remote/typequeryhandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(TypeQueryHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; }; diff --git a/lib/remote/variablequeryhandler.cpp b/lib/remote/variablequeryhandler.cpp index dcf01d3e9..05b503783 100644 --- a/lib/remote/variablequeryhandler.cpp +++ b/lib/remote/variablequeryhandler.cpp @@ -57,11 +57,14 @@ public: }; bool VariableQueryHandler::HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) { namespace http = boost::beast::http; diff --git a/lib/remote/variablequeryhandler.hpp b/lib/remote/variablequeryhandler.hpp index 5da2e13ab..ecc71a96a 100644 --- a/lib/remote/variablequeryhandler.hpp +++ b/lib/remote/variablequeryhandler.hpp @@ -14,11 +14,14 @@ public: DECLARE_PTR_TYPEDEFS(VariableQueryHandler); bool HandleRequest( + AsioTlsStream& stream, const ApiUser::Ptr& user, boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, - const Dictionary::Ptr& params + const Dictionary::Ptr& params, + boost::asio::yield_context& yc, + bool& hasStartedStreaming ) override; };