Sentry: use locked contexts to send data to avoid races

This commit is contained in:
Lion Kortlepel
2021-08-10 12:28:06 +02:00
committed by Lion
parent 51e662fdda
commit 1409d4ef80
5 changed files with 9 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ void THeartbeatThread::operator()() {
debug("server returned \"" + T + "\"");
if (T.size() > std::string("YOU_SHALL_NOT_PASS").size()
&& Application::Settings.Key.size() == 36) {
auto Lock = Sentry.CreateExclusiveContext();
Sentry.AddExtra("response-body", T);
Sentry.AddExtra("request-body", Body);
Sentry.SetTransaction(Application::GetBackendHostname() + Target);