mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-31 01:24:19 +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.
32 lines
710 B
C++
32 lines
710 B
C++
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
|
|
|
#ifndef VARIABLEQUERYHANDLER_H
|
|
#define VARIABLEQUERYHANDLER_H
|
|
|
|
#include "remote/httphandler.hpp"
|
|
|
|
namespace icinga
|
|
{
|
|
|
|
class VariableQueryHandler final : public HttpHandler
|
|
{
|
|
public:
|
|
DECLARE_PTR_TYPEDEFS(VariableQueryHandler);
|
|
|
|
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 /* VARIABLEQUERYHANDLER_H */
|