mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-25 20:02:37 +03:00
mDNS timeout: use real type (#8394)
This commit is contained in:
parent
26103a5827
commit
d18cbfb07d
@ -1030,6 +1030,8 @@ protected:
|
|||||||
esp8266::polledTimeout::oneShotMs m_TTLTimeout;
|
esp8266::polledTimeout::oneShotMs m_TTLTimeout;
|
||||||
timeoutLevel_t m_timeoutLevel;
|
timeoutLevel_t m_timeoutLevel;
|
||||||
|
|
||||||
|
using timeoutBase = decltype(m_TTLTimeout);
|
||||||
|
|
||||||
stcTTL(void);
|
stcTTL(void);
|
||||||
bool set(uint32_t p_u32TTL);
|
bool set(uint32_t p_u32TTL);
|
||||||
|
|
||||||
@ -1039,7 +1041,7 @@ protected:
|
|||||||
bool prepareDeletion(void);
|
bool prepareDeletion(void);
|
||||||
bool finalTimeoutLevel(void) const;
|
bool finalTimeoutLevel(void) const;
|
||||||
|
|
||||||
unsigned long timeout(void) const;
|
timeoutBase::timeType timeout(void) const;
|
||||||
};
|
};
|
||||||
#ifdef MDNS_IP4_SUPPORT
|
#ifdef MDNS_IP4_SUPPORT
|
||||||
/**
|
/**
|
||||||
|
@ -1663,22 +1663,19 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(vo
|
|||||||
/*
|
/*
|
||||||
MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout
|
MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout
|
||||||
*/
|
*/
|
||||||
unsigned long MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
|
MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
|
||||||
{
|
{
|
||||||
|
|
||||||
unsigned long timeout = esp8266::polledTimeout::oneShotMs::neverExpires;
|
|
||||||
|
|
||||||
if (TIMEOUTLEVEL_BASE == m_timeoutLevel) // 80%
|
if (TIMEOUTLEVEL_BASE == m_timeoutLevel) // 80%
|
||||||
{
|
{
|
||||||
timeout = (m_u32TTL * 800L); // to milliseconds
|
return (m_u32TTL * 800L); // to milliseconds
|
||||||
}
|
}
|
||||||
else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) && // >80% AND
|
else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) && // >80% AND
|
||||||
(TIMEOUTLEVEL_FINAL >= m_timeoutLevel)) // <= 100%
|
(TIMEOUTLEVEL_FINAL >= m_timeoutLevel)) // <= 100%
|
||||||
{
|
{
|
||||||
|
|
||||||
timeout = (m_u32TTL * 50L);
|
return (m_u32TTL * 50L);
|
||||||
} // else: invalid
|
} // else: invalid
|
||||||
return timeout;
|
return MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::neverExpires;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user