client: ignoreGUIDs()
This commit is contained in:
@@ -392,6 +392,16 @@ void Context::cacheClear(const std::string& name, cacheAction action)
|
||||
});
|
||||
}
|
||||
|
||||
void Context::ignoreServerGUIDs(const std::vector<ServerGUID>& guids)
|
||||
{
|
||||
if(!pvt)
|
||||
throw std::logic_error("NULL Context");
|
||||
|
||||
pvt->impl->manager.loop().call([this, &guids](){
|
||||
pvt->impl->ignoreServerGUIDs = guids;
|
||||
});
|
||||
}
|
||||
|
||||
Report Context::report() const
|
||||
{
|
||||
Report ret;
|
||||
@@ -671,6 +681,13 @@ void procSearchReply(ContextImpl& self, const SockAddr& src, Buffer& M, bool ist
|
||||
uint16_t nSearch = 0u;
|
||||
from_wire(M, nSearch);
|
||||
|
||||
if(M.good()) {
|
||||
for(const ServerGUID& ignore : self.ignoreServerGUIDs) {
|
||||
if(guid==ignore)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for(auto n : range(nSearch)) {
|
||||
(void)n;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user