Summary:ASTERISK-04569: [patch] remove asterisk.conf from being loaded twice.
Reporter:Paul Belanger (pabelanger)Labels:
Date Opened:2005-07-12 12:56:33Date Closed:2008-01-15 15:42:43.000-0600
Versions:Frequency of
Environment:Attachments:( 0) asterisk.c.txt
( 1) asterisk.c-v2.txt
Description:Currently, when your start asterisk, it will parse asterisk.conf twice( ast_makesocket and ast_readconfig).  I have removed the code from ast_makesocket, and changed it to set the values in ast_readconfig.

There is some additional code cleaning within ast_makesocket and ast_readconfig aswell.


Let me know if you see a problem.
Comments:By: Kevin P. Fleming (kpfleming) 2005-07-12 15:00:24

This is wrong:

+ if (!ast_config_AST_CTL_OWNER) {

ast_config_AST_CTL_OWNER is a static-allocated buffer, it can never be 'NULL'. You will need to ensure that the buffers are initialized to an empty string ('\0') before reading the config file, then use ast_strlen_zero() to see if the buffer has any content.

Also, please remove the (char *) casts that litter this code; they have never been necessary, so this is a practical time to remove them as well.

By: Paul Belanger (pabelanger) 2005-07-12 20:53:10

kpfleming: Version 2 is now attached.  I have made the changes you requested.

One note, is you see a better way to initialize the buffer that did let me know.  Also have removed (char *)'s within ast_makesocket and ast_readconfig.

By: Kevin P. Fleming (kpfleming) 2005-07-25 19:02:53

Committed to CVS HEAD, thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:42:43.000-0600

Repository: asterisk
Revision: 6216

U   trunk/asterisk.c
U   trunk/include/asterisk.h

r6216 | kpfleming | 2008-01-15 15:42:42 -0600 (Tue, 15 Jan 2008) | 2 lines

process asterisk.conf in a single pass, instead of twice (bug ASTERISK-4569)