proxy client: implement getLocal(), getLocalById()

This commit is contained in:
Adrien Béraud committed 2018-03-16 13:34:41 -04:00
1 parent 2f4acd26d6
commit 647de16f1c
3 files changed
+57 -7

No files matched your search

+16
View File
@@ -84,6 +84,22 @@ DhtProxyClient::~DhtProxyClient()
cancelAllListeners();
}
std::vector<Sp<Value>>
DhtProxyClient::getLocal(const InfoHash& k, Value::Filter filter) const {
auto s = listeners_.find(k);
if (s == listeners_.end())
return {};
return s->second.ops.get(filter);
}
Sp<Value>
DhtProxyClient::getLocalById(const InfoHash& k, Value::Id id) const {
auto s = listeners_.find(k);
if (s == listeners_.end())
return {};
return s->second.ops.get(id);
}
void
DhtProxyClient::cancelAllOperations()
{