Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[mms_codec] Always allow X-Mms-Transaction-ID header. Fixes MER#1676
DNA Finland recently started to include X-Mms-Transaction-ID in
M-Delivery.ind even though it's not supposed to be there at all.
We should allow (and ignore) it.
  • Loading branch information
monich committed Oct 17, 2016
1 parent 3defd0f commit dd96525
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
13 changes: 10 additions & 3 deletions mms-lib/src/mms_codec.c
Expand Up @@ -1083,8 +1083,11 @@ static gboolean mms_parse_headers(struct wsp_header_iter *iter,
continue;

/* Unsupported header, skip */
if (entries[h].data == NULL)
if (entries[h].data == NULL) {
entries[h].pos = i;
entries[h].flags |= HEADER_FLAG_MARKED;
continue;
}

/* Skip multiply present headers unless explicitly requested */
if ((entries[h].flags & HEADER_FLAG_MARKED) &&
Expand Down Expand Up @@ -1195,7 +1198,9 @@ static gboolean decode_acknowledge_ind(struct wsp_header_iter *iter,
static gboolean decode_delivery_ind(struct wsp_header_iter *iter,
struct mms_message *out)
{
return mms_parse_headers(iter, MMS_HEADER_MMS_VERSION,
return mms_parse_headers(iter, MMS_HEADER_TRANSACTION_ID,
HEADER_FLAG_PRESET_POS, NULL,
MMS_HEADER_MMS_VERSION,
HEADER_FLAG_MANDATORY | HEADER_FLAG_PRESET_POS,
&out->version,
MMS_HEADER_MESSAGE_ID,
Expand All @@ -1212,7 +1217,9 @@ static gboolean decode_delivery_ind(struct wsp_header_iter *iter,
static gboolean decode_read_ind(struct wsp_header_iter *iter,
struct mms_message *out)
{
return mms_parse_headers(iter, MMS_HEADER_MMS_VERSION,
return mms_parse_headers(iter, MMS_HEADER_TRANSACTION_ID,
HEADER_FLAG_PRESET_POS, NULL,
MMS_HEADER_MMS_VERSION,
HEADER_FLAG_MANDATORY | HEADER_FLAG_PRESET_POS,
&out->version,
MMS_HEADER_MESSAGE_ID,
Expand Down
Binary file added mms-lib/test/test_mms_codec/data/m-delivery_2.ind
Binary file not shown.
3 changes: 2 additions & 1 deletion mms-lib/test/test_mms_codec/test_mms_codec.c
Expand Up @@ -60,7 +60,8 @@ int main(int argc, char* argv[])
"m-notification_2.ind",
"m-notification_3.ind",
"m-notification_4.ind",
"m-delivery.ind",
"m-delivery_1.ind",
"m-delivery_2.ind",
"m-read-orig.ind",
"m-retrieve_1.conf",
"m-retrieve_2.conf",
Expand Down

0 comments on commit dd96525

Please sign in to comment.