[asterisk-commits] twilson: branch 1.6.2 r272124 - in /branches/1.6.2: ./ apps/app_meetme.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 23 12:28:39 CDT 2010


Author: twilson
Date: Wed Jun 23 12:28:35 2010
New Revision: 272124

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=272124
Log:
Merged revisions 272109 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r272109 | twilson | 2010-06-23 12:21:40 -0500 (Wed, 23 Jun 2010) | 12 lines
  
  Make sure reload updates SLA config
  
  Even if there are no stations or trunks defined, we need to start the sla
  thread to make sure we get the reload event. Also, when doing a reload we need
  to remove the existing trunks and stations or they end up hanging around.
  
  (closes issue #16818)
  Reported by: mbonin
  Patches: 
        sla_reload.patch uploaded by twilson (license 396)
  Tested by: twilson
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/apps/app_meetme.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/apps/app_meetme.c?view=diff&rev=272124&r1=272123&r2=272124
==============================================================================
--- branches/1.6.2/apps/app_meetme.c (original)
+++ branches/1.6.2/apps/app_meetme.c Wed Jun 23 12:28:35 2010
@@ -5409,6 +5409,19 @@
 		return;
 	}
 
+	/* We need to actually delete the previous versions of trunks and stations now */
+	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&sla_stations, station, entry) {
+		AST_RWLIST_REMOVE_CURRENT(entry);
+		ast_free(station);
+	}
+	AST_RWLIST_TRAVERSE_SAFE_END;
+
+	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&sla_trunks, trunk, entry) {
+		AST_RWLIST_REMOVE_CURRENT(entry);
+		ast_free(trunk);
+	}
+	AST_RWLIST_TRAVERSE_SAFE_END;
+
 	/* yay */
 	sla_load_config(1);
 	sla.reload = 0;
@@ -5461,8 +5474,9 @@
 			ast_mutex_lock(&sla.lock);
 		}
 
-		if (sla.reload)
+		if (sla.reload) {
 			sla_check_reload();
+		}
 	}
 
 	ast_mutex_unlock(&sla.lock);
@@ -6339,8 +6353,11 @@
 
 	ast_config_destroy(cfg);
 
-	if (!reload && (!AST_LIST_EMPTY(&sla_stations) || !AST_LIST_EMPTY(&sla_stations)))
+	/* Even if we don't have any stations, we may after a reload and we need to
+	 * be able to process the SLA_EVENT_RELOAD event in that case */
+	if (!reload) {
 		ast_pthread_create(&sla.thread, NULL, sla_thread, NULL);
+	}
 
 	return res;
 }




More information about the asterisk-commits mailing list