whoops we were not clamping the jitter buffer size or max wait for peers to internal minimums/maximums;

pull/121/merge
Bryan Biedenkapp 6 days ago
parent 7c5df8abed
commit 7342f69fb9

@ -4,7 +4,7 @@
* GPLv2 Open Source. Use is subject to license terms. * GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* Copyright (C) 2025 Bryan Biedenkapp, N2PLL * Copyright (C) 2025-2026 Bryan Biedenkapp, N2PLL
* *
*/ */
/** /**
@ -175,13 +175,29 @@ namespace network
* @brief Sets the maximum buffer size. * @brief Sets the maximum buffer size.
* @param maxBufferSize Maximum number of frames to buffer. * @param maxBufferSize Maximum number of frames to buffer.
*/ */
void setMaxBufferSize(uint16_t maxBufferSize) { m_maxBufferSize = maxBufferSize; } void setMaxBufferSize(uint16_t maxBufferSize)
{
if (maxBufferSize < MIN_JITTER_MAX_SIZE)
maxBufferSize = MIN_JITTER_MAX_SIZE;
if (maxBufferSize > MAX_JITTER_MAX_SIZE)
maxBufferSize = MAX_JITTER_MAX_SIZE;
m_maxBufferSize = maxBufferSize;
}
/** /**
* @brief Sets the maximum wait time for out-of-order frames. * @brief Sets the maximum wait time for out-of-order frames.
* @param maxWaitTime Maximum wait time in microseconds. * @param maxWaitTime Maximum wait time in microseconds.
*/ */
void setMaxWaitTime(uint32_t maxWaitTime) { m_maxWaitTime = maxWaitTime; } void setMaxWaitTime(uint32_t maxWaitTime)
{
if (maxWaitTime < MIN_JITTER_MAX_WAIT)
maxWaitTime = MIN_JITTER_MAX_WAIT;
if (maxWaitTime > MAX_JITTER_MAX_WAIT)
maxWaitTime = MAX_JITTER_MAX_WAIT;
m_maxWaitTime = maxWaitTime;
}
private: private:
std::map<uint16_t, BufferedFrame*> m_buffer; std::map<uint16_t, BufferedFrame*> m_buffer;

Loading…
Cancel
Save

Powered by TurnKey Linux.