r3633 - branches/2.0/varnish-cache/bin/varnishd

tfheen at projects.linpro.no tfheen at projects.linpro.no
Fri Feb 6 09:44:49 CET 2009


Author: tfheen
Date: 2009-02-06 09:44:48 +0100 (Fri, 06 Feb 2009)
New Revision: 3633

Modified:
   branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c
   branches/2.0/varnish-cache/bin/varnishd/mgt_param.c
Log:
Merge r3431: Control the ESI parsing debug records with the esi_syntax bitmap parameter.



Modified: branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c	2009-02-05 13:09:21 UTC (rev 3632)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c	2009-02-06 08:44:48 UTC (rev 3633)
@@ -158,8 +158,9 @@
 	VTAILQ_INSERT_TAIL(&ew->sp->obj->esibits, ew->eb, list);
 	ew->eb->verbatim = ew->dst;
 	sprintf(ew->eb->chunk_length, "%x\r\n", Tlen(ew->dst));
-	VSL(SLT_Debug, ew->sp->fd, "AddBit: %d <%.*s>",
-	    Tlen(ew->dst), Tlen(ew->dst), ew->dst.b);
+	if (params->esi_syntax & 0x4)
+		VSL(SLT_Debug, ew->sp->fd, "AddBit: %d <%.*s>",
+		    Tlen(ew->dst), Tlen(ew->dst), ew->dst.b);
 	return(ew->eb);
 }
 
@@ -172,8 +173,9 @@
 esi_addverbatim(struct esi_work *ew)
 {
 
-	VSL(SLT_Debug, ew->sp->fd, "AddVer: %d <%.*s>",
-	    Tlen(ew->o), Tlen(ew->o), ew->o.b);
+	if (params->esi_syntax & 0x4)
+		VSL(SLT_Debug, ew->sp->fd, "AddVer: %d <%.*s>",
+		    Tlen(ew->o), Tlen(ew->o), ew->o.b);
 	if (ew->o.b != ew->dst.e)
 		memmove(ew->dst.e, ew->o.b, Tlen(ew->o));
 	ew->dst.e += Tlen(ew->o);
@@ -283,9 +285,9 @@
 	VSL(SLT_Debug, 0, "Incl \"%.*s\"", t.e - t.b, t.b);
 	eb = esi_addbit(ew);
 	while (esi_attrib(ew, &t, &tag, &val) == 1) {
-		VSL(SLT_Debug, 0, "<%.*s> -> <%.*s>",
-		    tag.e - tag.b, tag.b,
-		    val.e - val.b, val.b);
+		if (params->esi_syntax & 0x4)
+			VSL(SLT_Debug, 0, "<%.*s> -> <%.*s>",
+			    tag.e - tag.b, tag.b, val.e - val.b, val.b);
 		if (Tlen(tag) != 3 || memcmp(tag.b, "src", 3))
 			continue;
 		if (Tlen(val) == 0) {
@@ -496,8 +498,9 @@
 			r = p + 1;
 		}
 
-		VSL(SLT_Debug, ew->sp->fd, "Element: clos=%d [%.*s]",
-		    celem, q - r, r);
+		if (params->esi_syntax & 0x4)
+			VSL(SLT_Debug, ew->sp->fd, "Element: clos=%d [%.*s]",
+			    celem, q - r, r);
 
 		if (r + 9 < q && !memcmp(r, "esi:remove", 10)) {
 
@@ -612,8 +615,9 @@
 {
 	char *p;
 
-	VSL(SLT_Debug, ew->sp->fd, "Parse: %d <%.*s>",
-	    Tlen(ew->t), Tlen(ew->t), ew->t.b);
+	if (params->esi_syntax & 0x4)
+		VSL(SLT_Debug, ew->sp->fd, "Parse: %d <%.*s>",
+		    Tlen(ew->t), Tlen(ew->t), ew->t.b);
 	p = esi_parse2(ew);
 	assert(ew->o.b >= ew->t.b);
 	assert(ew->o.e <= ew->t.e);

Modified: branches/2.0/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/mgt_param.c	2009-02-05 13:09:21 UTC (rev 3632)
+++ branches/2.0/varnish-cache/bin/varnishd/mgt_param.c	2009-02-06 08:44:48 UTC (rev 3633)
@@ -764,6 +764,7 @@
 		"Bitmap controlling ESI parsing code:\n"
 		"  0x00000001 - Don't check if it looks like XML\n"
 		"  0x00000002 - Ignore non-esi elements\n"
+		"  0x00000004 - Emit parsing debug records\n"
 		"Use 0x notation and do the bitor in your head :-)\n",
 		0,
 		"0", "bitmap" },



More information about the varnish-commit mailing list