diff --git a/src/dht_proxy_client.cpp b/src/dht_proxy_client.cpp index 6874d6cd..b2e3f06a 100644 --- a/src/dht_proxy_client.cpp +++ b/src/dht_proxy_client.cpp @@ -325,6 +325,7 @@ DhtProxyClient::put(const InfoHash& key, Sp val, DoneCallback cb, time_po auto nextRefresh = scheduler.time() + proxy::OP_TIMEOUT; search->second.puts.erase(id); search->second.puts.emplace(id, PermanentPut {val, scheduler.add(nextRefresh, [this, key, id]{ + std::lock_guard lock(searchLock_); auto s = searches_.find(key); if (s != searches_.end()) { auto p = s->second.puts.find(id); @@ -967,7 +968,7 @@ DhtProxyClient::pushNotificationReceived(const std::mapsecond); - auto put = search.puts.at(vid); + auto& put = search.puts.at(vid); scheduler.edit(put.refreshJob, scheduler.time()); loopSignal_(); } else {