]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
UDPTL: Backport some fixes from v12 that should be in v11.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 18 Sep 2013 23:36:12 +0000 (23:36 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 18 Sep 2013 23:36:12 +0000 (23:36 +0000)
Backported the following as applied to udptl.c:
* -r398020 Fixup udpdl defaults if config file not present.
* -r398533 Fixup improper use of ao2_global_obj_replace().

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@399442 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/udptl.c

index 7f4936de6a66f54e6dd3326a6fb09784c33e4860..772da03ee5f23999477f692eb3d663f50eb4dea6 100644 (file)
@@ -1419,14 +1419,17 @@ static int removed_options_handler(const struct aco_option *opt, struct ast_vari
 
 static void __ast_udptl_reload(int reload)
 {
-       RAII_VAR(struct udptl_config *, udptl_cfg, udptl_snapshot_alloc(), ao2_cleanup);
-
        if (aco_process_config(&cfg_info, reload) == ACO_PROCESS_ERROR) {
                if (!reload) {
-                       if (!aco_set_defaults(&general_option, "general", udptl_cfg->general)) {
-                               ast_log(LOG_WARNING, "Could not load udptl config; using defaults\n");
-                               ao2_global_obj_replace(globals, udptl_cfg);
+                       RAII_VAR(struct udptl_config *, udptl_cfg, udptl_snapshot_alloc(), ao2_cleanup);
+
+                       if (aco_set_defaults(&general_option, "general", udptl_cfg->general)) {
+                               ast_log(LOG_ERROR, "Failed to load udptl.conf and failed to initialize defaults.\n");
+                               return;
                        }
+
+                       ast_log(LOG_NOTICE, "Could not load udptl config; using defaults\n");
+                       ao2_global_obj_replace_unref(globals, udptl_cfg);
                }
        }
 }