From 0d65c48105d19e74b1b1e37ebcec0bf96e82191b Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Thu, 1 Feb 2018 17:17:18 +0100 Subject: [PATCH] When RLC retx queue is empty, do not error and transmit a new tx --- lib/src/upper/rlc_am.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/src/upper/rlc_am.cc b/lib/src/upper/rlc_am.cc index d87d1240c..a5d7f19e7 100644 --- a/lib/src/upper/rlc_am.cc +++ b/lib/src/upper/rlc_am.cc @@ -315,8 +315,10 @@ int rlc_am::read_pdu(uint8_t *payload, uint32_t nof_bytes) // RETX if required if(retx_queue.size() > 0) { int ret = build_retx_pdu(payload, nof_bytes); - pthread_mutex_unlock(&mutex); - return ret; + if (ret) { + pthread_mutex_unlock(&mutex); + return ret; + } } // Build a PDU from SDUs @@ -471,8 +473,8 @@ int rlc_am::build_retx_pdu(uint8_t *payload, uint32_t nof_bytes) if (!retx_queue.empty()) { retx = retx_queue.front(); } else { - log->error("In build_retx_pdu(): retx_queue is empty during sanity check, sn=%d\n", retx.sn); - return -1; + log->info("In build_retx_pdu(): retx_queue is empty during sanity check, sn=%d\n", retx.sn); + return 0; } }