From: Tilghman Lesher Date: Mon, 7 Jun 2010 18:59:27 +0000 (+0000) Subject: Event well was going dry. X-Git-Tag: 11.0.0-beta1~2894 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de625d9c08f67982c16881282006282ea445a681;p=thirdparty%2Fasterisk.git Event well was going dry. (issue #17234) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268731 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/manager.c b/main/manager.c index bf08e7ef11..283a8410c8 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);