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

Freeswitch SVN anthm at freeswitch.org
Fri Feb 23 11:43:07 EST 2007


Author: anthm
Date: Fri Feb 23 11:43:07 2007
New Revision: 4357

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

Log:
remove redundant strlen

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 Feb 23 11:43:07 2007
@@ -554,14 +554,13 @@
             switch_event_fire(&event);
         }
     } else {
-        switch_size_t len;
-        char buf[1024];
-        len = strlen(reply);			
-        snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", len);
-        len = strlen(buf);
-        switch_socket_send(acs->listener->sock, buf, &len);
-        len = strlen(reply);
-        switch_socket_send(acs->listener->sock, reply, &len);
+        switch_size_t rlen, blen;
+        char buf[1024] = "";
+        rlen = strlen(reply);			
+        snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", rlen);
+        blen = strlen(buf);
+        switch_socket_send(acs->listener->sock, buf, &blen);
+        switch_socket_send(acs->listener->sock, reply, &rlen);
     }
 		
     switch_safe_free(stream.data);



More information about the Freeswitch-svn mailing list