aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/mbox/camel-mbox-parser.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-04-02 05:58:27 +0800
committerDan Winship <danw@src.gnome.org>2000-04-02 05:58:27 +0800
commit9e7dabfa8274777916da364b50284cfa51ac9a6f (patch)
tree579b255f6178357a1c2d9e697a423636fb65d619 /camel/providers/mbox/camel-mbox-parser.c
parent98690e9f75e909483f857f23bae0f903ee1ed84a (diff)
downloadgsoc2013-evolution-9e7dabfa8274777916da364b50284cfa51ac9a6f.tar
gsoc2013-evolution-9e7dabfa8274777916da364b50284cfa51ac9a6f.tar.gz
gsoc2013-evolution-9e7dabfa8274777916da364b50284cfa51ac9a6f.tar.bz2
gsoc2013-evolution-9e7dabfa8274777916da364b50284cfa51ac9a6f.tar.lz
gsoc2013-evolution-9e7dabfa8274777916da364b50284cfa51ac9a6f.tar.xz
gsoc2013-evolution-9e7dabfa8274777916da364b50284cfa51ac9a6f.tar.zst
gsoc2013-evolution-9e7dabfa8274777916da364b50284cfa51ac9a6f.zip
Compare mbox_file_size and mbox_modtime to the results of stat()ing the
* providers/mbox/camel-mbox-folder.c (_check_get_or_maybe_generate_summary_file): Compare mbox_file_size and mbox_modtime to the results of stat()ing the mbox file, not the summary file. Duh. (_close): Update the summary's mbox_file_size and mbox_modtime before writing it to disk. * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_save, camel_mbox_summary_load): Wow. I must have been tired when I wrote this code. First, the comparison bug above. Second, it was using ntohs and htons instead of ntohl and htonl. Third, I was reading the status flag byte in two different places and thus getting out of sync. Fourth, it was writing out field_length bytes of each header field after having converted field_length to network byte order, resulting in lots of random crap being appended, and the summary files being huge. (Fortunately, since the size/modtime comparison was biffed, the garbage summary read from disk was always immediately discarded.) * providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file): fix an off-by-one error that caused the last-used UID to be reused if the summary file was regenerated. (That one wasn't my fault. :-) svn path=/trunk/; revision=2279
Diffstat (limited to 'camel/providers/mbox/camel-mbox-parser.c')
-rw-r--r--camel/providers/mbox/camel-mbox-parser.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/camel/providers/mbox/camel-mbox-parser.c b/camel/providers/mbox/camel-mbox-parser.c
index 7c0eec5379..c03639133f 100644
--- a/camel/providers/mbox/camel-mbox-parser.c
+++ b/camel/providers/mbox/camel-mbox-parser.c
@@ -584,20 +584,29 @@ read_message_begining (CamelMboxPreParser *parser, gchar **message_summary)
/**
* camel_mbox_parse_file: read an mbox file and parse it.
* @fd: file descriptor opened on the mbox file.
- * @message_delimiter: character string delimiting the beginig of a new message
- * @start_position: poition in the file where to start the parsing.
- * @get_message_summary: should the parser retrieve the begining of the messages
- * @status_callback: function to call peridically to indicate the progress of the parser
- * @status_interval: floating value between 0 and 1 indicate how often to call @status_callback.
+ * @message_delimiter: character string delimiting the beginig of a
+ * new message
+ * @start_position: position in the file where to start the parsing.
+ * @file_size: on output, the size in bytes of the file
+ * @next_uid: on output, the next uid available for use
+ * @get_message_summary: should the parser retrieve the begining of
+ * the messages
+ * @status_callback: function to call peridically to indicate the
+ * progress of the parser
+ * @status_interval: floating value between 0 and 1 indicate how often
+ * to call @status_callback.
* @user_data: user data that will be passed to the callback function
*
- * This routine parses an mbox file and retreives both the message starting positions and
- * some of the informations contained in the message. Those informations are mainly
- * some RFC822 headers values but also (optionally) the first characters of the mail
- * body. The @get_message_summary parameter allows to enable or disable this option.
+ * This routine parses an mbox file and retreives both the message
+ * starting positions and some of the informations contained in the
+ * message. Those informations are mainly some RFC822 headers values
+ * but also (optionally) the first characters of the mail body. The
+ * @get_message_summary parameter allows to enable or disable this
+ * option.
*
*
- * Return value: An array of CamelMboxParserMessageInfo containing the informations on each message parsed in the file
+ * Return value: An array of CamelMboxParserMessageInfo containing the
+ * informations on each message parsed in the file
**/
GArray *
camel_mbox_parse_file (int fd,
@@ -766,7 +775,7 @@ camel_mbox_parse_file (int fd,
G_STRUCT_OFFSET (CamelMboxPreParser, current_message_info) +
G_STRUCT_OFFSET (CamelMboxParserMessageInfo, status)));
g_free (x_ev_header_content);
- next_available_uid = MAX (next_available_uid, parser->current_message_info.uid);
+ next_available_uid = MAX (next_available_uid, parser->current_message_info.uid + 1);
newline = TRUE;
continue;