struct object *obj;
VTAILQ_FOREACH(eb, &sp->obj->esibits, list) {
- WRK_Write(sp->wrk, eb->chunk_length, -1);
- WRK_Write(sp->wrk, eb->verbatim.b, Tlen(eb->verbatim));
- WRK_Write(sp->wrk, "\r\n", -1);
+ if (Tlen(eb->verbatim)) {
+ WRK_Write(sp->wrk, eb->chunk_length, -1);
+ WRK_Write(sp->wrk, eb->verbatim.b, Tlen(eb->verbatim));
+ WRK_Write(sp->wrk, "\r\n", -1);
+ }
if (eb->include.b == NULL ||
sp->esis >= params->max_esi_includes)
continue;
--- /dev/null
+# $Id: e00008.vtc 3012 2008-07-24 12:22:35Z des $
+
+test "No zerolength verbatim before <esi:include...>"
+
+server s1 {
+ rxreq
+ txresp -body {<esi:include src="/foo"/><esi:include src="/foo"/>}
+ rxreq
+ txresp -body "FOO\n"
+} -start
+
+varnish v1 -vcl+backend {
+ sub vcl_fetch {
+ esi;
+ }
+} -start
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.status == 200
+ expect resp.bodylen == 8
+} -run