[Asterisk-code-review] res_rtp_asterisk: Resolve loop when receive buffer is flushed (asterisk[16])
Joshua Colp
asteriskteam at digium.com
Fri Apr 17 06:06:40 CDT 2020
Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14208 )
Change subject: res_rtp_asterisk: Resolve loop when receive buffer is flushed
......................................................................
res_rtp_asterisk: Resolve loop when receive buffer is flushed
When the receive buffer was flushed by a received packet while it
already contained a packet with the same sequence number, Asterisk
never left the while loop which tried to order the packets.
This change makes it so if the packet is in the receive buffer it
is retrieved and freed allowing the buffer to empty.
ASTERISK-28827
Change-Id: Idaa376101bc1ac880047c49feb6faee773e718b3
---
M res/res_rtp_asterisk.c
1 file changed, 8 insertions(+), 0 deletions(-)
Approvals:
Joshua Colp: Looks good to me, approved; Approved for Submit
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, but someone else must approve
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 5dd5d35..75be561 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -7835,6 +7835,14 @@
ast_debug(2, "Inserted just received packet with sequence number '%d' in correct order on RTP instance '%p'\n",
seqno, instance);
}
+ /* It is possible due to packet retransmission for this packet to also exist in the receive
+ * buffer so we explicitly remove it in case this occurs, otherwise the receive buffer will
+ * never be empty.
+ */
+ payload = (struct ast_rtp_rtcp_nack_payload *)ast_data_buffer_remove(rtp->recv_buffer, seqno);
+ if (payload) {
+ ast_free(payload);
+ }
rtp->expectedrxseqno++;
if (rtp->expectedrxseqno == SEQNO_CYCLE_OVER) {
rtp->expectedrxseqno = 0;
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14208
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Idaa376101bc1ac880047c49feb6faee773e718b3
Gerrit-Change-Number: 14208
Gerrit-PatchSet: 4
Gerrit-Owner: nappsoft <infos at nappsoft.ch>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200417/197e9a7e/attachment.html>
More information about the asterisk-code-review
mailing list