<p>Patch set 33:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11579">View Change</a></p><p>6 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11579/33/apps/app_audiosocket.c">File apps/app_audiosocket.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/11579/33/apps/app_audiosocket.c@115">Patch Set #33, Line 115:</a> <code style="font-family:monospace,monospace">                return -1;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">The audio socket needs to be closed before returning here.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/11579/33/apps/app_audiosocket.c@128">Patch Set #33, Line 128:</a> <code style="font-family:monospace,monospace">            return -1;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">The audio socket needs to be closed before returning here.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11579/33/doc/CHANGES-staging/feat_audiosocket.txt">File doc/CHANGES-staging/feat_audiosocket.txt:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/11579/33/doc/CHANGES-staging/feat_audiosocket.txt@4">Patch Set #33, Line 4:</a> <code style="font-family:monospace,monospace">applciation</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">s/applciation/application</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11579/33/res/res_audiosocket.c">File res/res_audiosocket.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/11579/33/res/res_audiosocket.c@149">Patch Set #33, Line 149:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">              } else {<br>                      ast_log(LOG_ERROR, "Connection to %s failed with unexpected error: %s\n",<br>                           ast_sockaddr_stringify(&addrs[i]), strerror(errno));<br>              }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think the connection needs to be closed here, and set to -1. Otherwise it's possible this function can return with a non connected socket.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/11579/33/res/res_audiosocket.c@162">Patch Set #33, Line 162:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">       if (chan && ast_autoservice_stop(chan) < 0) {<br>              ast_log(LOG_WARNING, "Failed to stop autoservice for channel %s\n",<br>         ast_channel_name(chan));<br>              return -1;<br>    }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Should we close the socket in this case too? It might be okay to continue in this case. If so then this should return 's' and not -1.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/11579/33/res/res_audiosocket.c@167">Patch Set #33, Line 167:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><br>        if (i == num_addrs) {<br>         ast_log(LOG_ERROR, "Failed to connect to AudioSocket service\n");<br>           return -1;<br>    }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This is an error, so I'd say close the socket before returning here.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11579">change 11579</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/11579"/><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-Change-Id: Ie866e6c4fa13178ec76f2a6971ad3590a3a588b5 </div>
<div style="display:none"> Gerrit-Change-Number: 11579 </div>
<div style="display:none"> Gerrit-PatchSet: 33 </div>
<div style="display:none"> Gerrit-Owner: Seán C. McCord <ulexus@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Seán C. McCord <ulexus@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 10 Jan 2020 15:57:04 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>