[asterisk-dev] [Code Review] rewrite of matching code in chan_sip.c realtime_peer()

Terry Wilson reviewboard at asterisk.org
Thu Sep 29 12:58:30 CDT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1395/#review4454
-----------------------------------------------------------


I like the way this patch looks. In my opinion, if we are going to do code refactoring that could potentially introduce behavior changes, we should confine those changes to trunk and update the CHANGES and UPGRADE.txt files to let users know what to expect. Since there are easier ways to fix the issue (without making the code really any uglier than it already is), I would vote for fixing 1.8 and 10 with the patch at https://reviewboard.asterisk.org/r/1465/ and then looking at this as an improvement to trunk. We don't have a lot of automated tests for realtime SIP, so refactoring is especially dangerous.

- Terry


On Aug. 27, 2011, 3:54 p.m., wdoekes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1395/
> -----------------------------------------------------------
> 
> (Updated Aug. 27, 2011, 3:54 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> 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't checked when host was not matched)
> - I don'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.
> 
> 
> This addresses bug ASTERISK-18356.
>     https://issues.asterisk.org/jira/browse/ASTERISK-18356
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/channels/chan_sip.c 333496 
> 
> Diff: https://reviewboard.asterisk.org/r/1395/diff
> 
> 
> Testing
> -------
> 
> 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'm too tired to test normal cases right now though.
> 
> 
> Thanks,
> 
> wdoekes
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110929/924e3cc4/attachment.htm>


More information about the asterisk-dev mailing list