projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rationalize the hcache patch.
[apps/madmutt.git]
/
imap
/
message.c
diff --git
a/imap/message.c
b/imap/message.c
index
a3225e4
..
b8a3ca4
100644
(file)
--- a/
imap/message.c
+++ b/
imap/message.c
@@
-57,8
+57,8
@@
int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
"DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL";
#ifdef USE_HCACHE
"DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL";
#ifdef USE_HCACHE
-
void
*hc = NULL;
-
unsigned
long *uid_validity = NULL;
+
hcache_t
*hc = NULL;
+ long *uid_validity = NULL;
char uid_buf[64];
#endif /* USE_HCACHE */
char uid_buf[64];
#endif /* USE_HCACHE */
@@
-83,7
+83,7
@@
int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
/* instead of downloading all headers and then parsing them, we parse them
* as they come in. */
/* instead of downloading all headers and then parsing them, we parse them
* as they come in. */
- fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(
Te
mpdir), NULL);
+ fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(
MCore.t
mpdir), NULL);
if (!fp) {
mutt_error(_("Could not create temporary file"));
mutt_sleep(2);
if (!fp) {
mutt_error(_("Could not create temporary file"));
mutt_sleep(2);
@@
-132,11
+132,10
@@
int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
fputs ("\n\n", fp);
sprintf (uid_buf, "/%u", h.data->uid); /* XXX --tg 21:41 04-07-11 */
fputs ("\n\n", fp);
sprintf (uid_buf, "/%u", h.data->uid); /* XXX --tg 21:41 04-07-11 */
- uid_validity =
- (unsigned long *) mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen);
+ uid_validity = mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen);
if (uid_validity != NULL && *uid_validity == idata->uid_validity) {
if (uid_validity != NULL && *uid_validity == idata->uid_validity) {
- ctx->hdrs[msgno] = mutt_hcache_restore(
(unsigned char *)
uid_validity, 0);
+ ctx->hdrs[msgno] = mutt_hcache_restore(uid_validity, 0);
ctx->hdrs[msgno]->index = h.sid - 1;
/* messages which have not been expunged are ACTIVE (borrowed from mh
* folders) */
ctx->hdrs[msgno]->index = h.sid - 1;
/* messages which have not been expunged are ACTIVE (borrowed from mh
* folders) */
@@
-164,7
+163,7
@@
int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
if ((mfhrc < -1) || ((rc != IMAP_CMD_CONTINUE) && (rc != IMAP_CMD_OK))) {
imap_free_header_data((void *)&h.data);
m_fclose(&fp);
if ((mfhrc < -1) || ((rc != IMAP_CMD_CONTINUE) && (rc != IMAP_CMD_OK))) {
imap_free_header_data((void *)&h.data);
m_fclose(&fp);
- mutt_hcache_close (hc);
+ mutt_hcache_close (
&
hc);
return -1;
}
}
return -1;
}
}
@@
-264,7
+263,7
@@
int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
imap_free_header_data ((void *)&h.data);
m_fclose(&fp);
#ifdef USE_HCACHE
imap_free_header_data ((void *)&h.data);
m_fclose(&fp);
#ifdef USE_HCACHE
- mutt_hcache_close (hc);
+ mutt_hcache_close (
&
hc);
#endif /* USE_HCACHE */
return -1;
}
#endif /* USE_HCACHE */
return -1;
}
@@
-280,7
+279,7
@@
int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
}
#ifdef USE_HCACHE
}
#ifdef USE_HCACHE
- mutt_hcache_close (hc);
+ mutt_hcache_close (
&
hc);
#endif /* USE_HCACHE */
m_fclose(&fp);
#endif /* USE_HCACHE */
m_fclose(&fp);
@@
-376,7
+375,7
@@
int imap_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno)
mutt_message _("Fetching message...");
cache->uid = HEADER_DATA (h)->uid;
mutt_message _("Fetching message...");
cache->uid = HEADER_DATA (h)->uid;
- msg->fp = m_tempfile(path, sizeof(path), NONULL(
Te
mpdir), NULL);
+ msg->fp = m_tempfile(path, sizeof(path), NONULL(
MCore.t
mpdir), NULL);
if (!msg->fp) {
return -1;
}
if (!msg->fp) {
return -1;
}