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

Freeswitch SVN anthm at freeswitch.org
Thu Mar 6 13:12:38 EST 2008


Author: anthm
Date: Thu Mar  6 13:12:38 2008
New Revision: 7803

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

Log:
deal with blank api command replies in es

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	Thu Mar  6 13:12:38 2008
@@ -604,7 +604,12 @@
 	} else {
 		switch_size_t rlen, blen;
 		char buf[1024] = "";
-		rlen = strlen(reply);
+
+		if (!(rlen = strlen(reply))) {
+			reply = "-ERR no reply\n";
+			rlen = strlen(reply);
+		}
+
 		switch_snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %" SWITCH_SSIZE_T_FMT "\n\n", rlen);
 		blen = strlen(buf);
 		switch_socket_send(acs->listener->sock, buf, &blen);



More information about the Freeswitch-svn mailing list