mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
proxy_server: return old values when resubscribe
This commit is contained in:
1 parent
e5b56cc0a5
commit
824a1bf5fa
1 file changed
+9
@@ -430,6 +430,15 @@ DhtProxyServer::subscribe(const std::shared_ptr<restbed::Session>& session)
|
||||
scheduler_.edit(listener.expireNotifyJob, timeout - proxy::OP_MARGIN);
|
||||
s->close(restbed::OK, "{}\n");
|
||||
schedulerCv_.notify_one();
|
||||
dht_->get(infoHash,
|
||||
[this, infoHash, pushToken, isAndroid, clientId](std::vector<std::shared_ptr<Value>> /*value*/) {
|
||||
// Build message content.
|
||||
Json::Value json;
|
||||
json["key"] = infoHash.toString();
|
||||
json["to"] = clientId;
|
||||
sendPushNotification(pushToken, json, isAndroid);
|
||||
return true;
|
||||
}, [](bool /*ok* */) {});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user