Skip to content

Commit

Permalink
Updated as per new review feedback and fixed builds
Browse files Browse the repository at this point in the history
  • Loading branch information
su-shanka committed May 31, 2024
1 parent 8b20629 commit efb2652
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/lib/dnssd/Discovery_ImplPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@ static void HandleNodeBrowse(void * context, DnssdService * services, size_t ser
auto & ipAddress = services[i].mAddress;

// mType(service name) exactly matches with operational service name
bool isOperationalBrowse = (strncmp(services[i].mType, kOperationalServiceName, sizeof(services[i].mType)) == 0 &&
strlen(services[i].mType) == strlen(kOperationalServiceName));
bool isOperationalBrowse = strcmp(services[i].mType, kOperationalServiceName) == 0;

// For operational browse result we currently don't need IP address hence skip resolution and handle differently.
if (isOperationalBrowse)
{
HandleNodeOperationalBrowse(context, &services[i], error);
}
// if SRV, TXT and AAAA records were received in DNS responses
// check whether SRV, TXT and AAAA records were received in DNS responses
else if (strlen(services[i].mHostName) == 0 || services[i].mTextEntrySize == 0 || !ipAddress.has_value())
{
ChipDnssdResolve(&services[i], services[i].mInterface, HandleNodeResolve, context);
Expand Down
3 changes: 1 addition & 2 deletions src/platform/Darwin/DnssdContexts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,7 @@ bool ResolveContext::TryReportingResultsForInterfaceIndex(uint32_t interfaceInde
DiscoveredNodeData nodeData;

// mType(service name) exactly matches with operational service name
if (strncmp(services[i].mType, kOperationalServiceName, sizeof(services[i].mType)) == 0 &&
strlen(services[i].mType) == strlen(kOperationalServiceName))
if (strncmp(service[i].mType, kOperationalServiceName) == 0)
{
service.ToDiscoveredOperationalNodeBrowseData(nodeData);
}
Expand Down

0 comments on commit efb2652

Please sign in to comment.