From: phk Date: Tue, 17 Feb 2009 09:50:05 +0000 (+0000) Subject: Move the pass flag from the object to the objcore. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1bc2abb43a052eded1f89f9b47a3712e94be0c5;p=varnish Move the pass flag from the object to the objcore. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3778 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index 80e6008c..8c185119 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -268,6 +268,7 @@ struct objcore { unsigned char flags; #define OC_F_ONLRU (1<<0) #define OC_F_BUSY (1<<1) +#define OC_F_PASS (1<<2) unsigned timer_idx; VTAILQ_ENTRY(objcore) list; VTAILQ_ENTRY(objcore) lru_list; @@ -289,8 +290,6 @@ struct object { struct ban *ban; - unsigned pass; - unsigned response; unsigned cacheable; diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index 746da36a..6bd98ca0 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2008 Linpro AS + * Copyright (c) 2006-2009 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp @@ -414,7 +414,8 @@ cnt_fetch(struct sess *sp) sp->step = STP_RECV; return (0); case VCL_RET_PASS: - sp->obj->pass = 1; + if (sp->obj->objcore != NULL) + sp->obj->objcore->flags |= OC_F_PASS; if (sp->obj->ttl - sp->t_req < params->default_ttl) sp->obj->ttl = sp->t_req + params->default_ttl; break; @@ -514,7 +515,7 @@ cnt_hit(struct sess *sp) CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC); - assert(!sp->obj->pass); + assert(!(sp->obj->objcore->flags & OC_F_PASS)); VCL_hit_method(sp); @@ -607,7 +608,7 @@ cnt_lookup(struct sess *sp) return (0); } - if (sp->obj->pass) { + if (sp->obj->objcore->flags & OC_F_PASS) { VSL_stats->cache_hitpass++; WSP(sp, SLT_HitPass, "%u", sp->obj->xid); HSH_Deref(&sp->obj);