mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
proxy client: take persistent put by reference
This commit is contained in:
1 parent
1c9acfe001
commit
cc37fb50e2
1 file changed
+2
-1
@@ -325,6 +325,7 @@ DhtProxyClient::put(const InfoHash& key, Sp<Value> 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<std::mutex> 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::map<std::string, std::string
|
||||
if (vidIt != notification.end()) {
|
||||
// Refresh put
|
||||
auto vid = std::stoull(vidIt->second);
|
||||
auto put = search.puts.at(vid);
|
||||
auto& put = search.puts.at(vid);
|
||||
scheduler.edit(put.refreshJob, scheduler.time());
|
||||
loopSignal_();
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user