r5078 - in trunk/varnish-cache: bin/varnishd bin/varnishtest/tests doc/sphinx/reference lib/libvcl

kristian at varnish-cache.org kristian at varnish-cache.org
Tue Aug 10 10:27:07 CEST 2010


Author: kristian
Date: 2010-08-10 10:27:07 +0200 (Tue, 10 Aug 2010)
New Revision: 5078

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
   trunk/varnish-cache/bin/varnishd/cache_hash.c
   trunk/varnish-cache/bin/varnishd/steps.h
   trunk/varnish-cache/bin/varnishtest/tests/c00035.vtc
   trunk/varnish-cache/doc/sphinx/reference/vcl.rst
   trunk/varnish-cache/lib/libvcl/generate.py
Log:
Revert the return(refresh) patches

(better approach coming soon-ish)



Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2010-08-09 15:05:52 UTC (rev 5077)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2010-08-10 08:27:07 UTC (rev 5078)
@@ -830,11 +830,6 @@
 	return (0);
 }
 
-static int
-cnt_refresh(struct sess *sp)
-{
-	return cnt_lookup(sp);
-}
 /*--------------------------------------------------------------------
  * We had a miss, ask VCL, proceed as instructed
  *
@@ -1070,9 +1065,6 @@
 		/* XXX: discard req body, if any */
 		sp->step = STP_LOOKUP;
 		return (0);
-	case VCL_RET_REFRESH:
-		sp->step = STP_REFRESH;
-		return (0);
 	case VCL_RET_PIPE:
 		if (sp->esis > 0) {
 			/* XXX: VSL something */
@@ -1217,7 +1209,6 @@
 	    sp->step == STP_FIRST ||
 	    sp->step == STP_START ||
 	    sp->step == STP_LOOKUP ||
-	    sp->step == STP_REFRESH ||
 	    sp->step == STP_RECV);
 
 	/*

Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-08-09 15:05:52 UTC (rev 5077)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-08-10 08:27:07 UTC (rev 5078)
@@ -402,8 +402,7 @@
 	if (oc == NULL			/* We found no live object */
 	    && grace_oc != NULL		/* There is a grace candidate */
 	    && (busy_oc != NULL		/* Somebody else is already busy */
-	    || !VBE_Healthy(sp->t_req, sp->director, (uintptr_t)oh))
-	    && sp->step != STP_REFRESH) {
+	    || !VBE_Healthy(sp->t_req, sp->director, (uintptr_t)oh))) {
 					 /* Or it is impossible to fetch: */
 		o = grace_oc->obj;
 		CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
@@ -415,24 +414,16 @@
 		o = oc->obj;
 		CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
 		assert(oc->objhead == oh);
-		if (sp->step == STP_REFRESH) {
-			if (o->ttl >= sp->t_req) {
-				o->ttl = sp->t_req - 1;
-				o->grace = HSH_Grace(sp->grace);
-				EXP_Rearm(o);
-			}
-			o = NULL;
-		} else {
-			/* We found an object we like */
-			oc->refcnt++;
-			if (o->hits < INT_MAX)
-				o->hits++;
-			assert(oh->refcnt > 1);
-			Lck_Unlock(&oh->mtx);
-			assert(hash->deref(oh));
-			*poh = oh;
-			return (oc);
-		}
+
+		/* We found an object we like */
+		oc->refcnt++;
+		if (o->hits < INT_MAX)
+			o->hits++;
+		assert(oh->refcnt > 1);
+		Lck_Unlock(&oh->mtx);
+		assert(hash->deref(oh));
+		*poh = oh;
+		return (oc);
 	}
 
 	if (busy_oc != NULL) {

Modified: trunk/varnish-cache/bin/varnishd/steps.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/steps.h	2010-08-09 15:05:52 UTC (rev 5077)
+++ trunk/varnish-cache/bin/varnishd/steps.h	2010-08-10 08:27:07 UTC (rev 5078)
@@ -36,7 +36,6 @@
 STEP(pipe,	PIPE)
 STEP(pass,	PASS)
 STEP(lookup,	LOOKUP)
-STEP(refresh,	REFRESH)
 STEP(miss,	MISS)
 STEP(hit,	HIT)
 STEP(fetch,	FETCH)

Modified: trunk/varnish-cache/bin/varnishtest/tests/c00035.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/c00035.vtc	2010-08-09 15:05:52 UTC (rev 5077)
+++ trunk/varnish-cache/bin/varnishtest/tests/c00035.vtc	2010-08-10 08:27:07 UTC (rev 5078)
@@ -1,38 +0,0 @@
-# $Id: c00024.vtc 4651 2010-04-08 16:21:16Z phk $
-
-test "Test return(refresh) in vcl_recv"
-
-server s1 {
-        rxreq 
-        txresp -hdr "Inc: 1"
-        rxreq 
-        txresp -hdr "Inc: 2"
-} -start
-
-varnish v1 -vcl+backend { 
-	sub vcl_recv {
-		if (req.http.x-refresh == "1") {
-			return(refresh);
-		}
-	}
- } -start 
-
-client c1 {
-        txreq -url "/"
-        rxresp
-        expect resp.status == 200
-	expect resp.http.Inc == "1"
-        txreq -url "/"
-        rxresp
-        expect resp.status == 200
-	expect resp.http.Inc == "1"
-        txreq -url "/" -hdr "x-refresh: 1"
-        rxresp
-        expect resp.status == 200
-	expect resp.http.Inc == "2"
-        txreq -url "/"
-        rxresp
-        expect resp.status == 200
-	expect resp.http.Inc == "2"
-} -run
-

Modified: trunk/varnish-cache/doc/sphinx/reference/vcl.rst
===================================================================
--- trunk/varnish-cache/doc/sphinx/reference/vcl.rst	2010-08-09 15:05:52 UTC (rev 5077)
+++ trunk/varnish-cache/doc/sphinx/reference/vcl.rst	2010-08-10 08:27:07 UTC (rev 5078)
@@ -310,11 +310,6 @@
   pipe    
     Switch to pipe mode.  Control will eventually pass to vcl_pipe.
 
-  refresh
-    Go through normal caching channels, but guarantee a cache miss even if
-    there is valid content in the cache, thereby performing a controlled
-    refresh of the content.
-
   lookup  
     Look up the requested object in the cache.  Control will
     eventually pass to vcl_hit or vcl_miss, depending on whether the

Modified: trunk/varnish-cache/lib/libvcl/generate.py
===================================================================
--- trunk/varnish-cache/lib/libvcl/generate.py	2010-08-09 15:05:52 UTC (rev 5077)
+++ trunk/varnish-cache/lib/libvcl/generate.py	2010-08-10 08:27:07 UTC (rev 5078)
@@ -84,7 +84,7 @@
 # Our methods and actions
 
 returns =(
-	('recv',	('error', 'pass', 'pipe', 'refresh','lookup',)),
+	('recv',	('error', 'pass', 'pipe', 'lookup',)),
 	('pipe',	('error', 'pipe',)),
 	('pass',	('error', 'restart', 'pass',)),
 	('hash',	('hash',)),




More information about the varnish-commit mailing list