mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 17:22:21 +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
@ -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;
|
||||||
|
|
||||||
|
if (*beg == '\n') {
|
||||||
|
beg++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((cl = esl_event_get_header(handle->last_ievent, "content-length"))) {
|
||||||
|
handle->last_ievent->body = strdup(beg);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(body);
|
free(body);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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