Skip to content

Commit

Permalink
Fix service remove marked as removed by Avahi (#19449)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq authored and pull[bot] committed Aug 2, 2022
1 parent e476e4e commit 1118500
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/platform/Linux/DnssdImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,10 @@ void MdnsAvahi::HandleBrowse(AvahiServiceBrowser * browser, AvahiIfIndex interfa
ChipLogProgress(DeviceLayer, "Avahi browse: remove");
if (strcmp("local", domain) == 0)
{
std::remove_if(context->mServices.begin(), context->mServices.end(), [name, type](const DnssdService & service) {
return strcmp(name, service.mName) == 0 && type == GetFullType(service.mType, service.mProtocol);
});
context->mServices.erase(
std::remove_if(context->mServices.begin(), context->mServices.end(), [name, type](const DnssdService & service) {
return strcmp(name, service.mName) == 0 && type == GetFullType(service.mType, service.mProtocol);
}));
}
break;
case AVAHI_BROWSER_CACHE_EXHAUSTED:
Expand Down

0 comments on commit 1118500

Please sign in to comment.