[Freeswitch-svn] [commit] r10200 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket

Freeswitch SVN mikej at freeswitch.org
Wed Oct 29 22:27:23 EDT 2008


Author: mikej
Date: Wed Oct 29 22:27:22 2008
New Revision: 10200

Modified:
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c

Log:
bug found by pyite in new filter feature.

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Wed Oct 29 22:27:22 2008
@@ -177,8 +177,8 @@
 
 	if (listener->event_queue) {
 		while (switch_queue_trypop(listener->event_queue, &pop) == SWITCH_STATUS_SUCCESS) {
-			if (!pop) continue;
 			switch_event_t *pevent = (switch_event_t *) pop;
+			if (!pop) continue;
 			switch_event_destroy(&pevent);
 		}
 	}
@@ -214,7 +214,7 @@
 
 	switch_mutex_lock(listen_list.mutex);
 	while(lp) {
-		uint8_t send = 0;
+		int send = 0;
 		
 		l = lp;
 		lp = lp->next;
@@ -245,7 +245,7 @@
 
 			send = 0;
 			switch_mutex_lock(l->filter_mutex);
-			for (hp = l->filters->headers; hp; hp = hp->next) {
+			for (hp = l->filters->headers; hp && !send; hp = hp->next) {
 				if ((hval = switch_event_get_header(event, hp->name))) {
 					if (*hp->value == '/') {
 						switch_regex_t *re = NULL;



More information about the Freeswitch-svn mailing list