Changeset 5046:eabef30c9344
- Timestamp:
- 2007-04-02 14:33:29 (22 months ago)
- Author:
- Brendan Cully <brendan@…>
- Branch:
- HEAD
- Message:
-
Fix a segfault in the new mboxcache hcache lookup.
idata may not have an associated context, so the cache path must use
the account info instead. For harmony with the other hcache callers,
make them all canonify the path the same way with imap_hcache_open.
- Location:
- imap
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r5045
|
r5046
|
|
| 252 | 252 | header_cache_t *hc; |
| 253 | 253 | char uidbuf[32]; |
| 254 | | |
| 255 | | hc = mutt_hcache_open (HeaderCache, idata->ctx->path); |
| | 254 | |
| | 255 | hc = imap_hcache_open (idata, idata->ctx->path); |
| 256 | 256 | #endif |
| 257 | 257 | |
| … |
… |
|
| 1158 | 1158 | #if USE_HCACHE |
| 1159 | 1159 | if (expunge && ctx->closing) |
| 1160 | | hc = mutt_hcache_open (HeaderCache, idata->ctx->path); |
| | 1160 | hc = imap_hcache_open (idata, idata->ctx->path); |
| 1161 | 1161 | #endif |
| 1162 | 1162 | |
| … |
… |
|
| 1583 | 1583 | unsigned int *uidvalidity = NULL; |
| 1584 | 1584 | unsigned int *uidnext = NULL; |
| 1585 | | char* path; |
| 1586 | 1585 | #endif |
| 1587 | 1586 | |
| … |
… |
|
| 1607 | 1606 | |
| 1608 | 1607 | #ifdef USE_HCACHE |
| 1609 | | path = safe_strdup (idata->ctx->path); |
| 1610 | | url_parse_ciss (&url, path); |
| | 1608 | mutt_account_tourl (&idata->conn->account, &url); |
| 1611 | 1609 | url.path = (char*)mbox; |
| 1612 | 1610 | url_ciss_tostring (&url, urlstr, sizeof (urlstr), 0); |
| 1613 | | FREE (&path); |
| 1614 | 1611 | hc = mutt_hcache_open (HeaderCache, urlstr); |
| 1615 | 1612 | if (hc) |
-
|
r5044
|
r5046
|
|
| 265 | 265 | |
| 266 | 266 | /* util.c */ |
| | 267 | #ifdef USE_HCACHE |
| | 268 | void* imap_hcache_open (IMAP_DATA* idata, const char* path); |
| | 269 | #endif |
| | 270 | |
| 267 | 271 | int imap_continue (const char* msg, const char* resp); |
| 268 | 272 | void imap_error (const char* where, const char* msg); |
-
|
r5044
|
r5046
|
|
| 123 | 123 | #if USE_HCACHE |
| 124 | 124 | if (!msgbegin) |
| 125 | | hc = mutt_hcache_open (HeaderCache, ctx->path); |
| | 125 | hc = imap_hcache_open (idata, ctx->path); |
| 126 | 126 | |
| 127 | 127 | if (hc) |
-
|
r4973
|
r5046
|
|
| 67 | 67 | } |
| 68 | 68 | |
| | 69 | #ifdef USE_HCACHE |
| | 70 | void* imap_hcache_open (IMAP_DATA* idata, const char* path) |
| | 71 | { |
| | 72 | IMAP_MBOX mx; |
| | 73 | ciss_url_t url; |
| | 74 | char cachepath[LONG_STRING]; |
| | 75 | |
| | 76 | if (imap_parse_path (path, &mx) < 0) |
| | 77 | return NULL; |
| | 78 | |
| | 79 | mutt_account_tourl (&idata->conn->account, &url); |
| | 80 | url.path = mx.mbox; |
| | 81 | url_ciss_tostring (&url, cachepath, sizeof (cachepath), 0); |
| | 82 | FREE (&mx.mbox); |
| | 83 | |
| | 84 | return mutt_hcache_open (HeaderCache, cachepath); |
| | 85 | } |
| | 86 | #endif |
| | 87 | |
| 69 | 88 | /* imap_parse_path: given an IMAP mailbox name, return host, port |
| 70 | 89 | * and a path IMAP servers will recognise. |