diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-09-12 23:30:03 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-09-12 23:30:03 +0000 |
commit | 08af5bb31222c39739b8ec216b403756fb250924 (patch) | |
tree | 790035cc6aca2440080bd357a68a09fdbbb2624c /res/res_jabber.c | |
parent | 5d39c767c12477610cf13f5c2e00e7eed7839352 (diff) |
Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiating
when a file is invalid from when a file is missing. This is most important when
we have two configuration files. Consider the following example:
Old system:
sip.conf users.conf Old result New result
======== ========== ========== ==========
Missing Missing SIP doesn't load SIP doesn't load
Missing OK SIP doesn't load SIP doesn't load
Missing Invalid SIP doesn't load SIP doesn't load
OK Missing SIP loads SIP loads
OK OK SIP loads SIP loads
OK Invalid SIP loads incompletely SIP doesn't load
Invalid Missing SIP doesn't load SIP doesn't load
Invalid OK SIP doesn't load SIP doesn't load
Invalid Invalid SIP doesn't load SIP doesn't load
So in the case when users.conf doesn't load because there's a typo that
disrupts the syntax, we may only partially load users, instead of failing with
an error, which may cause some calls not to get processed. Worse yet, the old
system would do this with no indication that anything was even wrong.
(closes issue #10690)
Reported by: dtyoo
Patches:
20080716__bug10690.diff.txt uploaded by Corydon76 (license 14)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_jabber.c')
-rw-r--r-- | res/res_jabber.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c index 8f8f91af8..38b1b5959 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -2883,7 +2883,7 @@ static int aji_load_config(int reload) /* Reset flags to default value */ ast_set_flag(&globalflags, AJI_AUTOREGISTER); - if (!cfg) { + if (cfg == CONFIG_STATUS_FILEMISSING || cfg == CONFIG_STATUS_FILEINVALID) { ast_log(LOG_WARNING, "No such configuration file %s\n", JABBER_CONFIG); return 0; } |