mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
Disconnect HttpServerConnection when AsioTlsStream is shut down
This commit is contained in:
parent
ee64f85e9c
commit
ad39f83097
@ -66,6 +66,7 @@ void HttpServerConnection::Start()
|
|||||||
|
|
||||||
IoEngine::SpawnCoroutine(m_IoStrand, [this, keepAlive](asio::yield_context yc) { ProcessMessages(yc); });
|
IoEngine::SpawnCoroutine(m_IoStrand, [this, keepAlive](asio::yield_context yc) { ProcessMessages(yc); });
|
||||||
IoEngine::SpawnCoroutine(m_IoStrand, [this, keepAlive](asio::yield_context yc) { CheckLiveness(yc); });
|
IoEngine::SpawnCoroutine(m_IoStrand, [this, keepAlive](asio::yield_context yc) { CheckLiveness(yc); });
|
||||||
|
IoEngine::SpawnCoroutine(m_IoStrand, [this, keepAlive](asio::yield_context yc) { CheckStream(yc); });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -539,3 +540,21 @@ void HttpServerConnection::CheckLiveness(boost::asio::yield_context yc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the @c AsioTlsStream has been closed to shut down the connection.
|
||||||
|
*
|
||||||
|
* @param yc The yield context for the coroutine of this function
|
||||||
|
*/
|
||||||
|
void HttpServerConnection::CheckStream(boost::asio::yield_context yc)
|
||||||
|
{
|
||||||
|
using wait_type = boost::asio::socket_base::wait_type;
|
||||||
|
|
||||||
|
while(!m_ShuttingDown){
|
||||||
|
boost::system::error_code ec;
|
||||||
|
m_Stream->async_fill(yc[ec]);
|
||||||
|
if (ec) {
|
||||||
|
Disconnect(yc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -51,6 +51,7 @@ private:
|
|||||||
|
|
||||||
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);
|
||||||
|
void CheckStream(boost::asio::yield_context yc);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user