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
118e1c42
Unverified
Commit
118e1c42
authored
Sep 14, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For subrequests, reference the zipflow_request via the transport_priv
this way, it survives label switching
parent
730b05fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
21 deletions
+35
-21
vmod_zipflow.c
src/vmod_zipflow.c
+26
-21
ex2.vtc
src/vtc/ex2.vtc
+4
-0
ex3.vtc
src/vtc/ex3.vtc
+4
-0
sub-body.vtc
src/vtc/sub-body.vtc
+1
-0
No files found.
src/vmod_zipflow.c
View file @
118e1c42
...
...
@@ -44,6 +44,22 @@
#include "vcc_zipflow_if.h"
#include "zfr_iter.h"
static
void
v_matchproto_
(
vtr_deliver_f
)
zfr_deliver
(
struct
req
*
req
,
struct
boc
*
boc
,
int
wantbody
);
static
void
v_matchproto_
(
vtr_reembark_f
)
zfr_reembark
(
struct
worker
*
wrk
,
struct
req
*
req
);
static
int
v_matchproto_
(
vtr_minimal_response_f
)
zfr_minimal_response
(
struct
req
*
req
,
uint16_t
status
);
//lint -e{785} too few initializers
static
const
struct
transport
ZIPFLOW_transport
=
{
.
magic
=
TRANSPORT_MAGIC
,
.
name
=
"ZIPFLOW"
,
.
deliver
=
zfr_deliver
,
.
reembark
=
zfr_reembark
,
.
minimal_response
=
zfr_minimal_response
};
static
void
__attribute__
((
constructor
))
assert_zlib
(
void
)
{
...
...
@@ -187,6 +203,16 @@ get_zipflow_request(VRT_CTX)
struct
vmod_priv
*
task_priv
;
struct
zipflow_request
*
zfr
;
struct
zipflow_top
*
zft
;
struct
req
*
req
;
req
=
ctx
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
if
(
req
->
transport
==
&
ZIPFLOW_transport
)
{
CAST_OBJ_NOTNULL
(
zfr
,
req
->
transport_priv
,
ZIPFLOW_REQUEST_MAGIC
);
return
(
zfr
);
}
task_priv
=
VRT_priv_task
(
ctx
,
zipflow_request_priv
);
if
(
task_priv
==
NULL
)
{
...
...
@@ -797,18 +823,6 @@ zfr_minimal_response(struct req *req, uint16_t status)
return
(
0
);
}
static
void
v_matchproto_
(
vtr_deliver_f
)
zfr_deliver
(
struct
req
*
req
,
struct
boc
*
boc
,
int
wantbody
);
//lint -e{785} too few initializers
static
const
struct
transport
ZIPFLOW_transport
=
{
.
magic
=
TRANSPORT_MAGIC
,
.
name
=
"ZIPFLOW"
,
.
deliver
=
zfr_deliver
,
.
reembark
=
zfr_reembark
,
.
minimal_response
=
zfr_minimal_response
};
/*--------------------------------------------------------------------
* basically varnish-cache ESI
*/
...
...
@@ -819,8 +833,6 @@ zfr_include(struct req *preq, struct zipflow_request *zfr)
struct
worker
*
wrk
;
struct
sess
*
sp
;
struct
req
*
req
;
struct
vmod_priv
*
task_priv
;
struct
vrt_ctx
ctx
[
1
];
enum
req_fsm_nxt
s
;
const
char
*
h
;
...
...
@@ -899,14 +911,7 @@ zfr_include(struct req *preq, struct zipflow_request *zfr)
req
->
transport
=
&
ZIPFLOW_transport
;
req
->
transport_priv
=
zfr
;
CNT_Embark
(
wrk
,
req
);
VCL_TaskEnter
(
req
->
privs
);
INIT_OBJ
(
ctx
,
VRT_CTX_MAGIC
);
VCL_Req2Ctx
(
ctx
,
req
);
task_priv
=
VRT_priv_task
(
ctx
,
zipflow_request_priv
);
AN
(
task_priv
);
AZ
(
task_priv
->
priv
);
task_priv
->
priv
=
zfr
;
AZ
(
zfr
->
cond
);
zfr
->
cond
=
&
wrk
->
cond
;
...
...
src/vtc/ex2.vtc
View file @
118e1c42
...
...
@@ -21,6 +21,10 @@ varnish v1 -vcl+backend {
}
}
sub vcl_deliver {
set resp.http.is-subreq = zipflow.is_subreq();
}
sub synth_zipflow {
if (zipflow.is_subreq()) {
return;
...
...
src/vtc/ex3.vtc
View file @
118e1c42
...
...
@@ -21,6 +21,10 @@ varnish v1 -vcl+backend {
}
}
sub vcl_deliver {
set resp.http.is-subreq = zipflow.is_subreq();
}
sub synth_zipflow {
if (zipflow.is_subreq()) {
return;
...
...
src/vtc/sub-body.vtc
View file @
118e1c42
...
...
@@ -23,6 +23,7 @@ varnish v1 -vcl {
}
sub synth_sub {
set resp.http.is-subreq = zipflow.is_subreq();
synthetic("sub " + req.url);
}
...
...
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