Commit 9f15b012 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Only do ESI processing if we find some ESI in the object.

parent 6f038c18
......@@ -70,6 +70,7 @@ struct vep_state {
/* parser state */
const char *state;
unsigned startup;
unsigned esi_found;
unsigned endtag;
unsigned emptytag;
......@@ -655,6 +656,7 @@ VEP_parse(const struct sess *sp, const char *p, size_t l)
vep_mark_verbatim(vep, p);
p++;
if (*++vep->esicmt_p == '\0') {
vep->esi_found = 1;
vep->esicmt = NULL;
vep->esicmt_p = NULL;
/*
......@@ -727,6 +729,7 @@ VEP_parse(const struct sess *sp, const char *p, size_t l)
vep->state = VEP_UNTIL;
} else if (vep->state == VEP_ESITAG) {
vep->in_esi_tag = 1;
vep->esi_found = 1;
vep_mark_skip(vep, p);
vep->match = vep_match_esi;
vep->state = VEP_MATCH;
......@@ -1055,7 +1058,7 @@ VEP_Finish(const struct sess *sp)
AZ(vsb_finish(vep->vsb));
l = vsb_len(vep->vsb);
if (vep->state != VEP_NOTXML && l > 0)
if (vep->esi_found && l > 0)
return (vep->vsb);
vsb_delete(vep->vsb);
return (NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment