Skip to content

Commit e14ad02

Browse files
Fix race-condition in PerfdataWriterConnection::EnsureConnected
1 parent ea94dea commit e14ad02

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/perfdata/perfdatawriterconnection.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ void PerfdataWriterConnection::EnsureConnected(const boost::asio::yield_context&
133133
::Connect(stream->lowest_layer(), m_Host, m_Port, yc);
134134

135135
if constexpr (std::is_same_v<std::decay_t<decltype(stream)>, Shared<AsioTlsStream>::Ptr>) {
136+
if (m_Stopped) {
137+
BOOST_THROW_EXCEPTION(Stopped{});
138+
}
139+
136140
using type = boost::asio::ssl::stream_base::handshake_type;
137141

138142
stream->next_layer().async_handshake(type::client, yc);

0 commit comments

Comments
 (0)