From: phk Date: Tue, 26 Feb 2008 09:23:39 +0000 (+0000) Subject: Fix a bug in the hangman code: conversion from object to objexp X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=295846b57b353442df81779619ce80221ebe9a5f;p=varnish Fix a bug in the hangman code: conversion from object to objexp missed a marker variable. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2542 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_expire.c b/varnish-cache/bin/varnishd/cache_expire.c index 42dc0327..1060338e 100644 --- a/varnish-cache/bin/varnishd/cache_expire.c +++ b/varnish-cache/bin/varnishd/cache_expire.c @@ -98,6 +98,7 @@ add_objexp(struct object *o) CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); AZ(o->objexp); assert(o->busy); + assert(o->cacheable); o->objexp = calloc(sizeof *o->objexp, 1); AN(o->objexp); o->objexp->magic = OBJEXP_MAGIC; @@ -126,6 +127,7 @@ update_object_when(const struct object *o) { struct objexp *oe; + CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); oe = o->objexp; CHECK_OBJ_NOTNULL(oe, OBJEXP_MAGIC); @@ -250,7 +252,7 @@ exp_hangman(void *arg) o = oe->obj; CHECK_OBJ(o, OBJECT_MAGIC); if (o->ttl >= t) { - o = NULL; + oe = NULL; break; } if (o->busy) {