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

proxyserver: generate id before put

parent cc51d268
No related branches found
No related tags found
No related merge requests found
......@@ -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_;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment