aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-01 10:43:40 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-01 10:43:40 +0000
commit07f51375e7fb3a7ec82103be3948ed91b6c857b6 (patch)
treed9a9673e2a3c38cef1f07a0a4fbcf6d92300fe1b /main
parent7d535b174453050770cf6545e77dd6ff60239f05 (diff)
Fix ast_event_queue_and_cache() to actually do the cache() part.
(closes issue #15624) Reported by: ffossard Tested by: russell git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209835 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/event.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/event.c b/main/event.c
index 351323a9d..070048b4b 100644
--- a/main/event.c
+++ b/main/event.c
@@ -1274,7 +1274,7 @@ static struct ast_event_ref *alloc_event_ref(void)
/*! \brief Duplicate an event and add it to the cache
* \note This assumes this index in to the cache is locked */
-static int attribute_unused ast_event_dup_and_cache(const struct ast_event *event)
+static int ast_event_dup_and_cache(const struct ast_event *event)
{
struct ast_event *dup_event;
struct ast_event_ref *event_ref;
@@ -1303,6 +1303,7 @@ int ast_event_queue_and_cache(struct ast_event *event)
struct ast_event_ref tmp_event_ref = {
.event = event,
};
+ int res = -1;
if (!(container = ast_event_cache[ast_event_get_type(event)].container)) {
ast_log(LOG_WARNING, "cache requested for non-cached event type\n");
@@ -1313,8 +1314,10 @@ int ast_event_queue_and_cache(struct ast_event *event)
ao2_callback(container, OBJ_POINTER | OBJ_UNLINK | OBJ_MULTIPLE | OBJ_NODATA,
ast_event_cmp, &tmp_event_ref);
+ res = ast_event_dup_and_cache(event);
+
queue_event:
- return ast_event_queue(event);
+ return ast_event_queue(event) ? -1 : res;
}
static int handle_event(void *data)