mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 17:59:21 +00:00
Merge remote-tracking branch 'origin/dev_content_cpp' into dev_chatroom_list_subscription
This commit is contained in:
commit
838f597e08
2 changed files with 10 additions and 7 deletions
|
|
@ -76,7 +76,7 @@ ContentType::ContentType (const string &contentType) : ClonableObject(*new Conte
|
|||
string token;
|
||||
do {
|
||||
posParam = params.find(";");
|
||||
if (posParam != string::npos) {
|
||||
if (posParam == string::npos) {
|
||||
token = params;
|
||||
} else {
|
||||
token = params.substr(0, posParam);
|
||||
|
|
|
|||
|
|
@ -42,11 +42,12 @@ HeaderParam::HeaderParam (const string ¶m) : ClonableObject(*new HeaderParam
|
|||
size_t pos = param.find("=");
|
||||
size_t end = param.length();
|
||||
|
||||
if (pos == string::npos)
|
||||
return;
|
||||
|
||||
setName(param.substr(0, pos));
|
||||
setValue(param.substr(pos + 1, end));
|
||||
if (pos == string::npos) {
|
||||
setName(param);
|
||||
} else {
|
||||
setName(param.substr(0, pos));
|
||||
setValue(param.substr(pos + 1, end - (pos + 1)));
|
||||
}
|
||||
}
|
||||
|
||||
HeaderParam::HeaderParam (const string &name, const string &value) : ClonableObject(*new HeaderParamPrivate) {
|
||||
|
|
@ -98,7 +99,9 @@ bool HeaderParam::setValue (const string &value) {
|
|||
|
||||
string HeaderParam::asString () const {
|
||||
L_D();
|
||||
string asString = ";" + d->name + "=" + d->value;
|
||||
string asString = ";" + d->name;
|
||||
if (!d->value.empty())
|
||||
asString += "=" + d->value;
|
||||
return asString;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue