Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvdfp-pipe
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvdfp-pipe
Commits
d9f0d00b
Commit
d9f0d00b
authored
Aug 04, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the VDP, passes intial tests with cat, /bin/true and /bin/false.
parent
5950a65d
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
618 additions
and
4 deletions
+618
-4
README.rst
README.rst
+9
-1
vdp.vtc
src/tests/vdp.vtc
+70
-0
vdfp_pipe.c
src/vdfp_pipe.c
+533
-2
vdfp_pipe.vcc
src/vdfp_pipe.vcc
+6
-1
No files found.
README.rst
View file @
d9f0d00b
...
...
@@ -49,7 +49,15 @@ DESCRIPTION
.. _Varnish: http://www.varnish-cache.org/
The pipe library provides `Varnish`_ delivery and fetch processors
that pipe client and backend responses through external commands.
(VDPs and VFPs) that pipe client and backend responses through
external commands.
XXX ...
.. _pipe.vdp():
new xvdp = pipe.vdp(STRING name, STRING path)
---------------------------------------------
XXX ...
...
...
src/tests/vdp.vtc
0 → 100644
View file @
d9f0d00b
# looks like -*- vcl -*-
varnishtest "vdp object"
server s1 {
rxreq
txresp -body {foo bar baz quux}
} -start
varnish v1 -vcl+backend {
import ${vmod_pipe};
sub vcl_init {
new cat = pipe.vdp(name="cat", path="/bin/cat");
new t = pipe.vdp(name="true", path="/bin/true");
new f = pipe.vdp(name="false", path="/bin/false");
}
sub vcl_deliver {
set resp.filters = req.http.X-Filters;
}
} -start
client c1 {
txreq -hdr "X-Filters: cat"
rxresp
expect resp.status == 200
expect resp.body == "foo bar baz quux"
txreq -hdr "X-Filters: cat true"
rxresp
expect resp.status == 200
expect resp.body == ""
# Only read response headers, the body may fail.
txreq -hdr "X-Filters: cat false"
rxresp -no_obj
expect resp.status == 200
} -run
logexpect l1 -v v1 -g vxid -d 1 -q {Notice ~ "^vdfp_pipe: vdp cat:"} {
expect 0 * Begin {^req \d+ rxreq$}
expect * = Notice {^vdfp_pipe: vdp cat: exec'd /bin/cat as pid \d+$}
expect * = Notice {^vdfp_pipe: vdp cat: /bin/cat exited with status 0$}
expect * = End
expect 0 * Begin {^req \d+ rxreq$}
expect * = Notice {^vdfp_pipe: vdp cat: exec'd /bin/cat as pid \d+$}
expect * = Notice {^vdfp_pipe: vdp cat: /bin/cat exited with status 0$}
expect * = End
expect 0 * Begin {^req \d+ rxreq$}
expect * = Notice {^vdfp_pipe: vdp cat: exec'd /bin/cat as pid \d+$}
expect * = Notice {^vdfp_pipe: vdp cat: /bin/cat exited with status 0$}
expect * = End
} -run
logexpect l1 -v v1 -g vxid -d 1 -q {Notice ~ "^vdfp_pipe: vdp t:"} {
expect 0 * Begin {^req \d+ rxreq$}
expect * = Notice {^vdfp_pipe: vdp t: exec'd /bin/true as pid \d+$}
expect * = Notice {^vdfp_pipe: vdp t: /bin/true exited with status 0$}
expect * = End
} -run
logexpect l1 -v v1 -g vxid -d 1 -q {Error ~ "^vdfp_pipe: vdp f:" or Notice ~ "^vdfp_pipe: vdp f"} {
expect 0 * Begin {^req \d+ rxreq$}
expect * = Notice {^vdfp_pipe: vdp f: exec'd /bin/false as pid \d+$}
expect * = Error {^vdfp_pipe: vdp f: /bin/false exited with status \d+$}
expect * = End
} -run
src/vdfp_pipe.c
View file @
d9f0d00b
This diff is collapsed.
Click to expand it.
src/vdfp_pipe.vcc
View file @
d9f0d00b
...
...
@@ -45,7 +45,12 @@ DESCRIPTION
.. _Varnish: http://www.varnish-cache.org/
The pipe library provides `Varnish`_ delivery and fetch processors
that pipe client and backend responses through external commands.
(VDPs and VFPs) that pipe client and backend responses through
external commands.
XXX ...
$Object vdp(STRING name, STRING path)
XXX ...
...
...
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