mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
/v1/events: terminate on disconnect
This commit is contained in:
parent
4c5ee0dbbf
commit
2e5af2922b
@ -117,6 +117,8 @@ bool EventsHandler::HandleRequest(
|
|||||||
asio::async_write(stream, payload, yc);
|
asio::async_write(stream, payload, yc);
|
||||||
asio::async_write(stream, newLine, yc);
|
asio::async_write(stream, newLine, yc);
|
||||||
stream.async_flush(yc);
|
stream.async_flush(yc);
|
||||||
|
} else if (server.Disconnected()) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,6 +114,11 @@ void HttpServerConnection::StartStreaming()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HttpServerConnection::Disconnected()
|
||||||
|
{
|
||||||
|
return m_ShuttingDown;
|
||||||
|
}
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
bool EnsureValidHeaders(
|
bool EnsureValidHeaders(
|
||||||
AsioTlsStream& stream,
|
AsioTlsStream& stream,
|
||||||
|
@ -29,6 +29,8 @@ public:
|
|||||||
void Disconnect();
|
void Disconnect();
|
||||||
void StartStreaming();
|
void StartStreaming();
|
||||||
|
|
||||||
|
bool Disconnected();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ApiUser::Ptr m_ApiUser;
|
ApiUser::Ptr m_ApiUser;
|
||||||
std::shared_ptr<AsioTlsStream> m_Stream;
|
std::shared_ptr<AsioTlsStream> m_Stream;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user