[asterisk-commits] trunk - commit revision 7223

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Nov 29 21:16:54 CST 2005


Author: kpfleming
Date: Tue Nov 29 21:16:53 2005
New Revision: 7223

URL: http://svn.digium.com/view/asterisk?rev=7223&view=rev
Log:
free write frames when spy queues provide frames that don't need to be dup'd
properly lock and trigger spies when detaching them en masse

Modified:
    trunk/channel.c

Modified: trunk/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/channel.c?rev=7223&r1=7222&r2=7223&view=diff
==============================================================================
--- trunk/channel.c (original)
+++ trunk/channel.c Tue Nov 29 21:16:53 2005
@@ -1016,8 +1016,13 @@
 		return;
 
 	AST_LIST_TRAVERSE(&chan->spies->list, spy, list) {
-		if ((spy->type == type) && (spy->status == CHANSPY_RUNNING))
+		ast_mutex_lock(&spy->lock);
+		if ((spy->type == type) && (spy->status == CHANSPY_RUNNING)) {
 			spy->status = CHANSPY_DONE;
+			if (ast_test_flag(spy, CHANSPY_TRIGGER_MODE) != CHANSPY_TRIGGER_NONE)
+				ast_cond_signal(&spy->trigger);
+		}
+		ast_mutex_unlock(&spy->lock);
 	}
 }
 
@@ -3912,8 +3917,10 @@
 
 		if (need_dup)
 			result = ast_frdup(read_frame);
-		else
+		else {
 			result = read_frame;
+			ast_frfree(write_frame);
+		}
 	} else {
 		if (need_dup) {
 			result = ast_frdup(read_frame);



More information about the asterisk-commits mailing list