mirror of
https://github.com/Icinga/icinga2.git
synced 2025-08-14 06:08:15 +02:00
The wait group gets passed to HttpServerConnection, then down to the HttpHandlers. For those handlers that modify the program state, the wait group is locked so ApiListener will wait on Stop() for the request to complete. If the request iterates over config objects, a further check on the state of the wait group is added to abort early and not delay program shutdown. In that case, 503 responses will be sent to the client. Additionally, in HttpServerConnection, no further requests than the one already started will be allowed once the wait group is joining.
34 lines
737 B
C++
34 lines
737 B
C++
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
|
|
|
#ifndef ACTIONSHANDLER_H
|
|
#define ACTIONSHANDLER_H
|
|
|
|
#include "remote/httphandler.hpp"
|
|
|
|
namespace icinga
|
|
{
|
|
|
|
class ActionsHandler final : public HttpHandler
|
|
{
|
|
public:
|
|
DECLARE_PTR_TYPEDEFS(ActionsHandler);
|
|
|
|
static thread_local ApiUser::Ptr AuthenticatedApiUser;
|
|
|
|
bool HandleRequest(
|
|
const WaitGroup::Ptr& waitGroup,
|
|
AsioTlsStream& stream,
|
|
const ApiUser::Ptr& user,
|
|
boost::beast::http::request<boost::beast::http::string_body>& request,
|
|
const Url::Ptr& url,
|
|
boost::beast::http::response<boost::beast::http::string_body>& response,
|
|
const Dictionary::Ptr& params,
|
|
boost::asio::yield_context& yc,
|
|
HttpServerConnection& server
|
|
) override;
|
|
};
|
|
|
|
}
|
|
|
|
#endif /* ACTIONSHANDLER_H */
|