diff --git a/src/platform/Darwin/DnssdImpl.cpp b/src/platform/Darwin/DnssdImpl.cpp index 645c736fbb957a..1de1fac5dbd1c5 100644 --- a/src/platform/Darwin/DnssdImpl.cpp +++ b/src/platform/Darwin/DnssdImpl.cpp @@ -272,8 +272,9 @@ static void OnGetAddrInfo(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t i if (flags & kDNSServiceFlagsMoreComing) { - // If we have a timer running and we have resolved on the SRP domain but the kDNSServiceFlagsMoreComing - // is set, we need to cancel the timer so we don't pre-emptively call finalize(). + // If we now don't need to have a timer while we wait for SRP results, ensure that there is no such + // timer running. Otherwise the timer could fire before we get the rest of the results that flags + // say are coming, and trigger a finalize before we have all the data that is already available. if (sdCtx->isSRPTimerRunning && !sdCtx->shouldStartSRPTimerForResolve) { sdCtx->CancelSRPTimer();