aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-07 18:59:27 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-07 18:59:27 +0000
commit461754ab044261ad9d09fdd93632763c8ecd159e (patch)
tree3f109485ae04b96afd361dff0c95ce9312b67803 /main
parent6544b164d8ff6c2ebac7b65a52956f0313d3a89f (diff)
Event well was going dry.
(issue #17234) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@268731 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/manager.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/manager.c b/main/manager.c
index bf08e7ef1..283a8410c 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -1064,6 +1064,11 @@ static void purge_events(void)
}
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&all_events, ev, eq_next) {
+ /* Never release the last event */
+ if (!AST_RWLIST_NEXT(ev, eq_next)) {
+ break;
+ }
+
/* 2.5 times whatever the HTTP timeout is (maximum 2.5 hours) is the maximum time that we will definitely cache an event */
if (ev->usecount == 0 && ast_tvdiff_sec(now, ev->tv) > (httptimeout > 3600 ? 3600 : httptimeout) * 2.5) {
AST_RWLIST_REMOVE_CURRENT(eq_next);