BUGFIX: correct issue where the pingTime configurable on the FNE could be greater then the maximum allowable timeout on the peers resulting in highly unstable configurations, the maximum allowable ping time is set to a hardcoded 60 second maximum;

4.31h_maint
Bryan Biedenkapp 8 months ago
parent f791f9ae58
commit baded95e1f

@ -69,6 +69,8 @@
#define TAG_ANNOUNCE "ANNC" #define TAG_ANNOUNCE "ANNC"
#define TAG_PEER_LINK "PRLNK" #define TAG_PEER_LINK "PRLNK"
#define MAX_PEER_PING_TIME 60U // 60 seconds
namespace network namespace network
{ {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------

@ -52,7 +52,7 @@ Network::Network(const std::string& address, uint16_t port, uint16_t localPort,
m_tidLookup(nullptr), m_tidLookup(nullptr),
m_salt(nullptr), m_salt(nullptr),
m_retryTimer(1000U, 10U), m_retryTimer(1000U, 10U),
m_timeoutTimer(1000U, 60U), m_timeoutTimer(1000U, MAX_PEER_PING_TIME),
m_pktSeq(0U), m_pktSeq(0U),
m_loginStreamId(0U), m_loginStreamId(0U),
m_metadata(nullptr), m_metadata(nullptr),

@ -337,6 +337,11 @@ bool HostFNE::readParams()
m_pingTime = 5U; m_pingTime = 5U;
} }
if (m_pingTime > MAX_PEER_PING_TIME - 1U) {
LogWarning(LOG_HOST, "Peer ping time is set to %u seconds, this is beyond the allowable maximum of %u seconds. Defaulting.", m_pingTime, MAX_PEER_PING_TIME);
m_pingTime = MAX_PEER_PING_TIME - 1U;
}
if (m_maxMissedPings == 0U) { if (m_maxMissedPings == 0U) {
m_maxMissedPings = 5U; m_maxMissedPings = 5U;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.