Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
5375a6cf
Commit
5375a6cf
authored
Aug 14, 2019
by
Shohei Tanaka(@xcir)
Committed by
Poul-Henning Kamp
Aug 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add show ESI option(-e)
parent
f4dcf8f0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
1 deletion
+43
-1
varnishncsa.c
bin/varnishncsa/varnishncsa.c
+6
-1
varnishncsa_options.h
bin/varnishncsa/varnishncsa_options.h
+5
-0
e00033.vtc
bin/varnishtest/tests/e00033.vtc
+32
-0
No files found.
bin/varnishncsa/varnishncsa.c
View file @
5375a6cf
...
@@ -140,6 +140,7 @@ static struct ctx {
...
@@ -140,6 +140,7 @@ static struct ctx {
int
a_opt
;
int
a_opt
;
int
b_opt
;
int
b_opt
;
int
c_opt
;
int
c_opt
;
int
e_opt
;
char
*
w_arg
;
char
*
w_arg
;
FILE
*
fo
;
FILE
*
fo
;
...
@@ -891,7 +892,7 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
...
@@ -891,7 +892,7 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
be_mark
=
BACKEND_MARKER
;
be_mark
=
BACKEND_MARKER
;
}
else
}
else
continue
;
continue
;
if
(
t
->
reason
==
VSL_r_esi
)
if
(
t
->
reason
==
VSL_r_esi
&&
!
CTX
.
e_opt
)
/* Skip ESI requests */
/* Skip ESI requests */
continue
;
continue
;
CTX
.
hitmiss
=
"-"
;
CTX
.
hitmiss
=
"-"
;
...
@@ -1111,6 +1112,10 @@ main(int argc, char * const *argv)
...
@@ -1111,6 +1112,10 @@ main(int argc, char * const *argv)
/* client mode */
/* client mode */
CTX
.
c_opt
=
1
;
CTX
.
c_opt
=
1
;
break
;
break
;
case
'e'
:
/* show ESI */
CTX
.
e_opt
=
1
;
break
;
case
'F'
:
case
'F'
:
if
(
format
!=
NULL
)
if
(
format
!=
NULL
)
VUT_Error
(
vut
,
1
,
"Format already set"
);
VUT_Error
(
vut
,
1
,
"Format already set"
);
...
...
bin/varnishncsa/varnishncsa_options.h
View file @
5375a6cf
...
@@ -72,10 +72,15 @@
...
@@ -72,10 +72,15 @@
"Log client requests. This is the default. If -b is" \
"Log client requests. This is the default. If -b is" \
" specified, then -c is needed to also log client requests" \
" specified, then -c is needed to also log client requests" \
)
)
#define NCSA_OPT_e \
VOPT("e", "[-e]", "Show ESI request", \
"Show ESI request." \
)
NCSA_OPT_a
NCSA_OPT_a
NCSA_OPT_b
NCSA_OPT_b
NCSA_OPT_c
NCSA_OPT_c
NCSA_OPT_e
VSL_OPT_C
VSL_OPT_C
VUT_OPT_d
VUT_OPT_d
VUT_GLOBAL_OPT_D
VUT_GLOBAL_OPT_D
...
...
bin/varnishtest/tests/e00033.vtc
0 → 100644
View file @
5375a6cf
varnishtest "varnishncsa show ESI request"
server s1 {
rxreq
txresp -body {
<html>
Before include
<esi:include
src=
"/esi"
/>
After include
</html>
}
rxreq
txresp -body {
Included file
}
} -start
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.do_esi = true;
}
} -start
client c1 {
txreq
rxresp
} -run
shell -match "^0$" "varnishncsa -n ${v1_name} -d -q \"requrl ~ '/esi'\" | wc -l"
shell -match "^1$" "varnishncsa -n ${v1_name} -d -q \"requrl ~ '/esi'\" -e | wc -l"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment