Fixes Bug 192.

2000-06-01  Not Zed  <NotZed@HelixCode.com>

        * camel-mime-part.c (construct_from_parser): For a message part,
        set the default content-type to message/rfc822.  Maybe needs to be
        done for multiparts too?

2000-05-31  Not Zed  <NotZed@HelixCode.com>

        * camel-mime-message.c (construct_from_parser): Typo in assersion.

        * camel-mime-parser.c (folder_scan_step): Use a default type of
        message/rfc822 for multipart/digest.  Bug Z192.
        (folder_scan_drop_step): Remove warning.

svn path=/trunk/; revision=3340
This commit is contained in:
Not Zed
2000-06-01 22:08:07 +00:00
committed by Michael Zucci
parent c7ea21299d
commit 7e66242575
5 changed files with 39 additions and 6 deletions

View File

@ -1,3 +1,17 @@
2000-06-01 Not Zed <NotZed@HelixCode.com>
* camel-mime-part.c (construct_from_parser): For a message part,
set the default content-type to message/rfc822. Maybe needs to be
done for multiparts too?
2000-05-31 Not Zed <NotZed@HelixCode.com>
* camel-mime-message.c (construct_from_parser): Typo in assersion.
* camel-mime-parser.c (folder_scan_step): Use a default type of
message/rfc822 for multipart/digest. Bug Z192.
(folder_scan_drop_step): Remove warning.
2000-05-30 Not Zed <NotZed@HelixCode.com>
* providers/mbox/camel-mbox-folder.c (mbox_append_message): Init

View File

@ -575,12 +575,12 @@ construct_from_parser(CamelMimePart *dw, CamelMimeParser *mp)
/* ... then clean up the follow-on state */
state = camel_mime_parser_step(mp, &buf, &len);
switch (state) {
case HSCAN_EOF: case HSCAN_FROM_END: /* this doesn't belong to us */
case HSCAN_EOF: case HSCAN_FROM_END: /* these doesn't belong to us */
camel_mime_parser_unstep(mp);
case HSCAN_MESSAGE_END:
break;
default:
g_error("Bad parser state: Expecing MESSAGE_END or EOF or ROM, got: %d", camel_mime_parser_state(mp));
g_error("Bad parser state: Expecing MESSAGE_END or EOF or EOM, got: %d", camel_mime_parser_state(mp));
camel_mime_parser_unstep(mp);
return -1;
}

View File

@ -1466,10 +1466,16 @@ folder_scan_step(struct _header_scan_state *s, char **databuffer, int *datalengt
tail_recurse:
d({
printf("\nSCAN STACK:\n");
printf(" '%s' :\n", states[s->state]);
printf(" '%s' :\n", states[s->state]);
hb = s->parts;
while (hb) {
printf(" '%s' : %s\n", states[hb->savestate], hb->boundary);
printf(" '%s' : %s ", states[hb->savestate], hb->boundary);
if (hb->content_type) {
printf("(%s/%s)", hb->content_type->type, hb->content_type->subtype);
} else {
printf("(default)");
}
printf("\n");
hb = hb->parent;
}
printf("\n");
@ -1543,6 +1549,16 @@ tail_recurse:
type = HSCAN_MESSAGE;
}
}
} else {
/* make the default type for multipart/digest be message/rfc822 */
if ((s->parts
&& header_content_type_is(s->parts->content_type, "multipart", "digest"))) {
ct = header_content_type_decode("message/rfc822");
type = HSCAN_MESSAGE;
d(printf("parent was multipart/digest, autoupgrading to message/rfc822?\n"));
/* maybe we should do this too?
header_raw_append_parse(&h->headers, "Content-Type: message/rfc822", -1);*/
}
}
h->content_type = ct;
folder_push_part(s, h);
@ -1667,6 +1683,8 @@ folder_scan_drop_step(struct _header_scan_state *s)
s->state &= ~HSCAN_END;
}
return;
default:
/* FIXME: not sure if this is entirely right */
}
}

View File

@ -193,7 +193,6 @@ camel_mime_part_construct_content_from_parser(CamelMimePart *dw, CamelMimeParser
/* FIXME: use the real boundary? */
camel_multipart_set_boundary((CamelMultipart *)content, NULL);
while (camel_mime_parser_step(mp, &buf, &len) != HSCAN_MULTIPART_END) {
camel_mime_parser_unstep(mp);
bodypart = (CamelDataWrapper *)camel_mime_part_new();

View File

@ -557,8 +557,10 @@ construct_from_parser(CamelMimePart *dw, CamelMimeParser *mp)
d(printf("mime_part::construct_from_parser()\n"));
switch (camel_mime_parser_step(mp, &buf, &len)) {
case HSCAN_HEADER:
case HSCAN_MESSAGE:
/* set the default type of a message always */
gmime_content_field_construct_from_string (dw->content_type, "message/rfc822");
case HSCAN_HEADER:
case HSCAN_MULTIPART:
/* we have the headers, build them into 'us' */
headers = camel_mime_parser_headers_raw(mp);