aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-12-19 10:54:11 +0100
committerGitHub <[email protected]>2023-12-19 10:54:11 +0100
commita8c4854f60d72d083bd34b34a9ccccc7353d052c (patch)
treeb67f14491390e81142f8293a20bc200be58c3fbb /src/zenhttp
parentfix ChunkIndexToChunkHash indexing (#621) (diff)
downloadzen-a8c4854f60d72d083bd34b34a9ccccc7353d052c.tar.xz
zen-a8c4854f60d72d083bd34b34a9ccccc7353d052c.zip
various TSAN/ASAN/LeakAnalyzer fixes (#622)
* fix JobQueue test threading issue. The inner job queued with `QueueJob` would reference `I` from inside the captured closure which would subsequently disappear * made sure application exit is thread safe * don't try to access string data out of bounds * keep-alive flag is accessed from multiple threads * fix memory leaks in Zen upstream client code * TSAN fixes for Event
Diffstat (limited to 'src/zenhttp')
-rw-r--r--src/zenhttp/servers/httpparser.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/zenhttp/servers/httpparser.h b/src/zenhttp/servers/httpparser.h
index 219ac351d..bdbcab4d9 100644
--- a/src/zenhttp/servers/httpparser.h
+++ b/src/zenhttp/servers/httpparser.h
@@ -9,6 +9,8 @@ ZEN_THIRD_PARTY_INCLUDES_START
#include <http_parser.h>
ZEN_THIRD_PARTY_INCLUDES_END
+#include <atomic>
+
namespace zen {
class HttpRequestParserCallbacks
@@ -85,7 +87,7 @@ private:
int8_t m_ContentTypeHeaderIndex;
int8_t m_RangeHeaderIndex;
HttpVerb m_RequestVerb;
- bool m_KeepAlive = false;
+ std::atomic_bool m_KeepAlive{false};
bool m_Expect100Continue = false;
int m_RequestId = -1;
Oid m_SessionId{};