rlc_am: don't build new PDUs if tx window is full

This commit is contained in:
Andre Puschmann 2018-02-07 20:49:04 +01:00
parent fe069073f0
commit bfb3155da6
1 changed files with 6 additions and 0 deletions

View File

@ -676,6 +676,12 @@ int rlc_am::build_data_pdu(uint8_t *payload, uint32_t nof_bytes)
return 0; 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; byte_buffer_t *pdu = pool_allocate;
if (!pdu) { if (!pdu) {
log->console("Fatal Error: Could not allocate PDU in build_data_pdu()\n"); log->console("Fatal Error: Could not allocate PDU in build_data_pdu()\n");