r5744 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Fri Jan 14 01:40:11 CET 2011


Author: phk
Date: 2011-01-14 01:40:10 +0100 (Fri, 14 Jan 2011)
New Revision: 5744

Modified:
   trunk/varnish-cache/bin/varnishd/cache_esi.h
   trunk/varnish-cache/bin/varnishd/cache_esi_deliver.c
   trunk/varnish-cache/bin/varnishd/cache_esi_parse.c
Log:
When we fail a buffered match on '>' don't ask for more, fail it.

Drop the VEC literal stuff until we need it.



Modified: trunk/varnish-cache/bin/varnishd/cache_esi.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_esi.h	2011-01-13 23:52:40 UTC (rev 5743)
+++ trunk/varnish-cache/bin/varnishd/cache_esi.h	2011-01-14 00:40:10 UTC (rev 5744)
@@ -33,7 +33,4 @@
 #define	VEC_S1	'b'
 #define	VEC_S2	'w'
 #define	VEC_S8	'l'
-#define	VEC_L1	'c'
-#define	VEC_L2	'x'
-#define	VEC_L8	'm'
 #define	VEC_INCL	'I'

Modified: trunk/varnish-cache/bin/varnishd/cache_esi_deliver.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_esi_deliver.c	2011-01-13 23:52:40 UTC (rev 5743)
+++ trunk/varnish-cache/bin/varnishd/cache_esi_deliver.c	2011-01-14 00:40:10 UTC (rev 5744)
@@ -203,15 +203,6 @@
 			Debug("SKIP8(%d)\n", (int)l);
 			off += l;
 			break;
-		case VEC_L1:
-			l = p[1];
-			p += 2;
-			q = (void*)strchr((const char*)p, '\0');
-			assert (q > p);
-			Debug("LIT(%d) %d\n", (int)l, (int)(q-p));
-			esi_sendchunk(sp, p, q - p, q + 1, l);
-			p = p + l;
-			break;
 		case VEC_INCL:
 			p++;
 			q = (void*)strchr((const char*)p, '\0');

Modified: trunk/varnish-cache/bin/varnishd/cache_esi_parse.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_esi_parse.c	2011-01-13 23:52:40 UTC (rev 5743)
+++ trunk/varnish-cache/bin/varnishd/cache_esi_parse.c	2011-01-14 00:40:10 UTC (rev 5744)
@@ -200,6 +200,7 @@
 /*---------------------------------------------------------------------
  * return match or NULL if more input needed.
  */
+
 static struct vep_match *
 vep_match(struct vep_state *vep, const char *b, const char *e)
 {
@@ -278,27 +279,7 @@
 	vsb_printf(vep->vsb, "%lx\r\n%c", l, 0);
 } 
 
-#if 0
 static void
-vep_emit_literal(struct vep_state *vep, const char *p, const char *e)
-{
-	ssize_t l;
-
-	if (e == NULL)
-		e = strchr(p, '\0');
-	if (vep->o_verbatim > 0) 
-		vep_emit_verbatim(vep);
-	if (vep->o_skip > 0) 
-		vep_emit_skip(vep);
-	l = e - p;
-	Debug("---->L(%d) [%.*s]\n", (int)l, (int)l, p);
-	vep_emit_len(vep, l, VEC_L1, VEC_L2, VEC_L8);
-	vsb_printf(vep->vsb, "%lx\r\n%c", l, 0);
-	vsb_bcat(vep->vsb, p, l);
-}
-#endif
-
-static void
 vep_mark_verbatim(struct vep_state *vep, const char *p)
 {
 	ssize_t l;
@@ -516,14 +497,12 @@
 				p++;
 				vep_mark_verbatim(vep, p);
 			}
-			if (p < e) {
-				if (*p == '<') {
-					vep->state = VEP_STARTTAG;
-				} else {
-					WSP(vep->sp, SLT_ESI_xmlerror,
-					    "No ESI processing, first char not '<'");
-					vep->state = VEP_NOTXML;
-				}
+			if (p < e && *p == '<') {
+				vep->state = VEP_STARTTAG;
+			} else if (p < e) {
+				WSP(vep->sp, SLT_ESI_xmlerror,
+				    "No ESI processing, first char not '<'");
+				vep->state = VEP_NOTXML;
 			}
 		} else if (vep->state == VEP_NOTXML) {
 			/*
@@ -835,7 +814,7 @@
 			 */
 			do {
 				if (*p == '>') {
-					vm = NULL;
+					vm = vep->match+vep->match_l-1;
 				} else {
 					vep->tag[vep->tag_i++] = *p++;
 					vm = vep_match(vep,
@@ -905,9 +884,14 @@
 		vep->ver_p = (const char *)st->ptr + st->len;
 #if 0
 		{
-		for (l = 0; l < w; l++) 
-			vep_parse(vep, (const char *)st->ptr + st->len + l, 1);
+		ssize_t d;
+		for (l = 0; l < w; l += d)  {
+			d = 1;
+			if (l + d >= w)
+				d = 1;
+			vep_parse(vep, (const char *)st->ptr + st->len + l, d);
 		}
+		}
 #else
 		vep_parse(vep, (const char *)st->ptr + st->len, w);
 #endif




More information about the varnish-commit mailing list