Commit e6a001f0 authored by Slava Monich's avatar Slava Monich

[mms_codec] Encode the Name parameter as Text-string

According to Table 38 "Well-Known Parameter Assignments" in WAP-230-WSP spec.
parent 37e6840c
...@@ -1846,25 +1846,6 @@ static gboolean encode_utf8_string(struct file_buffer *fb, ...@@ -1846,25 +1846,6 @@ static gboolean encode_utf8_string(struct file_buffer *fb,
return TRUE; return TRUE;
} }
static gboolean encode_quoted_string(struct file_buffer *fb,
enum mms_header header, void *user)
{
char *ptr;
char **text = user;
if (!*text)
return TRUE;
ptr = fb_request_field(fb, header, strlen(*text) + 2);
if (ptr == NULL)
return FALSE;
ptr[0] = '"';
strcpy(ptr + 1, *text);
return TRUE;
}
static gboolean encode_content_id(struct file_buffer *fb, static gboolean encode_content_id(struct file_buffer *fb,
enum mms_header header, void *user) enum mms_header header, void *user)
{ {
...@@ -2130,8 +2111,10 @@ static gboolean mms_encode_send_req_part_header(struct mms_attachment *part, ...@@ -2130,8 +2111,10 @@ static gboolean mms_encode_send_req_part_header(struct mms_attachment *part,
len += cs_len; len += cs_len;
} else if (g_ascii_strcasecmp("name", key) == 0) { } else if (g_ascii_strcasecmp("name", key) == 0) {
/* text-string */
name = parsed[i+1]; name = parsed[i+1];
len += 2 + strlen(name) + 1; len += 2 + strlen(name);
if (name[0] & 0x80) len++;
} }
} }
...@@ -2202,7 +2185,7 @@ static gboolean mms_encode_send_req_part_header(struct mms_attachment *part, ...@@ -2202,7 +2185,7 @@ static gboolean mms_encode_send_req_part_header(struct mms_attachment *part,
/* Encode "name" param */ /* Encode "name" param */
if (name) { if (name) {
if (encode_quoted_string(fb, WSP_PARAMETER_TYPE_NAME_DEFUNCT, if (encode_text(fb, WSP_PARAMETER_TYPE_NAME_DEFUNCT,
&name) == FALSE) &name) == FALSE)
goto done; goto done;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment