summaryrefslogtreecommitdiff
path: root/main/event.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2012-07-30 00:14:18 +0000
committerRussell Bryant <russell@russellbryant.com>2012-07-30 00:14:18 +0000
commitfd1114659298072d639b691095825b66252a2f3d (patch)
tree4c9dd5902d681793d7b8c5afaaab73dcafe70d52 /main/event.c
parent9850a075b7ebc2f3dc3aff6eebb646ca63e5bb92 (diff)
Add a "corosync ping" CLI command.
This patch adds a new CLI command to the res_corosync module. It is primarily used as a debugging tool. It lets you fire off an event which will cause res_corosync on other nodes in the cluster to place messages into the logger if everything is working ok. It verifies that the corosync communication is working as expected. I didn't put anything in the CHANGES file for this, because this module is new in Asterisk 11. There is already a generic "res_corosync new module" entry in there so I figure that covers it just fine. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/event.c')
-rw-r--r--main/event.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/event.c b/main/event.c
index f9cf2f4b3..7470eaddd 100644
--- a/main/event.c
+++ b/main/event.c
@@ -663,6 +663,10 @@ static int dump_cache_cb(void *obj, void *arg, int flags)
/*! \brief Dump the event cache for the subscribed event type */
void ast_event_dump_cache(const struct ast_event_sub *event_sub)
{
+ if (!ast_event_cache[event_sub->type].container) {
+ return;
+ }
+
ao2_callback(ast_event_cache[event_sub->type].container, OBJ_NODATA,
dump_cache_cb, (void *) event_sub);
}
@@ -1211,7 +1215,6 @@ struct ast_event *ast_event_new(enum ast_event_type type, ...)
struct ast_event *event;
enum ast_event_ie_type ie_type;
struct ast_event_ie_val *ie_val;
- int has_ie = 0;
AST_LIST_HEAD_NOLOCK_STATIC(ie_vals, ast_event_ie_val);
/* Invalid type */
@@ -1262,7 +1265,6 @@ struct ast_event *ast_event_new(enum ast_event_type type, ...)
if (insert) {
AST_LIST_INSERT_TAIL(&ie_vals, ie_value, entry);
- has_ie = 1;
} else {
ast_log(LOG_WARNING, "Unsupported PLTYPE(%d)\n", ie_value->ie_pltype);
}
@@ -1302,7 +1304,7 @@ struct ast_event *ast_event_new(enum ast_event_type type, ...)
}
}
- if (has_ie && !ast_event_get_ie_raw(event, AST_EVENT_IE_EID)) {
+ if (!ast_event_get_ie_raw(event, AST_EVENT_IE_EID)) {
/* If the event is originating on this server, add the server's
* entity ID to the event. */
ast_event_append_eid(&event);