Show
Ignore:
Timestamp:
2007-04-10 16:07:53 (21 months ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

Do not hold hcache open while mailbox is open - it can lead to lockups

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • imap/util.c

    r5111 r5112  
    7272 
    7373#ifdef USE_HCACHE 
    74 header_cache_t* imap_hcache_open (IMAP_DATA* idata, const char* path) 
     74int imap_hcache_open (IMAP_DATA* idata) 
    7575{ 
    7676  IMAP_MBOX mx; 
     
    7878  char cachepath[LONG_STRING]; 
    7979 
    80   if (imap_parse_path (path, &mx) < 0) 
    81     return NULL; 
     80  if (imap_parse_path (idata->ctx->path, &mx) < 0) 
     81    return -1; 
    8282 
    8383  mutt_account_tourl (&idata->conn->account, &url); 
     
    8686  FREE (&mx.mbox); 
    8787 
    88   return mutt_hcache_open (HeaderCache, cachepath); 
     88  idata->hcache = mutt_hcache_open (HeaderCache, cachepath); 
     89 
     90  return idata->hcache != NULL ? 0 : -1; 
     91} 
     92 
     93void imap_hcache_close (IMAP_DATA* idata) 
     94{ 
     95  if (!idata->hcache) 
     96    return; 
     97 
     98  mutt_hcache_close (idata->hcache); 
     99  idata->hcache = NULL; 
    89100} 
    90101