Don't re-cache the filename, but check to see if it already exists
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 2 Nov 2007 13:17:48 +0000 (13:17 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 2 Nov 2007 13:17:48 +0000 (13:17 +0000)
Reported by: jamesgolovich
Patch by: jamesgolovich
Closes issue #11144

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

main/config.c

index 88bfd8a..e2f0a8d 100644 (file)
@@ -818,6 +818,12 @@ static void config_cache_attribute(const char *configfile, enum config_cache_att
 
        switch (attrtype) {
        case ATTRIBUTE_INCLUDE:
+               AST_LIST_TRAVERSE(&cfmtime->includes, cfinclude, list) {
+                       if (!strcmp(cfinclude->include, filename)) {
+                               AST_LIST_UNLOCK(&cfmtime_head);
+                               return;
+                       }
+               }
                cfinclude = ast_calloc(1, sizeof(*cfinclude) + strlen(filename) + 1);
                if (!cfinclude) {
                        AST_LIST_UNLOCK(&cfmtime_head);