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

Freeswitch SVN anthm at freeswitch.org
Fri Aug 11 14:59:25 EDT 2006


Author: anthm
Date: Fri Aug 11 14:59:25 2006
New Revision: 2263

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

Log:
more socket stuff

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	Fri Aug 11 14:59:25 2006
@@ -254,6 +254,7 @@
 
 			if (*mbuf == '\r' || *mbuf == '\n') { /* bah */
 				ptr = mbuf;
+				mbuf[0] = '\0';
 				continue;
 			}
 
@@ -460,6 +461,9 @@
 			snprintf(reply, reply_len, "-ERR invalid log level");
 		}
 	} else if (!strncasecmp(cmd, "nolog", 5)) {
+		void *pop;
+		while (switch_queue_trypop(listener->log_queue, &pop) == SWITCH_STATUS_SUCCESS);
+		
 		if (switch_test_flag(listener, LFLAG_LOG)) {
 			switch_clear_flag_locked(listener, LFLAG_LOG);
 			snprintf(reply, reply_len, "+OK no longer logging");
@@ -519,6 +523,9 @@
 		snprintf(reply, reply_len, "+OK event listener enabled %s", listener->format == EVENT_FORMAT_XML ? "xml" : "plain");
 		
 	} else if (!strncasecmp(cmd, "noevents", 8)) {
+		void *pop;
+		while (switch_queue_trypop(listener->event_queue, &pop) == SWITCH_STATUS_SUCCESS);
+
 		if (switch_test_flag(listener, LFLAG_EVENTS)) {
 			uint8_t x = 0;
 			switch_clear_flag_locked(listener, LFLAG_EVENTS);



More information about the Freeswitch-svn mailing list