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
ae13622a
Unverified
Commit
ae13622a
authored
Oct 20, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to Varnish-Cache 7.5
parent
dd88f32c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
25 deletions
+29
-25
configure.ac
configure.ac
+1
-1
vmod_zipflow.c
src/vmod_zipflow.c
+28
-24
No files found.
configure.ac
View file @
ae13622a
...
@@ -22,7 +22,7 @@ AC_ARG_WITH([rst2man],
...
@@ -22,7 +22,7 @@ AC_ARG_WITH([rst2man],
[RST2MAN="$withval"],
[RST2MAN="$withval"],
[AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], [])])
[AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], [])])
VARNISH_PREREQ([
6.0.0
])
VARNISH_PREREQ([
7.5],[trunk
])
VARNISH_VMODS([zipflow])
VARNISH_VMODS([zipflow])
AC_ARG_VAR([VARNISHSRC], [path to Varnish source])
AC_ARG_VAR([VARNISHSRC], [path to Varnish source])
...
...
src/vmod_zipflow.c
View file @
ae13622a
...
@@ -139,8 +139,7 @@ get_zipflow_top(VRT_CTX)
...
@@ -139,8 +139,7 @@ get_zipflow_top(VRT_CTX)
return
(
zft
);
return
(
zft
);
}
}
static
int
vdp_zipflow_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
static
int
vdp_zipflow_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
);
struct
objcore
*
oc
);
static
int
vdp_zipflow_fini
(
struct
vdp_ctx
*
vdc
,
void
**
priv
);
static
int
vdp_zipflow_fini
(
struct
vdp_ctx
*
vdc
,
void
**
priv
);
static
int
vdp_zipflow_bytes
(
struct
vdp_ctx
*
vdc
,
enum
vdp_action
act
,
static
int
vdp_zipflow_bytes
(
struct
vdp_ctx
*
vdc
,
enum
vdp_action
act
,
void
**
priv
,
const
void
*
ptr
,
ssize_t
len
);
void
**
priv
,
const
void
*
ptr
,
ssize_t
len
);
...
@@ -153,8 +152,7 @@ static const struct vdp vdp_zipflow[1] = {{
...
@@ -153,8 +152,7 @@ static const struct vdp vdp_zipflow[1] = {{
.
priv1
=
NULL
.
priv1
=
NULL
}};
}};
static
int
vdp_zipsub_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
static
int
vdp_zipsub_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
);
struct
objcore
*
oc
);
static
int
vdp_zipsub_fini
(
struct
vdp_ctx
*
vdc
,
void
**
priv
);
static
int
vdp_zipsub_fini
(
struct
vdp_ctx
*
vdc
,
void
**
priv
);
static
int
vdp_zipsub_bytes
(
struct
vdp_ctx
*
vdc
,
enum
vdp_action
act
,
static
int
vdp_zipsub_bytes
(
struct
vdp_ctx
*
vdc
,
enum
vdp_action
act
,
void
**
priv
,
const
void
*
ptr
,
ssize_t
len
);
void
**
priv
,
const
void
*
ptr
,
ssize_t
len
);
...
@@ -207,7 +205,11 @@ get_zipflow_request(VRT_CTX)
...
@@ -207,7 +205,11 @@ get_zipflow_request(VRT_CTX)
struct
req
*
req
;
struct
req
*
req
;
req
=
ctx
->
req
;
req
=
ctx
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
if
(
req
==
NULL
)
{
VRT_fail
(
ctx
,
"zipflow can only be used on the client side"
);
return
(
NULL
);
}
CHECK_OBJ
(
req
,
REQ_MAGIC
);
if
(
req
->
transport
==
&
ZIPFLOW_transport
)
{
if
(
req
->
transport
==
&
ZIPFLOW_transport
)
{
CAST_OBJ_NOTNULL
(
zfr
,
req
->
transport_priv
,
CAST_OBJ_NOTNULL
(
zfr
,
req
->
transport_priv
,
...
@@ -502,6 +504,9 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
...
@@ -502,6 +504,9 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
case
VCL_EVENT_WARM
:
case
VCL_EVENT_WARM
:
case
VCL_EVENT_COLD
:
case
VCL_EVENT_COLD
:
break
;
break
;
case
VDI_EVENT_SICK
:
WRONG
(
"VDI event sent to vmod"
);
break
;
default:
default:
WRONG
(
"illegal event enum"
);
WRONG
(
"illegal event enum"
);
}
}
...
@@ -611,27 +616,22 @@ zipsub_take(const struct zipflow_request *zfr)
...
@@ -611,27 +616,22 @@ zipsub_take(const struct zipflow_request *zfr)
}
}
static
int
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
zipflow_request
*
zfr
;
struct
zipflow_request
*
zfr
;
struct
zipflow_top
*
zft
;
struct
zipflow_top
*
zft
;
struct
req
*
req
;
int
r
;
int
r
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
(
void
)
vdc
;
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
AN
(
vdc
);
CHECK_OBJ_NOTNULL
(
vdc
->
hp
,
HTTP_MAGIC
);
AN
(
vdc
->
clen
);
AN
(
priv
);
AN
(
priv
);
(
void
)
priv
;
CAST_OBJ_NOTNULL
(
zfr
,
*
priv
,
ZIPFLOW_REQUEST_MAGIC
);
CAST_OBJ_NOTNULL
(
zfr
,
*
priv
,
ZIPFLOW_REQUEST_MAGIC
);
(
void
)
oc
;
zft
=
zipsub_take
(
zfr
);
zft
=
zipsub_take
(
zfr
);
req
=
vdc
->
req
;
if
(
*
vdc
->
clen
==
0
)
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
if
(
req
->
resp_len
==
0
)
zfr
->
bundle
=
0
;
zfr
->
bundle
=
0
;
r
=
0
;
r
=
0
;
...
@@ -648,15 +648,15 @@ vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
...
@@ -648,15 +648,15 @@ vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
return
(
-
1
);
return
(
-
1
);
}
}
RFC2616_Weaken_Etag
(
req
->
res
p
);
RFC2616_Weaken_Etag
(
vdc
->
h
p
);
if
(
req
->
resp_
len
!=
0
)
if
(
*
vdc
->
c
len
!=
0
)
req
->
resp_
len
=
-
1
;
*
vdc
->
c
len
=
-
1
;
return
(
0
);
return
(
0
);
}
}
static
int
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
zipflow_request
*
zfr
=
get_zipflow_request
(
ctx
);
struct
zipflow_request
*
zfr
=
get_zipflow_request
(
ctx
);
struct
zipflow_top
*
zft
;
struct
zipflow_top
*
zft
;
...
@@ -664,17 +664,21 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
...
@@ -664,17 +664,21 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
if
(
zfr
==
NULL
)
if
(
zfr
==
NULL
)
return
(
1
);
return
(
1
);
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
->
hp
,
HTTP_MAGIC
);
AN
(
vdc
->
clen
);
zft
=
zfr
->
top
;
zft
=
zfr
->
top
;
CHECK_OBJ_NOTNULL
(
zft
,
ZIPFLOW_TOP_MAGIC
);
CHECK_OBJ_NOTNULL
(
zft
,
ZIPFLOW_TOP_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
->
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
,
REQ_MAGIC
);
// get_zipflow_request() guarantees
if
(
zft
->
req
)
{
if
(
zft
->
req
!=
NULL
)
{
VSLb
(
vdc
->
vsl
,
SLT_Error
,
"zipflow: can't be nested"
);
VSLb
(
vdc
->
vsl
,
SLT_Error
,
"zipflow: can't be nested"
);
return
(
-
1
);
return
(
-
1
);
}
}
if
(
vdc
->
req
->
resp_
len
==
0
)
{
if
(
*
vdc
->
c
len
==
0
)
{
VSLb
(
vdc
->
vsl
,
SLT_Error
,
"zipflow: need body bytes"
);
VSLb
(
vdc
->
vsl
,
SLT_Error
,
"zipflow: need body bytes"
);
return
(
-
1
);
return
(
-
1
);
}
}
...
@@ -693,7 +697,7 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
...
@@ -693,7 +697,7 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
}
}
AZ
(
zft
->
req
);
AZ
(
zft
->
req
);
zft
->
req
=
vdc
->
req
;
zft
->
req
=
ctx
->
req
;
AZ
(
zft
->
zip
);
AZ
(
zft
->
zip
);
zft
->
zip
=
zip_pipe
(
vdc
,
vdp_zipflow_put
,
zfr
->
level
);
zft
->
zip
=
zip_pipe
(
vdc
,
vdp_zipflow_put
,
zfr
->
level
);
if
(
zft
->
zip
==
NULL
)
{
if
(
zft
->
zip
==
NULL
)
{
...
@@ -706,7 +710,7 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
...
@@ -706,7 +710,7 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
AZ
(
*
priv
);
AZ
(
*
priv
);
*
priv
=
zfr
;
*
priv
=
zfr
;
return
(
vdp_zipsub_init
(
ctx
,
vdc
,
priv
,
oc
));
return
(
vdp_zipsub_init
(
ctx
,
vdc
,
priv
));
}
}
static
void
static
void
...
...
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