From bfb3155da681e5ac3bfffda38de6bbb55f6b820c Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 7 Feb 2018 20:49:04 +0100 Subject: [PATCH] rlc_am: don't build new PDUs if tx window is full --- lib/src/upper/rlc_am.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/upper/rlc_am.cc b/lib/src/upper/rlc_am.cc index 6fdf52966..c1129ff51 100644 --- a/lib/src/upper/rlc_am.cc +++ b/lib/src/upper/rlc_am.cc @@ -676,6 +676,12 @@ int rlc_am::build_data_pdu(uint8_t *payload, uint32_t nof_bytes) return 0; } + // do not build any more PDU if window is already full + if (!tx_sdu && tx_window.size() >= RLC_AM_WINDOW_SIZE) { + log->info("Tx window full.\n"); + return 0; + } + byte_buffer_t *pdu = pool_allocate; if (!pdu) { log->console("Fatal Error: Could not allocate PDU in build_data_pdu()\n");