varnishncsa: handle inexistent fields

fixes #3485
parent b609a537
......@@ -797,7 +797,8 @@ frag_fields(int force, const char *b, const char *e, ...)
n++;
}
assert(p != NULL && q != NULL);
assert(p < e && q > p);
if (p >= e || q <= p)
continue;
if (frag->gen != CTX.gen || force) {
/* We only grab the same matching field once */
frag->gen = CTX.gen;
......
......@@ -142,12 +142,12 @@ shell -match {^\d+.\d{6} miss miss c 1001 quuz
%{Varnish:vxid}x %{VCL_Log:quux}x"}
# %{VSL:..}x
shell -match {^req (\d+) rxreq \1 \d{10}\.\d{6} (\d+\.\d{6}) \d+\.\d{6} \2 -
req (\d+) rxreq \3 \d{10}\.\d{6} (\d+\.\d{6}) \d+\.\d{6} \4 -
req (\d+) rxreq \5 - - -$} \
shell -match {^req (\d+) rxreq \1 \d{10}\.\d{6} (\d+\.\d{6}) \d+\.\d{6} \2 - -
req (\d+) rxreq \3 \d{10}\.\d{6} (\d+\.\d{6}) \d+\.\d{6} \4 - -
req (\d+) rxreq \5 - - - -$} \
{varnishncsa -n ${v1_name} -d -F "%{VSL:Begin}x \
%{VSL:Begin[2]}x %{VSL:Timestamp:Resp}x \
%{VSL:Timestamp:Resp[2]}x %{VSL:Timestamp:foo}x"}
%{VSL:Timestamp:Resp[2]}x %{VSL:Timestamp:foo}x %{VSL:ReqURL[2]}x"}
process p1 -stop -screen-dump
process p1 -expect-text 1 0 {/1?foo=bar HTTP/1.1" 200 100 "-" "-"}
......
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