Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
9bb9d225
Commit
9bb9d225
authored
10 years ago
by
Joshua Colp
Committed by
Gerrit Code Review
10 years ago
Browse files
Options
Downloads
Plain Diff
Merge "pbx/pbx_spool: Fix issue when call files were executed too early"
parents
4f84142c
e6ebddd9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pbx/pbx_spool.c
+27
-8
27 additions, 8 deletions
pbx/pbx_spool.c
with
27 additions
and
8 deletions
pbx/pbx_spool.c
+
27
−
8
View file @
9bb9d225
...
@@ -102,6 +102,14 @@ struct outgoing {
...
@@ -102,6 +102,14 @@ struct outgoing {
};
};
#if defined(HAVE_INOTIFY) || defined(HAVE_KQUEUE)
#if defined(HAVE_INOTIFY) || defined(HAVE_KQUEUE)
struct
direntry
{
AST_LIST_ENTRY
(
direntry
)
list
;
time_t
mtime
;
char
name
[
0
];
};
static
AST_LIST_HEAD_STATIC
(
dirlist
,
direntry
);
static
void
queue_file
(
const
char
*
filename
,
time_t
when
);
static
void
queue_file
(
const
char
*
filename
,
time_t
when
);
#endif
#endif
...
@@ -323,6 +331,10 @@ static int remove_from_queue(struct outgoing *o, const char *status)
...
@@ -323,6 +331,10 @@ static int remove_from_queue(struct outgoing *o, const char *status)
char
newfn
[
256
];
char
newfn
[
256
];
const
char
*
bname
;
const
char
*
bname
;
#if defined(HAVE_INOTIFY) || defined(HAVE_KQUEUE)
struct
direntry
*
cur
;
#endif
if
(
!
ast_test_flag
(
&
o
->
options
,
SPOOL_FLAG_ALWAYS_DELETE
))
{
if
(
!
ast_test_flag
(
&
o
->
options
,
SPOOL_FLAG_ALWAYS_DELETE
))
{
struct
stat
current_file_status
;
struct
stat
current_file_status
;
...
@@ -333,6 +345,19 @@ static int remove_from_queue(struct outgoing *o, const char *status)
...
@@ -333,6 +345,19 @@ static int remove_from_queue(struct outgoing *o, const char *status)
}
}
}
}
#if defined(HAVE_INOTIFY) || defined(HAVE_KQUEUE)
AST_LIST_LOCK
(
&
dirlist
);
AST_LIST_TRAVERSE_SAFE_BEGIN
(
&
dirlist
,
cur
,
list
)
{
if
(
!
strcmp
(
cur
->
name
,
o
->
fn
))
{
AST_LIST_REMOVE_CURRENT
(
list
);
ast_free
(
cur
);
break
;
}
}
AST_LIST_TRAVERSE_SAFE_END
;
AST_LIST_UNLOCK
(
&
dirlist
);
#endif
if
(
!
ast_test_flag
(
&
o
->
options
,
SPOOL_FLAG_ARCHIVE
))
{
if
(
!
ast_test_flag
(
&
o
->
options
,
SPOOL_FLAG_ARCHIVE
))
{
unlink
(
o
->
fn
);
unlink
(
o
->
fn
);
return
0
;
return
0
;
...
@@ -486,14 +511,6 @@ static int scan_service(const char *fn, time_t now)
...
@@ -486,14 +511,6 @@ static int scan_service(const char *fn, time_t now)
return
0
;
return
0
;
}
}
#if defined(HAVE_INOTIFY) || defined(HAVE_KQUEUE)
struct
direntry
{
AST_LIST_ENTRY
(
direntry
)
list
;
time_t
mtime
;
char
name
[
0
];
};
static
AST_LIST_HEAD_STATIC
(
dirlist
,
direntry
);
#if defined(HAVE_INOTIFY)
#if defined(HAVE_INOTIFY)
/* Only one thread is accessing this list, so no lock is necessary */
/* Only one thread is accessing this list, so no lock is necessary */
...
@@ -501,6 +518,8 @@ static AST_LIST_HEAD_NOLOCK_STATIC(createlist, direntry);
...
@@ -501,6 +518,8 @@ static AST_LIST_HEAD_NOLOCK_STATIC(createlist, direntry);
static
AST_LIST_HEAD_NOLOCK_STATIC
(
openlist
,
direntry
);
static
AST_LIST_HEAD_NOLOCK_STATIC
(
openlist
,
direntry
);
#endif
#endif
#if defined(HAVE_INOTIFY) || defined(HAVE_KQUEUE)
static
void
queue_file
(
const
char
*
filename
,
time_t
when
)
static
void
queue_file
(
const
char
*
filename
,
time_t
when
)
{
{
struct
stat
st
;
struct
stat
st
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment