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
f0232502
Commit
f0232502
authored
Apr 18, 2018
by
Nils Goroll
Committed by
Dridi Boukelmoune
Jun 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
promote resp.body / beresp.body syntax a bit more
Should we plan to phase out synthetic() ?
parent
5cde1b15
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
13 deletions
+19
-13
b00017.vtc
bin/varnishtest/tests/b00017.vtc
+3
-2
c00063.vtc
bin/varnishtest/tests/c00063.vtc
+3
-1
c00068.vtc
bin/varnishtest/tests/c00068.vtc
+1
-1
m00004.vtc
bin/varnishtest/tests/m00004.vtc
+4
-4
r01688.vtc
bin/varnishtest/tests/r01688.vtc
+2
-1
r01838.vtc
bin/varnishtest/tests/r01838.vtc
+1
-1
r02429.vtc
bin/varnishtest/tests/r02429.vtc
+1
-1
vcl.rst
doc/sphinx/reference/vcl.rst
+4
-2
No files found.
bin/varnishtest/tests/b00017.vtc
View file @
f0232502
...
@@ -9,7 +9,7 @@ varnish v1 -vcl {
...
@@ -9,7 +9,7 @@ varnish v1 -vcl {
}
}
sub vcl_synth {
sub vcl_synth {
s
ynthetic("Custom vcl_synth's synth output")
;
s
et resp.body = "Custom vcl_synth's body"
;
return (deliver);
return (deliver);
}
}
} -start
} -start
...
@@ -18,8 +18,9 @@ client c1 {
...
@@ -18,8 +18,9 @@ client c1 {
txreq -url "/"
txreq -url "/"
rxresp
rxresp
expect resp.status == 888
expect resp.status == 888
expect resp.bodylen == 31
expect resp.http.connection != close
expect resp.http.connection != close
expect resp.bodylen == 23
expect resp.body == "Custom vcl_synth's body"
} -run
} -run
varnish v1 -expect s_synth == 1
varnish v1 -expect s_synth == 1
bin/varnishtest/tests/c00063.vtc
View file @
f0232502
...
@@ -8,7 +8,7 @@ varnish v1 -vcl {
...
@@ -8,7 +8,7 @@ varnish v1 -vcl {
set beresp.ttl = 1s;
set beresp.ttl = 1s;
set beresp.grace = 3s;
set beresp.grace = 3s;
set beresp.http.foobar = "BLA" + bereq.xid;
set beresp.http.foobar = "BLA" + bereq.xid;
s
ynthetic(beresp.http.foobar)
;
s
et beresp.body = beresp.http.foobar
;
return (deliver);
return (deliver);
}
}
} -start
} -start
...
@@ -24,9 +24,11 @@ client c1 {
...
@@ -24,9 +24,11 @@ client c1 {
txreq
txreq
rxresp
rxresp
expect resp.http.foobar == "BLA1002"
expect resp.http.foobar == "BLA1002"
expect resp.body == "BLA1002"
delay 3
delay 3
txreq
txreq
rxresp
rxresp
expect resp.http.foobar == "BLA1004"
expect resp.http.foobar == "BLA1004"
expect resp.body == "BLA1004"
} -run
} -run
bin/varnishtest/tests/c00068.vtc
View file @
f0232502
...
@@ -37,7 +37,7 @@ varnish v1 -vcl+backend {
...
@@ -37,7 +37,7 @@ varnish v1 -vcl+backend {
return (restart);
return (restart);
} else {
} else {
set resp.http.restarts = req.restarts;
set resp.http.restarts = req.restarts;
s
ynthetic(req.restarts)
;
s
et resp.body = req.restarts
;
}
}
}
}
return (deliver);
return (deliver);
...
...
bin/varnishtest/tests/m00004.vtc
View file @
f0232502
...
@@ -42,8 +42,8 @@ varnish v1 -vcl+backend {
...
@@ -42,8 +42,8 @@ varnish v1 -vcl+backend {
}
}
sub vcl_synth {
sub vcl_synth {
s
ynthetic(
"Response was served by "
s
et resp.body =
"Response was served by "
+ std.fileread("${tmpdir}/m00004_file_four")
);
+ std.fileread("${tmpdir}/m00004_file_four"
);
return(deliver);
return(deliver);
}
}
} -start
} -start
...
@@ -111,8 +111,8 @@ varnish v1 -vcl+backend {
...
@@ -111,8 +111,8 @@ varnish v1 -vcl+backend {
}
}
sub vcl_synth {
sub vcl_synth {
s
ynthetic(
"Response was served by "
s
et resp.body =
"Response was served by "
+ std.fileread("${tmpdir}/m00004_file_four")
);
+ std.fileread("${tmpdir}/m00004_file_four"
);
return(deliver);
return(deliver);
}
}
}
}
...
...
bin/varnishtest/tests/r01688.vtc
View file @
f0232502
...
@@ -18,7 +18,8 @@ varnish v1 -vcl+backend {
...
@@ -18,7 +18,8 @@ varnish v1 -vcl+backend {
sub vcl_synth {
sub vcl_synth {
if (resp.status == 998) {
if (resp.status == 998) {
synthetic("this is the body of an included synthetic response");
set resp.body = "this is the body of an " +
"included synthetic response";
return(deliver);
return(deliver);
}
}
}
}
...
...
bin/varnishtest/tests/r01838.vtc
View file @
f0232502
...
@@ -14,7 +14,7 @@ varnish v1 -vcl+backend {
...
@@ -14,7 +14,7 @@ varnish v1 -vcl+backend {
sub vcl_synth {
sub vcl_synth {
if (resp.status == 998) {
if (resp.status == 998) {
s
ynthetic("synthetic body")
;
s
et resp.body = "synthetic body"
;
return (deliver);
return (deliver);
}
}
}
}
...
...
bin/varnishtest/tests/r02429.vtc
View file @
f0232502
...
@@ -6,7 +6,7 @@ server s1 {
...
@@ -6,7 +6,7 @@ server s1 {
varnish v1 -arg "-s Transient=file,${tmpdir}/_.file,10m" -vcl+backend {
varnish v1 -arg "-s Transient=file,${tmpdir}/_.file,10m" -vcl+backend {
sub vcl_backend_error {
sub vcl_backend_error {
s
ynthetic("foo")
;
s
et beresp.body = "foo"
;
return (deliver);
return (deliver);
}
}
} -start
} -start
...
...
doc/sphinx/reference/vcl.rst
View file @
f0232502
...
@@ -467,8 +467,10 @@ hash_data(input)
...
@@ -467,8 +467,10 @@ hash_data(input)
synthetic(STRING)
synthetic(STRING)
~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
Prepare a synthetic response body containing the *STRING*. Available in
Prepare a synthetic response body containing the *STRING*. Available
``vcl_synth`` and ``vcl_backend_error``.
in ``vcl_synth`` and ``vcl_backend_error``.
Identical to ``set resp.body`` / ``set beresp.body``.
.. list above comes from struct action_table[] in vcc_action.c.
.. list above comes from struct action_table[] in vcc_action.c.
...
...
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