From 295846b57b353442df81779619ce80221ebe9a5f Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 26 Feb 2008 09:23:39 +0000 Subject: [PATCH] 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 --- varnish-cache/bin/varnishd/cache_expire.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.39.5