From 89bdfce8405cc4fc2d535823c2f882109394aac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Mon, 1 Jul 2019 12:10:51 -0400 Subject: [PATCH] dhtrunner: add proper locks for push notification --- src/dhtrunner.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dhtrunner.cpp b/src/dhtrunner.cpp index af782b3c..2998aacf 100644 --- a/src/dhtrunner.cpp +++ b/src/dhtrunner.cpp @@ -1005,6 +1005,7 @@ DhtRunner::enableProxy(bool proxify) void DhtRunner::forwardAllMessages(bool forward) { + std::lock_guard lck(dht_mtx); #ifdef OPENDHT_PROXY_SERVER #ifdef OPENDHT_PROXY_CLIENT if (dht_via_proxy_) @@ -1022,6 +1023,7 @@ DhtRunner::forwardAllMessages(bool forward) */ void DhtRunner::setPushNotificationToken(const std::string& token) { + std::lock_guard lck(dht_mtx); #if defined(OPENDHT_PROXY_CLIENT) && defined(OPENDHT_PUSH_NOTIFICATIONS) pushToken_ = token; if (dht_via_proxy_)