mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 00:41:41 +00:00
ESL fixes
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12230 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
c5d6f3f440
commit
35fd710488
@ -380,7 +380,7 @@ ESL_DECLARE(char *)esl_url_decode(char *s)
|
|||||||
|
|
||||||
static void sock_setup(esl_handle_t *handle)
|
static void sock_setup(esl_handle_t *handle)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
BOOL bOptVal = TRUE;
|
BOOL bOptVal = TRUE;
|
||||||
int bOptLen = sizeof(BOOL);
|
int bOptLen = sizeof(BOOL);
|
||||||
setsockopt(handle->sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&bOptVal, bOptLen);
|
setsockopt(handle->sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&bOptVal, bOptLen);
|
||||||
@ -562,7 +562,7 @@ ESL_DECLARE(esl_status_t) esl_listen(const char *host, esl_port_t port, esl_list
|
|||||||
status = ESL_FAIL;
|
status = ESL_FAIL;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(server_sock, client_sock, &echoClntAddr);
|
callback(server_sock, client_sock, &echoClntAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -916,31 +916,19 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, esl_event_t **sav
|
|||||||
}
|
}
|
||||||
|
|
||||||
beg = c + 1;
|
beg = c + 1;
|
||||||
}
|
|
||||||
|
|
||||||
free(body);
|
if (*beg == '\n') {
|
||||||
|
beg++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((cl = esl_event_get_header(handle->last_ievent, "content-length"))) {
|
if ((cl = esl_event_get_header(handle->last_ievent, "content-length"))) {
|
||||||
esl_ssize_t sofar = 0;
|
handle->last_ievent->body = strdup(beg);
|
||||||
|
|
||||||
len = atol(cl);
|
|
||||||
body = malloc(len+1);
|
|
||||||
esl_assert(body);
|
|
||||||
*(body + len) = '\0';
|
|
||||||
|
|
||||||
do {
|
|
||||||
esl_ssize_t r;
|
|
||||||
if ((r = recv(handle->sock, body + sofar, len - sofar, 0)) < 0) {
|
|
||||||
strerror_r(handle->errnum, handle->err, sizeof(handle->err));
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
sofar += r;
|
|
||||||
} while (sofar < len);
|
|
||||||
|
|
||||||
handle->last_ievent->body = body;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
free(body);
|
||||||
|
|
||||||
if (esl_log_level >= 7) {
|
if (esl_log_level >= 7) {
|
||||||
char *foo;
|
char *foo;
|
||||||
esl_event_serialize(handle->last_ievent, &foo, ESL_FALSE);
|
esl_event_serialize(handle->last_ievent, &foo, ESL_FALSE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user