Skip to content

Commit f11bfbc

Browse files
rlc_retx_queue: not add size of dropped retx if queue is full
1 parent 5872185 commit f11bfbc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/rlc/rlc_retx_queue.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,13 @@ class rlc_retx_queue
9292
/// \return True if the ReTx was added successfully; False if the queue was full.
9393
bool try_push(const rlc_tx_amd_retx& retx)
9494
{
95-
st.add(retx);
9695
rlc_retx_queue_item elem = {};
9796
elem.retx = retx;
98-
return queue.try_push(elem);
97+
bool success = queue.try_push(elem);
98+
if (success) {
99+
st.add(retx);
100+
}
101+
return success;
99102
}
100103

101104
/// \brief Removes the first element from the front together with any following invalid elements such that front is
@@ -118,7 +121,7 @@ class rlc_retx_queue
118121
return queue.top().retx;
119122
}
120123

121-
/// \brief Replaces the first valid element of the queue. Removes any leading invalid elements.
124+
/// \brief Replaces the first valid element of the queue.
122125
/// \param retx The ReTx to be written.
123126
void replace_front(const rlc_tx_amd_retx& retx)
124127
{

0 commit comments

Comments
 (0)