-2007-04-10 17:40 -0700 Brendan Cully <brendan@kublai.com> (8082e4c9f524)
+2007-04-10 19:19 -0700 Brendan Cully <brendan@kublai.com> (ddd38b4cf15c)
+
+ * hcache.c: Refactor mutt_hcache_open to share more code
+
+ * hcache.c: Save some stats when header cache already exists
* hcache.c, imap/imap.c, imap/imap_private.h, imap/message.c,
imap/util.c: Make IMAP header cache layout match body cache. You can
char *dst, size_t dstlen)
{
char host[STRING];
- char *s, *p;
ciss_url_t url;
size_t len;
IMAP_STATUS scache;
#ifdef USE_HCACHE
header_cache_t *hc = NULL;
- ciss_url_t url;
- char urlstr[LONG_STRING];
- char cpath[LONG_STRING];
unsigned int *uidvalidity = NULL;
unsigned int *uidnext = NULL;
#endif
char mbox[LONG_STRING];
if (imap_parse_path (idata->ctx->path, &mx) < 0)
- return -1;
+ return NULL;
if (path)
imap_cachepath (idata, path, mbox, sizeof (mbox));
char *mutt_concatn_path (char *dst, size_t dstlen,
const char *dir, size_t dirlen, const char *fname, size_t fnamelen)
{
+ size_t req;
+ size_t offset = 0;
+
if (dstlen == 0)
return NULL; /* probably should not mask errors like this */
/* size check */
- size_t req = dirlen + fnamelen + 1; /* +1 for the trailing nul */
+ req = dirlen + fnamelen + 1; /* +1 for the trailing nul */
if (dirlen && fnamelen)
req++; /* when both components are non-nul, we add a "/" in between */
if (req > dstlen) { /* check for condition where the dst length is too short */
return NULL;
}
- size_t offset = 0;
if (dirlen) { /* when dir is not empty */
memcpy(dst, dir, dirlen);
offset = dirlen;