<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/1395/">https://reviewboard.asterisk.org/r/1395/</a>
     </td>
    </tr>
   </table>
   <br />



 <p>Ship it!</p>



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This passes my realtime tests. Any behavior changes are due to actual bugfixes. The one caveat I can think of is res_config_curl. All other config backends translate LIKE and wildcard queries to the proper native format. Since we now use a LIKE query in chan_sip where we didn&#39;t before, a user of chan_sip with res_config_curl whose HTTP app does not properly handle this situation, might have their setup broken. If the users are using their curl backend for many non-SIP realtime backends, they will have had to already support this. If they were only doing SIP, then they will have some updating to do. Considering the only other way to actually fix the bug would be to do tons of extra queries, I am personally OK with this and am giving this a Ship It. I will hold off on committing this until the end of the week to give asterisk-dev users to discuss this change.</pre>
 <br />







<p>- Terry</p>


<br />
<p>On October 13th, 2011, 5:32 a.m., wdoekes wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By wdoekes.</div>


<p style="color: grey;"><i>Updated Oct. 13, 2011, 5:32 a.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">There are several memory leaks in realtime_peer in chan_sip.c. For a thorough explanation, see the bug report.

Trying to patch those leaks would be making ugly code even uglier. This is an attempt at cleaning up the code a bit.

I attempted to keep the exact same behaviour as the original code, while increasing readability. (I had to clone the variable gotten from the peerlist to get proper cleanup behaviour.)

Differences:
- sippeers ipaddr is now checked even though sippeers host was not matched (I could not make sense of why ipaddr wasn&#39;t checked when host was not matched)
- I don&#39;t check sipregs for the insecure column
- the leaks should be gone ;)

Up for review here, because the changes are significant enough for me to have made (lots of) errors and because someone might feel that a rewrite is not the way to go.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I tested that I got the same behaviour for the tests mentioned in the bug report. The leaks are gone, the bevahour seemed the same.

I&#39;m too tired to test normal cases right now though.</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-18356">ASTERISK-18356</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/branches/1.8/configs/extconfig.conf.sample <span style="color: grey">(340769)</span></li>

 <li>/branches/1.8/include/asterisk/config.h <span style="color: grey">(340769)</span></li>

 <li>/branches/1.8/main/config.c <span style="color: grey">(340769)</span></li>

 <li>/branches/1.8/channels/chan_sip.c <span style="color: grey">(340769)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1395/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>