From 2cbf5fdbe6ee5b12c30aee7ece7375a37448546f Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 29 Sep 2025 14:48:05 +0200 Subject: common 53fdfd2: Fix race condition in TCPDataDispatcher get_stats --- contrib/Socket.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/Socket.cpp') diff --git a/contrib/Socket.cpp b/contrib/Socket.cpp index 5c920d7..33c9c73 100644 --- a/contrib/Socket.cpp +++ b/contrib/Socket.cpp @@ -1152,6 +1152,7 @@ void TCPDataDispatcher::process() std::vector TCPDataDispatcher::get_stats() const { std::vector s; + auto lock = unique_lock(m_mutex); for (const auto& conn : m_connections) { s.push_back(conn.get_stats()); } -- cgit v1.2.3