Compare commits

...
Author SHA1 Message Date
Adrien Béraud 9900d3cf15 proxyserver: generate id before put 2020-05-11 12:15:49 -04:00
2 changed files with 3 additions and 0 deletions

No files matched your search

+1
View File
@@ -316,6 +316,7 @@ private:
std::shared_ptr<DhtRunner> dht_;
Json::StreamWriterBuilder jsonBuilder_;
Json::CharReaderBuilder jsonReaderBuilder_;
std::mt19937_64 rd {crypto::getSeededRandomEngine<std::mt19937_64>()};
// http server
std::thread serverThread_;
+2
View File
@@ -964,6 +964,8 @@ DhtProxyServer::put(restinio::request_handle_t request,
return response.done();
}
}
if (value->id == Value::INVALID_ID)
value->id = std::uniform_int_distribution<Value::Id>{1}(rd);
}
auto vid = value->id;