ESL fixes

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12230 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West 2009-02-22 01:42:33 +00:00
parent c5d6f3f440
commit 35fd710488
1 changed files with 10 additions and 22 deletions

View File

@ -380,7 +380,7 @@ ESL_DECLARE(char *)esl_url_decode(char *s)
static void sock_setup(esl_handle_t *handle)
{
#ifdef WIN32
#ifdef WIN32
BOOL bOptVal = TRUE;
int bOptLen = sizeof(BOOL);
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;
goto end;
}
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;
}
free(body);
if (*beg == '\n') {
beg++;
break;
}
}
if ((cl = esl_event_get_header(handle->last_ievent, "content-length"))) {
esl_ssize_t sofar = 0;
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;
handle->last_ievent->body = strdup(beg);
}
free(body);
if (esl_log_level >= 7) {
char *foo;
esl_event_serialize(handle->last_ievent, &foo, ESL_FALSE);