Skip to content

Commit c7d8647

Browse files
committed
supplementary comment
1 parent 7af15c4 commit c7d8647

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/lib/dnssd/Discovery_ImplPlatform.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,10 @@ bool DiscoveryImplPlatform::IsInitialized()
629629

630630
CHIP_ERROR DiscoveryImplPlatform::ResolveNodeId(const PeerId & peerId)
631631
{
632-
// Resolve requests can only be issued once DNSSD is initialized and there is
633-
// no caching currently
634-
// When the DNSSD is kInitializing, can also try to resolve.
632+
// It only determines that it is not in an uninitialized state, and cannot force initialization to be completed.
633+
// There are differences between platforms.
634+
// e.g. when a collision occurs on the Linux platform, initialization has not been completed at this time, but you can
635+
// still try to parse.
635636
VerifyOrReturnError(mState != State::kUninitialized, CHIP_ERROR_INCORRECT_STATE);
636637

637638
ChipLogProgress(Discovery, "Resolving " ChipLogFormatX64 ":" ChipLogFormatX64 " ...",

src/platform/Linux/DnssdImpl.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -383,17 +383,14 @@ void MdnsAvahi::HandleClientState(AvahiClient * client, AvahiClientState state)
383383
break;
384384
case AVAHI_CLIENT_FAILURE:
385385
ChipLogError(DeviceLayer, "Avahi client failure");
386-
// error happend, we should to restart dnssd.
387-
mErrorCallback(mAsyncReturnContext, CHIP_ERROR_FORCED_RESET);
386+
mErrorCallback(mAsyncReturnContext, CHIP_ERROR_INTERNAL);
388387
break;
389388
case AVAHI_CLIENT_S_COLLISION:
390-
ChipLogProgress(DeviceLayer, "Avahi collision, force to reset");
389+
ChipLogProgress(DeviceLayer, "Avahi collision");
391390
StopPublish();
392-
mErrorCallback(mAsyncReturnContext, CHIP_ERROR_FORCED_RESET);
393-
// Should restart the resolve service of the host.
391+
// DNSSD does not need to be restarted, it depends on the system resolve service restarting
394392
break;
395393
case AVAHI_CLIENT_S_REGISTERING:
396-
// now is registering, we should just StopPublish() without reset
397394
ChipLogProgress(DeviceLayer, "Avahi registering");
398395
StopPublish();
399396
break;

0 commit comments

Comments
 (0)