<p>Aaron An has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7618">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_rtp_asterisk: Avoid close the rtp/rtcp fd twice.<br><br>When RTCP-MUX enabled. rtp->s is the same as rtcp->s, check this before<br>close the file descriptor. Close the FD twice will hangs the asterisk<br>under heavy load.<br><br>ASTERISK-27299 #close<br>Reported-by: Aaron An<br>Tested-by: AaronAn<br><br>Change-Id: I870a072d73fd207463ac116ef97100addbc0820a<br>---<br>M res/res_rtp_asterisk.c<br>1 file changed, 2 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/18/7618/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c<br>index 51e509c..755ece8 100644<br>--- a/res/res_rtp_asterisk.c<br>+++ b/res/res_rtp_asterisk.c<br>@@ -3481,6 +3481,7 @@<br> <br> static void rtp_deallocate_transport(struct ast_rtp_instance *instance, struct ast_rtp *rtp)<br> {<br>+ int saved_rtp_s = rtp->s;<br> #ifdef HAVE_PJPROJECT<br> struct timeval wait = ast_tvadd(ast_tvnow(), ast_samp2tv(TURN_STATE_WAIT_TIME, 1000));<br> struct timespec ts = { .tv_sec = wait.tv_sec, .tv_nsec = wait.tv_usec * 1000, };<br>@@ -3497,7 +3498,7 @@<br> }<br> <br> /* Destroy RTCP if it was being used */<br>- if (rtp->rtcp && rtp->rtcp->s > -1) {<br>+ if (rtp->rtcp && rtp->rtcp->s > -1 && rtp->rtcp->s != saved_rtp_s) {<br> close(rtp->rtcp->s);<br> rtp->rtcp->s = -1;<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7618">change 7618</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7618"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I870a072d73fd207463ac116ef97100addbc0820a </div>
<div style="display:none"> Gerrit-Change-Number: 7618 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Aaron An <anjb@ti-net.com.cn> </div>