proxy: use timestamps to handle reordered notifications

This commit is contained in:
Adrien Béraud committed 2020-01-03 14:47:22 -05:00
1 parent 87041e301f
commit dc2f354652
6 files changed
+40 -22

No files matched your search

+1
View File
@@ -705,6 +705,7 @@ DhtProxyServer::subscribe(restinio::request_handle_t request,
Json::Value json;
json["key"] = infoHash.toString();
json["to"] = clientId;
json["t"] = std::chrono::duration_cast<std::chrono::milliseconds>(system_clock::now().time_since_epoch()).count();
{
std::lock_guard<std::mutex> l(sessionCtx->lock);
json["s"] = sessionCtx->sessionId;