[asterisk-commits] wdoekes: branch 13 r424184 - in /branches/13: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Oct 1 05:09:52 CDT 2014
Author: wdoekes
Date: Wed Oct 1 05:09:49 2014
New Revision: 424184
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=424184
Log:
chan_sip: Simplify some unref code by removing unlink_peer_from_tables.
ASTERISK-22945 #related
Reported by: ibercom
Patches:
asterisk11-chan_sip-simplifies.patch uploaded by ibercom (License #6599)
........
Merged revisions 424181 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 424182 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 424183 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
branches/13/ (props changed)
branches/13/channels/chan_sip.c
Propchange: branches/13/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.
Modified: branches/13/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/channels/chan_sip.c?view=diff&rev=424184&r1=424183&r2=424184
==============================================================================
--- branches/13/channels/chan_sip.c (original)
+++ branches/13/channels/chan_sip.c Wed Oct 1 05:09:49 2014
@@ -3243,15 +3243,6 @@
unlink_peers_from_tables(SIP_PEERS_ALL);
}
-/* \brief Unlink single peer from all ao2 containers */
-static void unlink_peer_from_tables(struct sip_peer *peer)
-{
- ao2_t_unlink(peers, peer, "ao2_unlink of peer from peers table");
- if (!ast_sockaddr_isnull(&peer->addr)) {
- ao2_t_unlink(peers_by_ip, peer, "ao2_unlink of peer from peers_by_ip table");
- }
-}
-
/*! \brief maintain proper refcounts for a sip_pvt's outboundproxy
*
* This function sets pvt's outboundproxy pointer to the one referenced
@@ -15863,11 +15854,12 @@
if (peer->selfdestruct ||
ast_test_flag(&peer->flags[1], SIP_PAGE2_RTAUTOCLEAR)) {
- unlink_peer_from_tables(peer);
- } else if (!ast_sockaddr_isnull(&peer->addr)) {
- /* If we aren't self-destructing a temp_peer, we still need to unlink the peer
- * from the peers_by_ip table, otherwise we end up with multiple copies hanging
- * around each time a registration expires and the peer re-registers. */
+ ao2_t_unlink(peers, peer, "ao2_unlink of peer from peers table");
+ }
+ if (!ast_sockaddr_isnull(&peer->addr)) {
+ /* We still need to unlink the peer from the peers_by_ip table,
+ * otherwise we end up with multiple copies hanging around each
+ * time a registration expires and the peer re-registers. */
ao2_t_unlink(peers_by_ip, peer, "ao2_unlink of peer from peers_by_ip table");
}
More information about the asterisk-commits
mailing list