socket tweak
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2260 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
88dbc8c056
commit
44095d48ef
|
@ -31,7 +31,7 @@
|
||||||
*/
|
*/
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#define CMD_BUFLEN 1024 * 1000
|
#define CMD_BUFLEN 1024 * 1000
|
||||||
|
#define IS_BREAK(x) ((int)x || SWITCH_STATUS_BREAK || (int)x == 730035 || (int)x == 35)
|
||||||
|
|
||||||
static const char modname[] = "mod_event_socket";
|
static const char modname[] = "mod_event_socket";
|
||||||
static char *MARKER = "1";
|
static char *MARKER = "1";
|
||||||
|
@ -244,12 +244,13 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event,
|
||||||
mlen = 1;
|
mlen = 1;
|
||||||
status = switch_socket_recv(listener->sock, ptr, &mlen);
|
status = switch_socket_recv(listener->sock, ptr, &mlen);
|
||||||
|
|
||||||
if (status != SWITCH_STATUS_BREAK && status != SWITCH_STATUS_SUCCESS) {
|
if (!SWITCH_STATUS_IS_BREAK(status) && status != SWITCH_STATUS_SUCCESS) {
|
||||||
return status;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != SWITCH_STATUS_BREAK && mlen) {
|
if (mlen) {
|
||||||
bytes++;
|
bytes++;
|
||||||
|
do_sleep = 0;
|
||||||
|
|
||||||
if (*mbuf == '\r' || *mbuf == '\n') { /* bah */
|
if (*mbuf == '\r' || *mbuf == '\n') { /* bah */
|
||||||
ptr = mbuf;
|
ptr = mbuf;
|
||||||
|
|
Loading…
Reference in New Issue