mirror of https://github.com/Icinga/icinga2.git
Merge pull request #7238 from Icinga/bugfix/boost-1-70-7237
Fix build errors with Boost v1.70
This commit is contained in:
commit
8b5ebe9aa1
|
@ -4,6 +4,7 @@
|
||||||
#define TCPSOCKET_H
|
#define TCPSOCKET_H
|
||||||
|
|
||||||
#include "base/i2-base.hpp"
|
#include "base/i2-base.hpp"
|
||||||
|
#include "base/io-engine.hpp"
|
||||||
#include "base/socket.hpp"
|
#include "base/socket.hpp"
|
||||||
#include <boost/asio/ip/tcp.hpp>
|
#include <boost/asio/ip/tcp.hpp>
|
||||||
#include <boost/asio/spawn.hpp>
|
#include <boost/asio/spawn.hpp>
|
||||||
|
@ -37,7 +38,7 @@ void Connect(Socket& socket, const String& node, const String& service)
|
||||||
{
|
{
|
||||||
using boost::asio::ip::tcp;
|
using boost::asio::ip::tcp;
|
||||||
|
|
||||||
tcp::resolver resolver (socket.get_executor().context());
|
tcp::resolver resolver (IoEngine::Get().GetIoService());
|
||||||
tcp::resolver::query query (node, service);
|
tcp::resolver::query query (node, service);
|
||||||
auto result (resolver.resolve(query));
|
auto result (resolver.resolve(query));
|
||||||
auto current (result.begin());
|
auto current (result.begin());
|
||||||
|
@ -66,7 +67,7 @@ void Connect(Socket& socket, const String& node, const String& service, boost::a
|
||||||
{
|
{
|
||||||
using boost::asio::ip::tcp;
|
using boost::asio::ip::tcp;
|
||||||
|
|
||||||
tcp::resolver resolver (socket.get_executor().context());
|
tcp::resolver resolver (IoEngine::Get().GetIoService());
|
||||||
tcp::resolver::query query (node, service);
|
tcp::resolver::query query (node, service);
|
||||||
auto result (resolver.async_resolve(query, yc));
|
auto result (resolver.async_resolve(query, yc));
|
||||||
auto current (result.begin());
|
auto current (result.begin());
|
||||||
|
|
|
@ -417,7 +417,7 @@ void ApiListener::ListenerCoroutineProc(boost::asio::yield_context yc, const std
|
||||||
{
|
{
|
||||||
namespace asio = boost::asio;
|
namespace asio = boost::asio;
|
||||||
|
|
||||||
auto& io (server->get_executor().context());
|
auto& io (IoEngine::Get().GetIoService());
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
try {
|
try {
|
||||||
|
@ -651,7 +651,7 @@ void ApiListener::NewClientHandlerInternal(boost::asio::yield_context yc, const
|
||||||
|
|
||||||
endpoint->AddClient(aclient);
|
endpoint->AddClient(aclient);
|
||||||
|
|
||||||
asio::spawn(client->get_executor().context(), [this, aclient, endpoint, needSync](asio::yield_context yc) {
|
asio::spawn(IoEngine::Get().GetIoService(), [this, aclient, endpoint, needSync](asio::yield_context yc) {
|
||||||
CpuBoundWork syncClient (yc);
|
CpuBoundWork syncClient (yc);
|
||||||
|
|
||||||
SyncClient(aclient, endpoint, needSync);
|
SyncClient(aclient, endpoint, needSync);
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "base/configtype.hpp"
|
#include "base/configtype.hpp"
|
||||||
#include "base/defer.hpp"
|
#include "base/defer.hpp"
|
||||||
#include "base/exception.hpp"
|
#include "base/exception.hpp"
|
||||||
|
#include "base/io-engine.hpp"
|
||||||
#include "base/logger.hpp"
|
#include "base/logger.hpp"
|
||||||
#include "base/objectlock.hpp"
|
#include "base/objectlock.hpp"
|
||||||
#include "base/timer.hpp"
|
#include "base/timer.hpp"
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <boost/asio/io_service.hpp>
|
||||||
#include <boost/asio/spawn.hpp>
|
#include <boost/asio/spawn.hpp>
|
||||||
#include <boost/beast/core.hpp>
|
#include <boost/beast/core.hpp>
|
||||||
#include <boost/beast/http.hpp>
|
#include <boost/beast/http.hpp>
|
||||||
|
@ -31,8 +33,13 @@ using namespace icinga;
|
||||||
auto const l_ServerHeader ("Icinga/" + Application::GetAppVersion());
|
auto const l_ServerHeader ("Icinga/" + Application::GetAppVersion());
|
||||||
|
|
||||||
HttpServerConnection::HttpServerConnection(const String& identity, bool authenticated, const std::shared_ptr<AsioTlsStream>& stream)
|
HttpServerConnection::HttpServerConnection(const String& identity, bool authenticated, const std::shared_ptr<AsioTlsStream>& stream)
|
||||||
: m_Stream(stream), m_Seen(Utility::GetTime()), m_IoStrand(stream->get_executor().context()), m_ShuttingDown(false), m_HasStartedStreaming(false),
|
: HttpServerConnection(identity, authenticated, stream, IoEngine::Get().GetIoService())
|
||||||
m_CheckLivenessTimer(stream->get_executor().context())
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpServerConnection::HttpServerConnection(const String& identity, bool authenticated, const std::shared_ptr<AsioTlsStream>& stream, boost::asio::io_service& io)
|
||||||
|
: m_Stream(stream), m_Seen(Utility::GetTime()), m_IoStrand(io), m_ShuttingDown(false), m_HasStartedStreaming(false),
|
||||||
|
m_CheckLivenessTimer(io)
|
||||||
{
|
{
|
||||||
if (authenticated) {
|
if (authenticated) {
|
||||||
m_ApiUser = ApiUser::GetByClientCN(identity);
|
m_ApiUser = ApiUser::GetByClientCN(identity);
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "base/tlsstream.hpp"
|
#include "base/tlsstream.hpp"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <boost/asio/deadline_timer.hpp>
|
#include <boost/asio/deadline_timer.hpp>
|
||||||
|
#include <boost/asio/io_service.hpp>
|
||||||
#include <boost/asio/io_service_strand.hpp>
|
#include <boost/asio/io_service_strand.hpp>
|
||||||
#include <boost/asio/spawn.hpp>
|
#include <boost/asio/spawn.hpp>
|
||||||
|
|
||||||
|
@ -42,6 +43,8 @@ private:
|
||||||
bool m_HasStartedStreaming;
|
bool m_HasStartedStreaming;
|
||||||
boost::asio::deadline_timer m_CheckLivenessTimer;
|
boost::asio::deadline_timer m_CheckLivenessTimer;
|
||||||
|
|
||||||
|
HttpServerConnection(const String& identity, bool authenticated, const std::shared_ptr<AsioTlsStream>& stream, boost::asio::io_service& io);
|
||||||
|
|
||||||
void ProcessMessages(boost::asio::yield_context yc);
|
void ProcessMessages(boost::asio::yield_context yc);
|
||||||
void CheckLiveness(boost::asio::yield_context yc);
|
void CheckLiveness(boost::asio::yield_context yc);
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "base/tlsstream.hpp"
|
#include "base/tlsstream.hpp"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <boost/asio/io_service.hpp>
|
||||||
#include <boost/asio/spawn.hpp>
|
#include <boost/asio/spawn.hpp>
|
||||||
#include <boost/date_time/posix_time/posix_time_duration.hpp>
|
#include <boost/date_time/posix_time/posix_time_duration.hpp>
|
||||||
#include <boost/system/system_error.hpp>
|
#include <boost/system/system_error.hpp>
|
||||||
|
@ -30,10 +31,16 @@ static RingBuffer l_TaskStats (15 * 60);
|
||||||
|
|
||||||
JsonRpcConnection::JsonRpcConnection(const String& identity, bool authenticated,
|
JsonRpcConnection::JsonRpcConnection(const String& identity, bool authenticated,
|
||||||
const std::shared_ptr<AsioTlsStream>& stream, ConnectionRole role)
|
const std::shared_ptr<AsioTlsStream>& stream, ConnectionRole role)
|
||||||
: m_Identity(identity), m_Authenticated(authenticated), m_Stream(stream),
|
: JsonRpcConnection(identity, authenticated, stream, role, IoEngine::Get().GetIoService())
|
||||||
m_Role(role), m_Timestamp(Utility::GetTime()), m_Seen(Utility::GetTime()), m_NextHeartbeat(0), m_IoStrand(stream->get_executor().context()),
|
{
|
||||||
m_OutgoingMessagesQueued(stream->get_executor().context()), m_WriterDone(stream->get_executor().context()), m_ShuttingDown(false),
|
}
|
||||||
m_CheckLivenessTimer(stream->get_executor().context()), m_HeartbeatTimer(stream->get_executor().context())
|
|
||||||
|
JsonRpcConnection::JsonRpcConnection(const String& identity, bool authenticated,
|
||||||
|
const std::shared_ptr<AsioTlsStream>& stream, ConnectionRole role, boost::asio::io_service& io)
|
||||||
|
: m_Identity(identity), m_Authenticated(authenticated), m_Stream(stream), m_Role(role),
|
||||||
|
m_Timestamp(Utility::GetTime()), m_Seen(Utility::GetTime()), m_NextHeartbeat(0), m_IoStrand(io),
|
||||||
|
m_OutgoingMessagesQueued(io), m_WriterDone(io), m_ShuttingDown(false),
|
||||||
|
m_CheckLivenessTimer(io), m_HeartbeatTimer(io)
|
||||||
{
|
{
|
||||||
if (authenticated)
|
if (authenticated)
|
||||||
m_Endpoint = Endpoint::GetByName(identity);
|
m_Endpoint = Endpoint::GetByName(identity);
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "base/workqueue.hpp"
|
#include "base/workqueue.hpp"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/asio/deadline_timer.hpp>
|
#include <boost/asio/io_service.hpp>
|
||||||
#include <boost/asio/io_service_strand.hpp>
|
#include <boost/asio/io_service_strand.hpp>
|
||||||
#include <boost/asio/spawn.hpp>
|
#include <boost/asio/spawn.hpp>
|
||||||
|
|
||||||
|
@ -80,6 +80,8 @@ private:
|
||||||
bool m_ShuttingDown;
|
bool m_ShuttingDown;
|
||||||
boost::asio::deadline_timer m_CheckLivenessTimer, m_HeartbeatTimer;
|
boost::asio::deadline_timer m_CheckLivenessTimer, m_HeartbeatTimer;
|
||||||
|
|
||||||
|
JsonRpcConnection(const String& identity, bool authenticated, const std::shared_ptr<AsioTlsStream>& stream, ConnectionRole role, boost::asio::io_service& io);
|
||||||
|
|
||||||
void HandleIncomingMessages(boost::asio::yield_context yc);
|
void HandleIncomingMessages(boost::asio::yield_context yc);
|
||||||
void WriteOutgoingMessages(boost::asio::yield_context yc);
|
void WriteOutgoingMessages(boost::asio::yield_context yc);
|
||||||
void HandleAndWriteHeartbeats(boost::asio::yield_context yc);
|
void HandleAndWriteHeartbeats(boost::asio::yield_context yc);
|
||||||
|
|
Loading…
Reference in New Issue