Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and nivi-apple committed Mar 29, 2024
1 parent 28de37b commit 797ddae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/platform/Darwin/DnssdContexts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ void RegisterContext::DispatchSuccess()
mHostNameRegistrar.Register();
}

BrowseContext * BrowseContext::sContextDispatchingSuccess = nullptr;
BrowseContext * BrowseContext::sContextDispatchingSuccess = nullptr;
std::vector<DnssdService> * BrowseContext::sDispatchedServices = nullptr;

BrowseContext::BrowseContext(void * cbContext, DnssdBrowseCallback cb, DnssdServiceProtocol cbContextProtocol)
Expand Down Expand Up @@ -370,7 +370,7 @@ void BrowseContext::DispatchPartialSuccess()
}
sDispatchedServices = &dnsServices;
callback(context, dnsServices.data(), dnsServices.size(), false, CHIP_NO_ERROR);
sDispatchedServices = nullptr;
sDispatchedServices = nullptr;
sContextDispatchingSuccess = nullptr;
services.clear();
}
Expand Down
13 changes: 9 additions & 4 deletions src/platform/Darwin/DnssdImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ static void OnResolve(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t inter
}
}

static CHIP_ERROR ResolveWithContext(ResolveContext * sdCtx, uint32_t interfaceId, const char * type, const char * name, const char * domain, ResolveContextWithType * contextWithType)
static CHIP_ERROR ResolveWithContext(ResolveContext * sdCtx, uint32_t interfaceId, const char * type, const char * name,
const char * domain, ResolveContextWithType * contextWithType)
{
auto sdRef = sdCtx->serviceRef; // Mandatory copy because of kDNSServiceFlagsShareConnection

Expand All @@ -396,7 +397,9 @@ static CHIP_ERROR Resolve(ResolveContext * sdCtx, uint32_t interfaceId, chip::In
// Otherwise we will try to resolve using both the local domain and the SRP domain.
if (domain != nullptr)
{
ReturnErrorOnFailure(ResolveWithContext(sdCtx, interfaceId, type, name, domain, IsSRPType(domain) ? &sdCtx->resolveContextWithSRPType : &sdCtx->resolveContextWithNonSRPType));
ReturnErrorOnFailure(
ResolveWithContext(sdCtx, interfaceId, type, name, domain,
IsSRPType(domain) ? &sdCtx->resolveContextWithSRPType : &sdCtx->resolveContextWithNonSRPType));
sdCtx->shoulStartSRPTimerForResolve = false;
}
else
Expand Down Expand Up @@ -574,8 +577,10 @@ CHIP_ERROR ChipDnssdResolve(DnssdService * service, chip::Inet::InterfaceId inte

if (BrowseContext::sContextDispatchingSuccess != nullptr)
{
for (size_t i = 0; i < BrowseContext::sDispatchedServices->size(); ++i) {
if (service == &BrowseContext::sDispatchedServices->at(i)) {
for (size_t i = 0; i < BrowseContext::sDispatchedServices->size(); ++i)
{
if (service == &BrowseContext::sDispatchedServices->at(i))
{
domain = BrowseContext::sContextDispatchingSuccess->services[i].second.c_str();
break;
}
Expand Down

0 comments on commit 797ddae

Please sign in to comment.