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
98bee26f
Unverified
Commit
98bee26f
authored
Jan 02, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust to VDP API Changes from VC#4035
Ref
https://github.com/varnishcache/varnish-cache/pull/4035
parent
dd88f32c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
19 deletions
+37
-19
vmod_zipflow.c
src/vmod_zipflow.c
+37
-19
No files found.
src/vmod_zipflow.c
View file @
98bee26f
...
...
@@ -140,7 +140,8 @@ get_zipflow_top(VRT_CTX)
}
static
int
vdp_zipflow_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
);
struct
objcore
*
oc
,
struct
req
*
req
,
struct
http
*
hd
,
intmax_t
*
cl
);
static
int
vdp_zipflow_fini
(
struct
vdp_ctx
*
vdc
,
void
**
priv
);
static
int
vdp_zipflow_bytes
(
struct
vdp_ctx
*
vdc
,
enum
vdp_action
act
,
void
**
priv
,
const
void
*
ptr
,
ssize_t
len
);
...
...
@@ -154,7 +155,8 @@ static const struct vdp vdp_zipflow[1] = {{
}};
static
int
vdp_zipsub_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
);
struct
objcore
*
oc
,
struct
req
*
req
,
struct
http
*
hd
,
intmax_t
*
cl
);
static
int
vdp_zipsub_fini
(
struct
vdp_ctx
*
vdc
,
void
**
priv
);
static
int
vdp_zipsub_bytes
(
struct
vdp_ctx
*
vdc
,
enum
vdp_action
act
,
void
**
priv
,
const
void
*
ptr
,
ssize_t
len
);
...
...
@@ -611,26 +613,32 @@ zipsub_take(const struct zipflow_request *zfr)
}
static
int
vdp_zipsub_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
)
vdp_zipsub_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
,
struct
req
*
req
,
struct
http
*
hd
,
intmax_t
*
cl
)
{
struct
zipflow_request
*
zfr
;
struct
zipflow_top
*
zft
;
struct
req
*
req
;
int
r
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
(
void
)
vdc
;
AN
(
vdc
);
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
AN
(
priv
);
(
void
)
priv
;
CHECK_OBJ_ORNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_ORNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
hd
,
HTTP_MAGIC
);
AN
(
cl
);
if
(
req
==
NULL
)
{
VSLb
(
vdc
->
vsl
,
SLT_Error
,
"zipflow can only be used on the client side"
);
return
(
1
);
}
CAST_OBJ_NOTNULL
(
zfr
,
*
priv
,
ZIPFLOW_REQUEST_MAGIC
);
(
void
)
oc
;
zft
=
zipsub_take
(
zfr
);
req
=
vdc
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
if
(
req
->
resp_len
==
0
)
zfr
->
bundle
=
0
;
...
...
@@ -656,25 +664,34 @@ vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
}
static
int
vdp_zipflow_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
)
vdp_zipflow_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
,
struct
req
*
req
,
struct
http
*
hd
,
intmax_t
*
cl
)
{
struct
zipflow_request
*
zfr
=
get_zipflow_request
(
ctx
)
;
struct
zipflow_request
*
zfr
;
struct
zipflow_top
*
zft
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
AN
(
priv
);
CHECK_OBJ_ORNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_ORNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
hd
,
HTTP_MAGIC
);
AN
(
cl
);
zfr
=
get_zipflow_request
(
ctx
);
if
(
zfr
==
NULL
)
return
(
1
);
zft
=
zfr
->
top
;
CHECK_OBJ_NOTNULL
(
zft
,
ZIPFLOW_TOP_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
->
req
,
REQ_MAGIC
);
if
(
zft
->
req
)
{
VSLb
(
vdc
->
vsl
,
SLT_Error
,
"zipflow: can't be nested"
);
return
(
-
1
);
}
if
(
vdc
->
req
->
resp_len
==
0
)
{
if
(
*
cl
==
0
)
{
VSLb
(
vdc
->
vsl
,
SLT_Error
,
"zipflow: need body bytes"
);
return
(
-
1
);
}
...
...
@@ -693,7 +710,7 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
}
AZ
(
zft
->
req
);
zft
->
req
=
vdc
->
req
;
zft
->
req
=
req
;
AZ
(
zft
->
zip
);
zft
->
zip
=
zip_pipe
(
vdc
,
vdp_zipflow_put
,
zfr
->
level
);
if
(
zft
->
zip
==
NULL
)
{
...
...
@@ -706,7 +723,7 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
AZ
(
*
priv
);
*
priv
=
zfr
;
return
(
vdp_zipsub_init
(
ctx
,
vdc
,
priv
,
oc
));
return
(
vdp_zipsub_init
(
ctx
,
vdc
,
priv
,
oc
,
req
,
hd
,
cl
));
}
static
void
...
...
@@ -1009,7 +1026,8 @@ zfr_deliver(struct req *req, struct boc *boc, int wantbody)
INIT_OBJ
(
ctx
,
VRT_CTX_MAGIC
);
VCL_Req2Ctx
(
ctx
,
req
);
i
=
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
vdp_zipsub
,
req
->
transport_priv
);
i
=
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
vdp_zipsub
,
req
->
transport_priv
,
req
->
objcore
,
req
,
req
->
resp
,
&
req
->
resp_len
);
if
(
i
==
0
)
{
i
=
VDP_DeliverObj
(
req
->
vdc
,
req
->
objcore
);
...
...
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