[asterisk-commits] junky: branch junky/cli-tls r212241 - /team/junky/cli-tls/main/logger.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Aug 13 21:31:55 CDT 2009
Author: junky
Date: Thu Aug 13 21:31:51 2009
New Revision: 212241
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=212241
Log:
fix bug with the cleanup function (thanks Mark)
also, found a bug when adding the same filter twice, instead of returning CLI_FAILURE, i prefer specify the error and return CLI_SUCCESS.
Modified:
team/junky/cli-tls/main/logger.c
Modified: team/junky/cli-tls/main/logger.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/main/logger.c?view=diff&rev=212241&r1=212240&r2=212241
==============================================================================
--- team/junky/cli-tls/main/logger.c (original)
+++ team/junky/cli-tls/main/logger.c Thu Aug 13 21:31:51 2009
@@ -833,7 +833,8 @@
count = ast_filter_add(a->argv[3], a->argv[4]);
if (count <= 0 ) {
- return CLI_FAILURE;
+ ast_cli(a->fd, "Filter %s already exists.\n", a->argv[4]);
+ return CLI_SUCCESS;
} else {
ast_cli(a->fd, "%s sucessfully added to CLI filters.\n", a->argv[4]);
}
@@ -1784,18 +1785,19 @@
*/
static void filter_channel_cleanup(void *data)
{
- struct logger_filter_list_item *filter = data;
-
- my_printf("%s is called. data=%p\n", __PRETTY_FUNCTION__, data );
- if (filter ) {
+ struct ast_channels *channels = data;
+ struct logger_filter_list_item *filter;
+
+ printf("%s is called. data=%p\n", __PRETTY_FUNCTION__, data );
+ /*
+ if (channels) {
junky_printf("filter is there\n");
if ( filter->chan) {
my_printf("chan is there [%p]\n",filter->chan);
}
//ast_free(filter);
}
-
- /*
+ */
while ((filter = AST_LIST_REMOVE_HEAD(channels, next))) {
ast_log(LOG_WARNING, "filter will be removed.\n");
if ( filter->chan) {
@@ -1804,7 +1806,6 @@
ast_log(LOG_WARNING, "filter[%s] will be removed\n", filter->chan->name);
ast_free(filter);
}
- */
}
/*!
More information about the asterisk-commits
mailing list