]> err.no Git - varnish/commitdiff
Move the pass flag from the object to the objcore.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 17 Feb 2009 09:50:05 +0000 (09:50 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 17 Feb 2009 09:50:05 +0000 (09:50 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3778 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_center.c

index 80e6008c7cfc3f2ebed2edb8f2c5a2d6d4fd9f9e..8c185119f78f793efee2c39057fd7331ffddb8ff 100644 (file)
@@ -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;
index 746da36a177a97084f5fe9018862f68b0cb50e11..6bd98ca0bc7b971f9d7219eb3542386f15131edc 100644 (file)
@@ -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 <phk@phk.freebsd.dk>
@@ -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);