[Freeswitch-svn] [commit] r3045 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket
Freeswitch SVN
anthm at freeswitch.org
Fri Oct 13 10:32:39 EDT 2006
Author: anthm
Date: Fri Oct 13 10:32:38 2006
New Revision: 3045
Modified:
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
Log:
dont write nulls in event_socket
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 Oct 13 10:32:38 2006
@@ -327,9 +327,9 @@
if (data) {
snprintf(buf, sizeof(buf), "Content-Type: log/data\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", strlen(data));
- len = strlen(buf) + 1;
+ len = strlen(buf);
switch_socket_send(listener->sock, buf, &len);
- len = strlen(data) + 1;
+ len = strlen(data);
switch_socket_send(listener->sock, data, &len);
free(data);
@@ -367,16 +367,16 @@
}
}
- len = strlen(packet) + 1;
+ len = strlen(packet);
snprintf(hbuf, sizeof(hbuf), "Content-Length: %"APR_SSIZE_T_FMT"\n"
"Content-Type: text/event-%s\n"
"\n", len, etype);
- len = strlen(hbuf) + 1;
+ len = strlen(hbuf);
switch_socket_send(listener->sock, hbuf, &len);
- len = strlen(packet) + 1;
+ len = strlen(packet);
switch_socket_send(listener->sock, packet, &len);
if (xmlstr) {
@@ -430,11 +430,11 @@
} else {
switch_size_t len;
char buf[1024];
- len = strlen(stream.data) + 1;
+ len = strlen(stream.data);
snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", len);
- len = strlen(buf) + 1;
+ len = strlen(buf);
switch_socket_send(acs->listener->sock, buf, &len);
- len = strlen(stream.data) + 1;
+ len = strlen(stream.data);
switch_socket_send(acs->listener->sock, stream.data, &len);
}
}
@@ -781,7 +781,7 @@
snprintf(buf, sizeof(buf), "Content-Type: auth/request\n\n");
- len = strlen(buf) + 1;
+ len = strlen(buf);
switch_socket_send(listener->sock, buf, &len);
@@ -800,7 +800,7 @@
}
if (!switch_strlen_zero(reply)) {
snprintf(buf, sizeof(buf), "Content-Type: command/reply\nReply-Text: %s\n\n", reply);
- len = strlen(buf) + 1;
+ len = strlen(buf);
switch_socket_send(listener->sock, buf, &len);
}
break;
@@ -830,7 +830,7 @@
if (!switch_strlen_zero(reply)) {
snprintf(buf, sizeof(buf), "Content-Type: command/reply\nReply-Text: %s\n\n", reply);
- len = strlen(buf) + 1;
+ len = strlen(buf);
switch_socket_send(listener->sock, buf, &len);
}
More information about the Freeswitch-svn
mailing list