Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d18cbfb

Browse filesBrowse files
authored
mDNS timeout: use real type (esp8266#8394)
1 parent 26103a5 commit d18cbfb
Copy full SHA for d18cbfb

File tree

Expand file treeCollapse file tree

2 files changed

+7
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-8
lines changed

‎libraries/ESP8266mDNS/src/LEAmDNS.h

Copy file name to clipboardExpand all lines: libraries/ESP8266mDNS/src/LEAmDNS.h
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,8 @@ class MDNSResponder
10301030
esp8266::polledTimeout::oneShotMs m_TTLTimeout;
10311031
timeoutLevel_t m_timeoutLevel;
10321032

1033+
using timeoutBase = decltype(m_TTLTimeout);
1034+
10331035
stcTTL(void);
10341036
bool set(uint32_t p_u32TTL);
10351037

@@ -1039,7 +1041,7 @@ class MDNSResponder
10391041
bool prepareDeletion(void);
10401042
bool finalTimeoutLevel(void) const;
10411043

1042-
unsigned long timeout(void) const;
1044+
timeoutBase::timeType timeout(void) const;
10431045
};
10441046
#ifdef MDNS_IP4_SUPPORT
10451047
/**

‎libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp

Copy file name to clipboardExpand all lines: libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
+4-7Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,22 +1663,19 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(vo
16631663
/*
16641664
MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout
16651665
*/
1666-
unsigned long MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
1666+
MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
16671667
{
1668-
1669-
unsigned long timeout = esp8266::polledTimeout::oneShotMs::neverExpires;
1670-
16711668
if (TIMEOUTLEVEL_BASE == m_timeoutLevel) // 80%
16721669
{
1673-
timeout = (m_u32TTL * 800L); // to milliseconds
1670+
return (m_u32TTL * 800L); // to milliseconds
16741671
}
16751672
else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) && // >80% AND
16761673
(TIMEOUTLEVEL_FINAL >= m_timeoutLevel)) // <= 100%
16771674
{
16781675

1679-
timeout = (m_u32TTL * 50L);
1676+
return (m_u32TTL * 50L);
16801677
} // else: invalid
1681-
return timeout;
1678+
return MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::neverExpires;
16821679
}
16831680

16841681

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.