Compare mbox_file_size and mbox_modtime to the results of stat()ing the
authorDan Winship <danw@src.gnome.org>
Sat, 1 Apr 2000 21:58:27 +0000 (21:58 +0000)
committerDan Winship <danw@src.gnome.org>
Sat, 1 Apr 2000 21:58:27 +0000 (21:58 +0000)
commit2da78d15aa76e99ac86b832ae1fff3faf3605a7a
tree6ea7e700550f0ec3994f1dbfe056b522e647fc1e
parent580b7a468191c425dec957a880312c56fc5563b7
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. :-)
camel/ChangeLog
camel/providers/mbox/camel-mbox-folder.c
camel/providers/mbox/camel-mbox-parser.c
camel/providers/mbox/camel-mbox-summary.c