[asterisk-commits] mmichelson: branch group/CCSS_Monitor_Restructure r244226 - in /team/group/CC...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Feb 1 14:55:03 CST 2010
Author: mmichelson
Date: Mon Feb 1 14:55:01 2010
New Revision: 244226
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=244226
Log:
Change the last parameter of ast_cc_monitor_failed
The monitor type is not necessary. The monitor name is enough
to determine a unique item in the list pertaining to the passed-in
core ID. The last parameter has been restored to what it once
was, a debug string to output to the CC log level.
Modified:
team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h
team/group/CCSS_Monitor_Restructure/main/ccss.c
Modified: team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h?view=diff&rev=244226&r1=244225&r2=244226
==============================================================================
--- team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h (original)
+++ team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h Mon Feb 1 14:55:01 2010
@@ -1184,7 +1184,7 @@
* \param debug A debug message to print to the CC log
* \return void
*/
-int ast_cc_monitor_failed(int core_id, const char * const monitor_name, const char * const monitor_type);
+int ast_cc_monitor_failed(int core_id, const char * const monitor_name, const char * const debug);
/* END STATE CHANGE API */
Modified: team/group/CCSS_Monitor_Restructure/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/ccss.c?view=diff&rev=244226&r1=244225&r2=244226
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/ccss.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/ccss.c Mon Feb 1 14:55:01 2010
@@ -1041,7 +1041,7 @@
{
struct ast_cc_monitor *monitor = (struct ast_cc_monitor *) data;
monitor->available_timer_id = -1;
- return ast_cc_monitor_failed(monitor->core_id, monitor->interface->name, monitor->interface->monitor_type);
+ return ast_cc_monitor_failed(monitor->core_id, monitor->interface->name, "Available timer expired for monitor");
}
static int cc_generic_monitor_request_cc(struct ast_cc_monitor *monitor, int *available_timer_id)
@@ -3013,7 +3013,7 @@
struct ast_cc_monitor_failure_data {
const char *device_name;
- const char *monitor_type;
+ const char *debug;
int core_id;
};
@@ -3026,8 +3026,7 @@
AST_DLLIST_LOCK(core_instance->monitors);
AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN(core_instance->monitors, monitor_iter, next) {
if (monitor_iter->interface->monitor_class == AST_CC_DEVICE_MONITOR) {
- if (!strcmp(monitor_iter->interface->name, failure_data->device_name) &&
- !strcmp(monitor_iter->interface->monitor_type, failure_data->monitor_type)) {
+ if (!strcmp(monitor_iter->interface->name, failure_data->device_name)) {
AST_DLLIST_REMOVE_CURRENT(next);
cc_unref(monitor_iter, "Monitor reported failure. Unref list's reference.");
cc_unref(monitor_iter, "Monitor reported failure. Unref local reference.");
@@ -3044,10 +3043,13 @@
ast_cc_failed(core_instance->core_id, "All monitors have failed\n");
}
AST_DLLIST_UNLOCK(core_instance->monitors);
- return 0;
-}
-
-int ast_cc_monitor_failed(int core_id, const char *const monitor_name, const char * const monitor_type)
+ ast_free((char *) failure_data->device_name);
+ ast_free((char *) failure_data->debug);
+ ast_free(failure_data);
+ return 0;
+}
+
+int ast_cc_monitor_failed(int core_id, const char *const monitor_name, const char * const debug)
{
struct ast_cc_monitor_failure_data *failure_data;
int res;
@@ -3061,7 +3063,7 @@
return -1;
}
- if (!(failure_data->monitor_type = ast_strdup(monitor_type))) {
+ if (!(failure_data->debug = ast_strdup(debug))) {
ast_free((char *)failure_data->device_name);
ast_free(failure_data);
return -1;
@@ -3072,7 +3074,7 @@
res = ast_taskprocessor_push(cc_core_taskprocessor, cc_monitor_failed, failure_data);
if (res) {
ast_free((char *)failure_data->device_name);
- ast_free((char *)failure_data->monitor_type);
+ ast_free((char *)failure_data->debug);
ast_free(failure_data);
}
return res;
More information about the asterisk-commits
mailing list