Merge remote-tracking branch 'origin/dev_content_cpp' into dev_chatroom_list_subscription

This commit is contained in:
Benjamin Reis 2018-03-21 15:14:40 +01:00
commit a6c3886d56
3 changed files with 12 additions and 12 deletions

View file

@ -283,7 +283,7 @@ LinphoneContent * linphone_content_new(void) {
}
LinphoneContent * linphone_content_copy(const LinphoneContent *ref) {
return (LinphoneContent *)belle_sip_object_ref(belle_sip_object_clone(BELLE_SIP_OBJECT(ref)));
return (LinphoneContent *)(belle_sip_object_clone(BELLE_SIP_OBJECT(ref)));
}
LinphoneContent * linphone_core_create_content(LinphoneCore *lc) {

View file

@ -77,18 +77,13 @@ ChatMessageModifier::Result MultipartChatMessageModifier::decode (const shared_p
return ChatMessageModifier::Result::Error;
}
size_t pos = boundary.find("=");
if (pos == string::npos) {
lError() << "Parameter seems invalid: " << boundary;
return ChatMessageModifier::Result::Error;
}
boundary = "--" + boundary.substr(pos + 1);
boundary = "--" + boundary;
lInfo() << "Multipart boundary is " << boundary;
const vector<char> body = message->getInternalContent().getBody();
string contentsString(body.begin(), body.end());
pos = contentsString.find(boundary);
size_t pos = contentsString.find(boundary);
if (pos == string::npos) {
lError() << "Boundary not found in body !";
return ChatMessageModifier::Result::Error;

View file

@ -72,13 +72,18 @@ ContentType::ContentType (const string &contentType) : ClonableObject(*new Conte
}
if (posParam != string::npos) {
string params = contentType.substr(posParam, end);
string params = contentType.substr(posParam + 1);
string token;
while ((pos = params.find(";")) != std::string::npos) {
token = params.substr(0, pos);
do {
posParam = params.find(";");
if (posParam != string::npos) {
token = params;
} else {
token = params.substr(0, posParam);
}
addParameter(HeaderParam(token));
params.erase(0, pos + 1);
}
} while (posParam != std::string::npos);
}
}