[asterisk-commits] russell: trunk r315214 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 25 14:06:13 CDT 2011


Author: russell
Date: Mon Apr 25 14:06:08 2011
New Revision: 315214

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=315214
Log:
Merged revisions 315213 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r315213 | russell | 2011-04-25 14:04:28 -0500 (Mon, 25 Apr 2011) | 14 lines
  
  Merged revisions 315212 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r315212 | russell | 2011-04-25 14:00:24 -0500 (Mon, 25 Apr 2011) | 7 lines
    
    Don't link non-cached realtime peers into the peers_by_ip container.
    
    (closes issue #18924)
    Reported by: wdoekes
    Patches:
          issue18924_uncached_realtime_peers_leak-1.6.2.17.patch uploaded by wdoekes (license 717)
  ........
................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=315214&r1=315213&r2=315214
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Apr 25 14:06:08 2011
@@ -13609,7 +13609,7 @@
 	oldsin = peer->addr;
 
 	/* If we were already linked into the peers_by_ip container unlink ourselves so nobody can find us */
-	if (!ast_sockaddr_isnull(&peer->addr)) {
+	if (!ast_sockaddr_isnull(&peer->addr) && (!peer->is_realtime || ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS))) {
 		ao2_t_unlink(peers_by_ip, peer, "ao2_unlink of peer from peers_by_ip table");
 	}
 
@@ -13662,7 +13662,9 @@
 	}
 
 	/* Now that our address has been updated put ourselves back into the container for lookups */
-	ao2_t_link(peers_by_ip, peer, "ao2_link into peers_by_ip table");
+	if (!peer->is_realtime || ast_test_flag(&peer->flags[1], SIP_PAGE2_RTCACHEFRIENDS)) {
+		ao2_t_link(peers_by_ip, peer, "ao2_link into peers_by_ip table");
+	}
 
 	/* Save SIP options profile */
 	peer->sipoptions = pvt->sipoptions;
@@ -16394,6 +16396,8 @@
 		return CLI_SHOWUSAGE;
 	ast_cli(a->fd, "-= Peer objects: %d static, %d realtime, %d autocreate =-\n\n", speerobjs, rpeerobjs, apeerobjs);
 	ao2_t_callback(peers, OBJ_NODATA, peer_dump_func, a, "initiate ao2_callback to dump peers");
+	ast_cli(a->fd, "-= Peer objects by IP =-\n\n"); 
+	ao2_t_callback(peers_by_ip, OBJ_NODATA, peer_dump_func, a, "initiate ao2_callback to dump peers_by_ip");
 	ast_cli(a->fd, "-= Registry objects: %d =-\n\n", regobjs);
 	ASTOBJ_CONTAINER_DUMP(a->fd, tmp, sizeof(tmp), &regl);
 	ast_cli(a->fd, "-= Dialog objects:\n\n");




More information about the asterisk-commits mailing list