r5728 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Thu Jan 13 12:07:52 CET 2011


Author: phk
Date: 2011-01-13 12:07:52 +0100 (Thu, 13 Jan 2011)
New Revision: 5728

Modified:
   trunk/varnish-cache/bin/varnishd/cache_esi_parse.c
Log:
Make esi:remove discard any attributes



Modified: trunk/varnish-cache/bin/varnishd/cache_esi_parse.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_esi_parse.c	2011-01-13 10:49:56 UTC (rev 5727)
+++ trunk/varnish-cache/bin/varnishd/cache_esi_parse.c	2011-01-13 11:07:52 UTC (rev 5728)
@@ -308,6 +308,20 @@
  */
 
 static void
+vep_do_nothing(struct vep_state *vep, enum dowhat what)
+{
+	printf("DO_NOTHING(%d)\n", what);
+	if (what == DO_ATTR) {
+		printf("ATTR (%s) (%s)\n", vep->match_hit->match,
+			vsb_data(vep->attr_vsb));
+		vsb_delete(vep->attr_vsb);
+	}
+}
+
+/*---------------------------------------------------------------------
+ */
+
+static void
 vep_do_include(struct vep_state *vep, enum dowhat what)
 {
 
@@ -512,7 +526,9 @@
 			vep->attr = vep_match_attr_include;
 			vep->attr_l = vep_match_attr_include_len;
 		} else if (vep->state == VEP_ESIREMOVE) {
+			vep->dostuff = vep_do_nothing;
 			vep->remove = !vep->endtag;
+			vep->state = VEP_INTAG;
 
 		/******************************************************
 		 * SECTION F
@@ -731,6 +747,7 @@
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	AZ(sp->wrk->vep);
+	/* XXX: snapshot WS ? We'll need the space */
 	vep = (void*)WS_Alloc(sp->wrk->ws, sizeof *vep);
 	AN(vep);
 
@@ -799,6 +816,7 @@
 	if (st->len < st->space)
 		STV_trim(st, st->len);
 	VTAILQ_INSERT_TAIL(&sp->obj->store, st, list);
+	sp->wrk->vep = NULL;
 	return (0);
 }
 




More information about the varnish-commit mailing list