Fixed message body build buffer to deal with additional body headers and mime multiparts.

git-svn-id: http://yate.null.ro/svn/yate/trunk@1619 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2008-01-11 14:23:56 +00:00
parent aebce4e29d
commit dfa59997e3
1 changed files with 5 additions and 2 deletions

View File

@ -566,8 +566,11 @@ const DataBlock& SIPMessage::getBuffer() const
m_data.assign((void*)(getHeaders().c_str()),getHeaders().length());
if (body) {
String s;
body->getType().buildLine(s);
s << "\r\nContent-Length: " << body->getBody().length() << "\r\n\r\n";
body->buildHeaders(s);
s << "Content-Length: " << body->getBody().length() << "\r\n";
// The multipart will add an empty line anyway
if (!body->isMultipart())
s << "\r\n";
m_data += s;
}
else