m->NextScheduledSPRetry only relevant when m->DelaySleep is not set
authorcheshire@apple.com <cheshire@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Fri, 4 Sep 2009 18:32:01 +0000 (18:32 +0000)
committercheshire@apple.com <cheshire@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Fri, 4 Sep 2009 18:32:01 +0000 (18:32 +0000)
git-svn-id: http://svn.macosforge.org/repository/mDNSResponder/trunk@6651 214c2c4a-bf3b-4dcf-9390-e4dd3010487d

mDNSCore/DNSCommon.c
mDNSCore/mDNSEmbeddedAPI.h

index 5771c61..ca4078e 100644 (file)
@@ -2505,7 +2505,8 @@ mDNSlocal mDNSs32 GetNextScheduledEvent(const mDNS *const m)
 #endif
        if (e - m->NextCacheCheck        > 0) e = m->NextCacheCheck;
        if (e - m->NextScheduledSPS      > 0) e = m->NextScheduledSPS;
-       if (m->SleepLimit && e - m->NextScheduledSPRetry > 0) e = m->NextScheduledSPRetry;
+       // NextScheduledSPRetry only valid when DelaySleep not set
+       if (!m->DelaySleep && m->SleepLimit && e - m->NextScheduledSPRetry > 0) e = m->NextScheduledSPRetry;
        if (m->DelaySleep && e - m->DelaySleep           > 0) e = m->DelaySleep;
 
        if (m->SuppressSending)
@@ -2557,7 +2558,7 @@ mDNSexport void ShowTaskSchedulingError(mDNS *const m)
                LogMsg("Task Scheduling Error: m->NextScheduledNATOp %d",    m->timenow - m->NextScheduledNATOp);
        if (m->timenow - m->NextScheduledSPS      >= 0)
                LogMsg("Task Scheduling Error: m->NextScheduledSPS %d",      m->timenow - m->NextScheduledSPS);
-       if (m->SleepLimit && m->timenow - m->NextScheduledSPRetry >= 0)
+       if (!m->DelaySleep && m->SleepLimit && m->timenow - m->NextScheduledSPRetry >= 0)
                LogMsg("Task Scheduling Error: m->NextScheduledSPRetry %d",  m->timenow - m->NextScheduledSPRetry);
        if (m->DelaySleep && m->timenow - m->DelaySleep >= 0)
                LogMsg("Task Scheduling Error: m->DelaySleep %d",            m->timenow - m->DelaySleep);
index bd02bb7..0504708 100755 (executable)
@@ -1643,7 +1643,8 @@ struct mDNS_struct
        mDNSs32  DelaySleep;                            // To inhibit re-sleeping too quickly right after wake
        mDNSs32  SleepLimit;                            // Time window to allow deregistrations, etc.,
                                                                                // during which underying platform layer should inhibit system sleep
-       mDNSs32  NextScheduledSPRetry;          // Time next sleep proxy registration action is required. Only valid if SleepLimit is nonzero.
+       mDNSs32  NextScheduledSPRetry;          // Time next sleep proxy registration action is required.
+                                                                               // Only valid if SleepLimit is nonzero and DelaySleep is zero.
 
        // These fields only required for mDNS Searcher...
        DNSQuestion *Questions;                         // List of all registered questions, active and inactive