mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
optimize file reading in pbx_spool (bug #3927)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -94,10 +94,8 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
|
|||||||
char buf[256];
|
char buf[256];
|
||||||
char *c, *c2;
|
char *c, *c2;
|
||||||
int lineno = 0;
|
int lineno = 0;
|
||||||
while(!feof(f)) {
|
while(fgets(buf, sizeof(buf), f)) {
|
||||||
fgets(buf, sizeof(buf), f);
|
|
||||||
lineno++;
|
lineno++;
|
||||||
if (!ast_strlen_zero(buf)) {
|
|
||||||
/* Trim comments */
|
/* Trim comments */
|
||||||
c = buf;
|
c = buf;
|
||||||
while ((c = strchr(c, '#'))) {
|
while ((c = strchr(c, '#'))) {
|
||||||
@@ -187,7 +185,6 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
|
|||||||
ast_log(LOG_NOTICE, "Syntax error at line %d of %s\n", lineno, fn);
|
ast_log(LOG_NOTICE, "Syntax error at line %d of %s\n", lineno, fn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
strncpy(o->fn, fn, sizeof(o->fn) - 1);
|
strncpy(o->fn, fn, sizeof(o->fn) - 1);
|
||||||
if (ast_strlen_zero(o->tech) || ast_strlen_zero(o->dest) || (ast_strlen_zero(o->app) && ast_strlen_zero(o->exten))) {
|
if (ast_strlen_zero(o->tech) || ast_strlen_zero(o->dest) || (ast_strlen_zero(o->app) && ast_strlen_zero(o->exten))) {
|
||||||
ast_log(LOG_WARNING, "At least one of app or extension must be specified, along with tech and dest in file %s\n", fn);
|
ast_log(LOG_WARNING, "At least one of app or extension must be specified, along with tech and dest in file %s\n", fn);
|
||||||
|
Reference in New Issue
Block a user