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

SearchNode: prevent copy, check request access

parent 488aa771
Branches
Tags
No related merge requests found
......@@ -76,6 +76,11 @@ struct Dht::SearchNode {
node is a new candidate for inclusion. */
SearchNode() : node() {}
SearchNode(const SearchNode&) = delete;
SearchNode(SearchNode&&) = default;
SearchNode& operator=(const SearchNode&) = delete;
SearchNode& operator=(SearchNode&&) = default;
SearchNode(const Sp<Node>& node) : node(node) {}
~SearchNode() {
if (node) {
......@@ -186,6 +191,7 @@ struct Dht::SearchNode {
node->cancelRequest(status.second);
}
}
getStatus.clear();
}
/**
......@@ -227,10 +233,11 @@ struct Dht::SearchNode {
void cancelAnnounce() {
for (const auto& status : acked) {
const auto& req = status.second.first;
if (req->pending()) {
if (req and req->pending()) {
node->cancelRequest(req);
}
}
acked.clear();
}
bool isListening(time_point now) const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment