Commit 1000b772 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

varnishncsa: -E implies -c

Otherwise the combination of -E and -b only outputs backend requests.
parent 656f7714
......@@ -1157,7 +1157,7 @@ main(int argc, char * const *argv)
}
}
/* default is client mode: */
if (!CTX.b_opt)
if (!CTX.b_opt || CTX.E_opt)
CTX.c_opt = 1;
if (optind != argc)
......
......@@ -70,13 +70,13 @@
" backend requests will trigger log lines." \
)
#define NCSA_OPT_c \
VOPT("c", "[-c]", "Client mode", \
VOPT("c", "[-c]", "Client mode", \
"Log client requests. This is the default. If -b is" \
" specified, then -c is needed to also log client requests" \
)
#define NCSA_OPT_E \
VOPT("E", "[-E]", "Show ESI request", \
"Show ESI request." \
VOPT("E", "[-E]", "Show ESI requests", \
"Show ESI requests, implies client mode." \
)
NCSA_OPT_a
......
varnishtest "ESI include"
server s1 {
rxreq
expect req.http.esi0 == "foo"
......@@ -92,3 +91,19 @@ logexpect l2 -wait
logexpect l3 -wait
logexpect l4 -wait
logexpect l5 -wait
shell {
varnishncsa -n ${v1_name} -d -b -E \
-F '%{Varnish:vxid}x %{Varnish:side}x %{VSL:Begin[3]}x' |
sort > ncsa.txt
cat >expected.txt <<-EOF
1001 c rxreq
1002 b fetch
1003 c esi
1004 b fetch
1005 c rxreq
1006 c esi
EOF
diff -u expected.txt ncsa.txt
}
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