Skip to content
Snippets Groups Projects
Commit 9f503dbb authored by Adrien Béraud's avatar Adrien Béraud
Browse files

proxy client: loopSignal on put refresh notification

parent 7e447812
No related branches found
No related tags found
No related merge requests found
...@@ -91,6 +91,7 @@ DhtProxyClient::startProxy() ...@@ -91,6 +91,7 @@ DhtProxyClient::startProxy()
if (serverHost_.empty()) return; if (serverHost_.empty()) return;
DHT_LOG.w("Staring proxy client to %s", serverHost_.c_str()); DHT_LOG.w("Staring proxy client to %s", serverHost_.c_str());
nextProxyConfirmation = scheduler.add(scheduler.time(), std::bind(&DhtProxyClient::confirmProxy, this)); nextProxyConfirmation = scheduler.add(scheduler.time(), std::bind(&DhtProxyClient::confirmProxy, this));
loopSignal_();
} }
DhtProxyClient::~DhtProxyClient() DhtProxyClient::~DhtProxyClient()
...@@ -647,6 +648,7 @@ DhtProxyClient::cancelListen(const InfoHash& key, size_t gtoken) { ...@@ -647,6 +648,7 @@ DhtProxyClient::cancelListen(const InfoHash& key, size_t gtoken) {
}); });
} }
scheduler.edit(it->second.opExpirationJob, ops.getExpiration()); scheduler.edit(it->second.opExpirationJob, ops.getExpiration());
loopSignal_();
return canceled; return canceled;
} }
...@@ -710,6 +712,7 @@ DhtProxyClient::doListen(const InfoHash& key, ValueCallback cb, Value::Filter fi ...@@ -710,6 +712,7 @@ DhtProxyClient::doListen(const InfoHash& key, ValueCallback cb, Value::Filter fi
} }
auto next = l->second.cache.onValues(expired ? new_values_empty : values, std::vector<Value::Id>{}, expired_ids, types, scheduler.time()); auto next = l->second.cache.onValues(expired ? new_values_empty : values, std::vector<Value::Id>{}, expired_ids, types, scheduler.time());
scheduler.edit(l->second.cacheExpirationJob, next); scheduler.edit(l->second.cacheExpirationJob, next);
loopSignal_();
return true; return true;
}; };
auto pushNotifToken = std::make_shared<proxy::ListenToken>(0); auto pushNotifToken = std::make_shared<proxy::ListenToken>(0);
...@@ -966,6 +969,7 @@ DhtProxyClient::pushNotificationReceived(const std::map<std::string, std::string ...@@ -966,6 +969,7 @@ DhtProxyClient::pushNotificationReceived(const std::map<std::string, std::string
auto vid = std::stoull(vidIt->second); auto vid = std::stoull(vidIt->second);
auto put = search.puts.at(vid); auto put = search.puts.at(vid);
scheduler.edit(put.refreshJob, scheduler.time()); scheduler.edit(put.refreshJob, scheduler.time());
loopSignal_();
} else { } else {
// Refresh listen // Refresh listen
for (auto& list : search.listeners) for (auto& list : search.listeners)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment