<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10385">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Corey Farrell: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_statsd.c: Made use defaults if the statsd.conf file does not exist.<br><br>This module is an optional dependency of many modules. If it declines to<br>load it then forces other modules that can optionally use this module to<br>also decline.<br><br>* Made use default configuration if there is a config error or the config<br>file does not exist.<br><br>Change-Id: If1068a582ec54ab7fb437265cb5370a97a825737<br>---<br>M res/res_statsd.c<br>1 file changed, 19 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_statsd.c b/res/res_statsd.c</span><br><span>index 3e08152..3e52c21 100644</span><br><span>--- a/res/res_statsd.c</span><br><span>+++ b/res/res_statsd.c</span><br><span>@@ -339,9 +339,25 @@</span><br><span> "", OPT_CHAR_ARRAY_T, 0,</span><br><span> CHARFLDSET(struct conf_global_options, prefix));</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (aco_process_config(&cfg_info, 0)) {</span><br><span style="color: hsl(0, 100%, 40%);">- aco_info_destroy(&cfg_info);</span><br><span style="color: hsl(0, 100%, 40%);">- return AST_MODULE_LOAD_DECLINE;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {</span><br><span style="color: hsl(120, 100%, 40%);">+ struct conf *cfg;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_NOTICE, "Could not load statsd config; using defaults\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ cfg = conf_alloc();</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!cfg) {</span><br><span style="color: hsl(120, 100%, 40%);">+ aco_info_destroy(&cfg_info);</span><br><span style="color: hsl(120, 100%, 40%);">+ return AST_MODULE_LOAD_DECLINE;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (aco_set_defaults(&global_option, "general", cfg->global)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_ERROR, "Failed to initialize statsd defaults.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_ref(cfg, -1);</span><br><span style="color: hsl(120, 100%, 40%);">+ aco_info_destroy(&cfg_info);</span><br><span style="color: hsl(120, 100%, 40%);">+ return AST_MODULE_LOAD_DECLINE;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_global_obj_replace_unref(confs, cfg);</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_ref(cfg, -1);</span><br><span> }</span><br><span> </span><br><span> if (!is_enabled()) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10385">change 10385</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10385"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: If1068a582ec54ab7fb437265cb5370a97a825737 </div>
<div style="display:none"> Gerrit-Change-Number: 10385 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>