$Log$
+Revision 654.20 2005/08/29 20:49:50 ajc
+* imap_fetch.c: fixed a bug in the IMAP FETCH BODY code that was causing the
+ "most recently fetched message" cache to be burned even when it shouldn't
+ have been. This was causing abominally slow message load time when a message
+ contains attachments and the MUA is a client such as Thunderbird that does
+ partial fetches.
+
Revision 654.19 2005/08/23 04:00:01 ajc
* Mailing list messages are now customized with a To: header for each
recipient. This uses more overhead but makes delivery more reliable.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
size_t pstart, pbytes;
int loading_body_now = 0;
int need_body = 1;
+ int burn_the_cache = 0;
/* extract section */
safestrncpy(section, item, sizeof section);
* same message again.
*/
if (IMAP->cached_body != NULL) {
- if ((IMAP->cached_bodymsgnum != msgnum)
- || ( (IMAP->cached_body_withbody) || (!need_body) )
- || (strcasecmp(IMAP->cached_bodypart, section)) ) {
+ if (IMAP->cached_bodymsgnum != msgnum) {
+ burn_the_cache = 1;
+ }
+ else if ( (!IMAP->cached_body_withbody) && (need_body) ) {
+ burn_the_cache = 1;
+ }
+ else if (strcasecmp(IMAP->cached_bodypart, section)) {
+ burn_the_cache = 1;
+ }
+ if (burn_the_cache) {
+ /* Yup, go ahead and burn the cache. */
free(IMAP->cached_body);
IMAP->cached_body_len = 0;
IMAP->cached_body = NULL;