Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-zipflow
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
libvmod-zipflow
Commits
1c40353e
Unverified
Commit
1c40353e
authored
Sep 10, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fail if there is no body
parent
4b730f74
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
0 deletions
+38
-0
Makefile.am
src/Makefile.am
+1
-0
vmod_zipflow.c
src/vmod_zipflow.c
+5
-0
vmod_zipflow.vcc
src/vmod_zipflow.vcc
+5
-0
zero.vtc
src/vtc/zero.vtc
+27
-0
No files found.
src/Makefile.am
View file @
1c40353e
...
...
@@ -41,6 +41,7 @@ AM_VTC_LOG_FLAGS = \
TESTS
=
\
zfr_iter_test
\
vtc/vmod_zipflow.vtc
\
vtc/zero.vtc
\
vtc/empty.vtc
\
vtc/coverage.vtc
\
vtc/sub.vtc
\
...
...
src/vmod_zipflow.c
View file @
1c40353e
...
...
@@ -616,6 +616,11 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
return
(
1
);
}
if
(
vdc
->
req
->
resp_len
==
0
)
{
VSLb
(
vdc
->
vsl
,
SLT_Error
,
"zipflow: need body bytes"
);
return
(
-
1
);
}
if
(
zft
->
body_resp
)
{
zfr
->
bundle
=
0
;
WS_TOP_ALLOC_OBJ
(
ctx
,
zft
->
zis
,
ZFR_ITER_MAGIC
);
...
...
src/vmod_zipflow.vcc
View file @
1c40353e
...
...
@@ -112,6 +112,11 @@ Example: Read URLs to bundle into the ZIP from the request body
VCL INTERFACE REFERENCE
=======================
**NOTE** Varnish-Cache does not support content generated by Varnish
Delivery Processors if there is not response body to be sent. This
means that, on the top level, a response body must always be present,
as illustrated by ``set resp.body = " ";`` in the examples above.
$Function VOID subreq(STRING url, STRING host=0)
$Restrict client
...
...
src/vtc/zero.vtc
0 → 100644
View file @
1c40353e
varnishtest "test vmod-zipflow: zero response cant work"
varnish v1 -vcl {
import zipflow;
backend proforma none;
sub vcl_recv {
return (synth(200));
}
sub vcl_synth {
if (zipflow.is_subreq()) {
synthetic("file content");
} else {
set resp.filters += " zipflow";
zipflow.subreq("/file");
synthetic("");
}
return (deliver);
}
} -start
client c1 {
txreq
expect_close
} -run
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