From 78465ad2a35ef7d5eae23bbd3480492d5c35a6e9 Mon Sep 17 00:00:00 2001 From: Jason Parker Date: Thu, 13 Dec 2007 00:18:04 +0000 Subject: Merged revisions 92696 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 (closes issue #10690) ........ r92696 | qwell | 2007-12-12 18:11:09 -0600 (Wed, 12 Dec 2007) | 7 lines If a typo is found in a config file, we previous continued on with what was already loaded. We do not want to do this (see bug below for details). This makes it so that if a [ is found without a ], the entire config will fail, and nothing in it will be loaded. Issue 10690. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92697 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_h323.c | 100 +++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) (limited to 'channels/chan_h323.c') diff --git a/channels/chan_h323.c b/channels/chan_h323.c index 6c5e7a35e..f6f138c87 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -2746,6 +2746,56 @@ static struct ast_cli_entry cli_h323[] = { AST_CLI_DEFINE(handle_cli_h323_show_tokens, "Show all active call tokens"), }; +static void delete_users(void) +{ + int pruned = 0; + + /* Delete all users */ + ASTOBJ_CONTAINER_WRLOCK(&userl); + ASTOBJ_CONTAINER_TRAVERSE(&userl, 1, do { + ASTOBJ_RDLOCK(iterator); + ASTOBJ_MARK(iterator); + ++pruned; + ASTOBJ_UNLOCK(iterator); + } while (0) ); + if (pruned) { + ASTOBJ_CONTAINER_PRUNE_MARKED(&userl, oh323_destroy_user); + } + ASTOBJ_CONTAINER_UNLOCK(&userl); + + ASTOBJ_CONTAINER_WRLOCK(&peerl); + ASTOBJ_CONTAINER_TRAVERSE(&peerl, 1, do { + ASTOBJ_RDLOCK(iterator); + ASTOBJ_MARK(iterator); + ASTOBJ_UNLOCK(iterator); + } while (0) ); + ASTOBJ_CONTAINER_UNLOCK(&peerl); +} + +static void delete_aliases(void) +{ + int pruned = 0; + + /* Delete all aliases */ + ASTOBJ_CONTAINER_WRLOCK(&aliasl); + ASTOBJ_CONTAINER_TRAVERSE(&aliasl, 1, do { + ASTOBJ_RDLOCK(iterator); + ASTOBJ_MARK(iterator); + ++pruned; + ASTOBJ_UNLOCK(iterator); + } while (0) ); + if (pruned) { + ASTOBJ_CONTAINER_PRUNE_MARKED(&aliasl, oh323_destroy_alias); + } + ASTOBJ_CONTAINER_UNLOCK(&aliasl); +} + +static void prune_peers(void) +{ + /* Prune peers who still are supposed to be deleted */ + ASTOBJ_CONTAINER_PRUNE_MARKED(&peerl, oh323_destroy_peer); +} + static int reload_config(int is_reload) { struct ast_config *cfg, *ucfg; @@ -2973,56 +3023,6 @@ static int reload_config(int is_reload) return 0; } -static void delete_users(void) -{ - int pruned = 0; - - /* Delete all users */ - ASTOBJ_CONTAINER_WRLOCK(&userl); - ASTOBJ_CONTAINER_TRAVERSE(&userl, 1, do { - ASTOBJ_RDLOCK(iterator); - ASTOBJ_MARK(iterator); - ++pruned; - ASTOBJ_UNLOCK(iterator); - } while (0) ); - if (pruned) { - ASTOBJ_CONTAINER_PRUNE_MARKED(&userl, oh323_destroy_user); - } - ASTOBJ_CONTAINER_UNLOCK(&userl); - - ASTOBJ_CONTAINER_WRLOCK(&peerl); - ASTOBJ_CONTAINER_TRAVERSE(&peerl, 1, do { - ASTOBJ_RDLOCK(iterator); - ASTOBJ_MARK(iterator); - ASTOBJ_UNLOCK(iterator); - } while (0) ); - ASTOBJ_CONTAINER_UNLOCK(&peerl); -} - -static void delete_aliases(void) -{ - int pruned = 0; - - /* Delete all aliases */ - ASTOBJ_CONTAINER_WRLOCK(&aliasl); - ASTOBJ_CONTAINER_TRAVERSE(&aliasl, 1, do { - ASTOBJ_RDLOCK(iterator); - ASTOBJ_MARK(iterator); - ++pruned; - ASTOBJ_UNLOCK(iterator); - } while (0) ); - if (pruned) { - ASTOBJ_CONTAINER_PRUNE_MARKED(&aliasl, oh323_destroy_alias); - } - ASTOBJ_CONTAINER_UNLOCK(&aliasl); -} - -static void prune_peers(void) -{ - /* Prune peers who still are supposed to be deleted */ - ASTOBJ_CONTAINER_PRUNE_MARKED(&peerl, oh323_destroy_peer); -} - static int h323_reload(void) { ast_mutex_lock(&h323_reload_lock); -- cgit v1.2.3