From 27937ec41f94720ffded271dff901dc74712845b Mon Sep 17 00:00:00 2001 From: Michael Zucci Date: Mon, 24 Apr 2000 09:12:31 +0000 Subject: Big fixes for the last commit which broke the message creation entirely. Plus an address decoder/formatter, etc. * camel-mime-message.c (construct_from_parser): Allow MESSAGE_END _or_ EOF as valid termination conditions. * providers/mbox/camel-mbox-summary.c (message_struct_new): Decode and then re-encode the addresses, so they are consistently formatted. * camel-mime-utils.c (header_decode_mailbox): Store the address in a _header_address. And try to get a comment-stored name if there is one. (header_decode_address): Actually return an address. (header_to_decode): Renamed to header_address_decode() (header_mailbox_decode): New function to get a single mailbox. (header_mime_decode): Return the major/minor value, as appropriate. (header_address_new, and friends): Whole bunch of utility functions for working with the address thingies. (header_decode_domain): Free the string header, and dont expand '.' into ' . '. (camel_mime_part_construct_content_from_parser): Oops, this was totally screwed up, try creating the right cotnent on the right object. svn path=/trunk/; revision=2579 --- camel/camel-mime-message.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'camel/camel-mime-message.c') diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c index f63548e5a5..25c1c667e2 100644 --- a/camel/camel-mime-message.c +++ b/camel/camel-mime-message.c @@ -485,17 +485,23 @@ construct_from_parser(CamelMimePart *dw, CamelMimeParser *mp) { char *buf; int len; + int state; d(printf("constructing mime-message\n")); + d(printf("mime_message::construct_from_parser()\n")); + /* let the mime-part construct the guts ... */ ((CamelMimePartClass *)parent_class)->construct_from_parser(dw, mp); /* ... then clean up the follow-on state */ - if (camel_mime_parser_step(mp, &buf, &len) != HSCAN_MESSAGE_END) { - g_warning("Bad parser state: Expecing MESSAGE_END, got: %d", camel_mime_parser_state(mp)); + state = camel_mime_parser_step(mp, &buf, &len); + if (!(state == HSCAN_MESSAGE_END || state == HSCAN_EOF)) { + g_warning("Bad parser state: Expecing MESSAGE_END or EOF, got: %d", camel_mime_parser_state(mp)); camel_mime_parser_unstep(mp); } + + d(printf("mime_message::construct_from_parser() leaving\n")); } #ifdef WHPT -- cgit v1.2.3