]> err.no Git - varnish/commitdiff
Fix a bug in the hangman code: conversion from object to objexp
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 26 Feb 2008 09:23:39 +0000 (09:23 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 26 Feb 2008 09:23:39 +0000 (09:23 +0000)
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

index 42dc032718db2a5585228fa9e6416cf91671aea8..1060338e76674abf8d1c6d09898d101fa69163d7 100644 (file)
@@ -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) {