Add a patch for mutt ticket #3296, IMAP header cache misbehaves on sparc64.

Bump PKGNAME.
This commit is contained in:
sthen 2009-07-29 20:26:45 +00:00
parent e9f63aa25b
commit 35ad27af80
4 changed files with 87 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.56 2009/07/28 09:21:24 sthen Exp $
# $OpenBSD: Makefile,v 1.57 2009/07/29 20:26:45 sthen Exp $
COMMENT= tty-based e-mail client, development version
VERSION= 1.5.20
DISTNAME= mutt-${VERSION}
PKGNAME= ${DISTNAME}p1
PKGNAME= ${DISTNAME}p2
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mutt/} \
${MASTER_SITES_MUTT:=devel/}

View File

@ -0,0 +1,53 @@
$OpenBSD: patch-hcache_c,v 1.1 2009/07/29 20:26:45 sthen Exp $
uidvalidity is an IMAP-specific uint32; ticket #3296
--- hcache.c.orig Mon Jun 1 17:29:32 2009
+++ hcache.c Wed Jul 29 20:48:32 2009
@@ -85,7 +85,7 @@ static void mutt_hcache_dbt_empty_init(DBT * dbt);
typedef union
{
struct timeval timeval;
- unsigned long uid_validity;
+ unsigned int uidvalidity;
} validate;
static void *
@@ -588,7 +588,7 @@ mutt_hcache_per_folder(const char *path, const char *f
* db_store */
static void *
mutt_hcache_dump(header_cache_t *h, HEADER * header, int *off,
- unsigned long uid_validity)
+ unsigned int uidvalidity)
{
unsigned char *d = NULL;
HEADER nh;
@@ -597,8 +597,8 @@ mutt_hcache_dump(header_cache_t *h, HEADER * header, i
*off = 0;
d = lazy_malloc(sizeof (validate));
- if (uid_validity)
- memcpy(d, &uid_validity, sizeof (unsigned long));
+ if (uidvalidity)
+ memcpy(d, &uidvalidity, sizeof (uidvalidity));
else
{
struct timeval now;
@@ -757,7 +757,7 @@ mutt_hcache_fetch_raw (header_cache_t *h, const char *
int
mutt_hcache_store(header_cache_t *h, const char *filename, HEADER * header,
- unsigned long uid_validity,
+ unsigned int uidvalidity,
size_t(*keylen) (const char *fn))
{
char* data;
@@ -767,7 +767,7 @@ mutt_hcache_store(header_cache_t *h, const char *filen
if (!h)
return -1;
- data = mutt_hcache_dump(h, header, &dlen, uid_validity);
+ data = mutt_hcache_dump(h, header, &dlen, uidvalidity);
ret = mutt_hcache_store_raw (h, filename, data, dlen, keylen);
FREE(&data);

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-hcache_h,v 1.1 2009/07/29 20:26:45 sthen Exp $
uidvalidity is an IMAP-specific uint32; ticket #3296
--- hcache.h.orig Tue Nov 11 19:55:46 2008
+++ hcache.h Wed Jul 29 20:48:32 2009
@@ -33,8 +33,9 @@ HEADER *mutt_hcache_restore(const unsigned char *d, HE
void *mutt_hcache_fetch(header_cache_t *h, const char *filename, size_t (*keylen)(const char *fn));
void *mutt_hcache_fetch_raw (header_cache_t *h, const char *filename,
size_t (*keylen)(const char *fn));
+/* uidvalidity is an IMAP-specific unsigned 32 bit number */
int mutt_hcache_store(header_cache_t *h, const char *filename, HEADER *header,
- unsigned long uid_validity, size_t (*keylen)(const char *fn));
+ unsigned int uidvalidity, size_t (*keylen)(const char *fn));
int mutt_hcache_store_raw (header_cache_t *h, const char* filename, void* data,
size_t dlen, size_t(*keylen) (const char* fn));
int mutt_hcache_delete(header_cache_t *h, const char *filename, size_t (*keylen)(const char *fn));

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-imap_util_c,v 1.1 2009/07/29 20:26:45 sthen Exp $
add hcache debug, re ticket #3296
--- imap/util.c.orig Wed Jun 10 05:17:20 2009
+++ imap/util.c Wed Jul 29 20:48:32 2009
@@ -129,6 +129,8 @@ HEADER* imap_hcache_get (IMAP_DATA* idata, unsigned in
{
if (*uv == idata->uid_validity)
h = mutt_hcache_restore ((unsigned char*)uv, NULL);
+ else
+ dprint (3, (debugfile, "hcache uidvalidity mismatch: %u", *uv));
FREE (&uv);
}