diff --git a/src/dht_proxy_client.cpp b/src/dht_proxy_client.cpp index a6a546275..533c30319 100644 --- a/src/dht_proxy_client.cpp +++ b/src/dht_proxy_client.cpp @@ -745,7 +745,10 @@ DhtProxyClient::onProxyInfos(const Json::Value& proxyInfos, const sa_family_t fa addresses.emplace_back(publicAddressV4_); if (publicAddressV6_) addresses.emplace_back(publicAddressV6_); - publicAddressChangedCb_(std::move(addresses)); + std::lock_guard lock(lockCallbacks_); + callbacks_.emplace_back([cb=publicAddressChangedCb_, addresses = std::move(addresses)](){ + cb(std::move(addresses)); + }); } if (!ipChanged && stats4_.good_nodes + stats6_.good_nodes) @@ -1202,7 +1205,7 @@ DhtProxyClient::restartListeners(const asio::error_code &ec) } void -DhtProxyClient::pushNotificationReceived(const std::map& notification) +DhtProxyClient::pushNotificationReceived([[maybe_unused]] const std::map& notification) { #ifdef OPENDHT_PUSH_NOTIFICATIONS { @@ -1301,13 +1304,11 @@ DhtProxyClient::pushNotificationReceived(const std::map