r3778 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Feb 17 10:50:06 CET 2009


Author: phk
Date: 2009-02-17 10:50:05 +0100 (Tue, 17 Feb 2009)
New Revision: 3778

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_center.c
Log:
Move the pass flag from the object to the objcore.



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2009-02-17 09:48:10 UTC (rev 3777)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2009-02-17 09:50:05 UTC (rev 3778)
@@ -268,6 +268,7 @@
 	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 ban		*ban;
 
-	unsigned		pass;
-
 	unsigned		response;
 
 	unsigned		cacheable;

Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2009-02-17 09:48:10 UTC (rev 3777)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2009-02-17 09:50:05 UTC (rev 3778)
@@ -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 at phk.freebsd.dk>
@@ -414,7 +414,8 @@
 		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 @@
 	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 @@
 		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);



More information about the varnish-commit mailing list