[mod_sofia] Set the proper content-length for multipart messages
Before any custom headers set via `sip_multipart` would be included in the size calculation.
This commit is contained in:
parent
ac5775b6e0
commit
ffee18ff82
|
@ -104,7 +104,10 @@ static void process_mp(switch_core_session_t *session, switch_stream_handle_t *s
|
||||||
if ((dval = strchr(dname, ':'))) {
|
if ((dval = strchr(dname, ':'))) {
|
||||||
*dval++ = '\0';
|
*dval++ = '\0';
|
||||||
if (*dval == '~') {
|
if (*dval == '~') {
|
||||||
stream->write_function(stream, "--%s\r\nContent-Type: %s\r\nContent-Length: %d\r\n%s\r\n", boundary, dname, strlen(dval), dval + 1);
|
char *body;
|
||||||
|
if ((body = strstr(dval, "\r\n\r\n"))) {
|
||||||
|
stream->write_function(stream, "--%s\r\nContent-Type: %s\r\nContent-Length: %d\r\n%s\r\n", boundary, dname, strlen(body + 4) + 1, dval + 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
stream->write_function(stream, "--%s\r\nContent-Type: %s\r\nContent-Length: %d\r\n\r\n%s\r\n", boundary, dname, strlen(dval) + 1, dval);
|
stream->write_function(stream, "--%s\r\nContent-Type: %s\r\nContent-Length: %d\r\n\r\n%s\r\n", boundary, dname, strlen(dval) + 1, dval);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue