Skip to content

Commit

Permalink
Decode Content-Location
Browse files Browse the repository at this point in the history
  • Loading branch information
monich committed Feb 22, 2014
1 parent 04852da commit db6786f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mms-lib/src/mms_codec.c
Expand Up @@ -1173,9 +1173,8 @@ static const char *decode_attachment_charset(const unsigned char *pdu,
return NULL;
}

static gboolean extract_content_id(struct wsp_header_iter *iter, void *user)
static gboolean extract_quoted_string(struct wsp_header_iter *iter, char **out)
{
char **out = user;
const unsigned char *p;
unsigned int l;
const char *text;
Expand Down Expand Up @@ -1212,11 +1211,12 @@ static gboolean attachment_parse_headers(struct wsp_header_iter *iter,

switch (h) {
case MMS_PART_HEADER_CONTENT_ID:
if (extract_content_id(iter, &part->content_id)
== FALSE)
if (!extract_quoted_string(iter, &part->content_id))
return FALSE;
break;
case MMS_PART_HEADER_CONTENT_LOCATION:
if (!extract_text(iter, &part->content_location))
return FALSE;
break;
}
}
Expand All @@ -1230,6 +1230,7 @@ static void free_attachment(gpointer data, gpointer user_data)

g_free(attach->content_type);
g_free(attach->content_id);
g_free(attach->content_location);

g_free(attach);
}
Expand Down
1 change: 1 addition & 0 deletions mms-lib/src/mms_codec.h
Expand Up @@ -162,6 +162,7 @@ struct mms_attachment {
size_t length;
char *content_type;
char *content_id;
char *content_location;
};

struct mms_message {
Expand Down

0 comments on commit db6786f

Please sign in to comment.