Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvdp-pesi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
uplex-varnish
libvdp-pesi
Commits
f7abbe46
Unverified
Commit
f7abbe46
authored
Jan 25, 2022
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt to filter API changes
parent
43e61e17
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
23 deletions
+30
-23
from_cache_esi_deliver.c
src/foreign/from_cache_esi_deliver.c
+2
-1
vdp_pesi.c
src/vdp_pesi.c
+21
-12
vdp_pesi.h
src/vdp_pesi.h
+1
-1
vmod_pesi.c
src/vmod_pesi.c
+6
-9
No files found.
src/foreign/from_cache_esi_deliver.c
View file @
f7abbe46
...
...
@@ -139,13 +139,14 @@ const struct vdp vped_pretend_gz = {
*/
static
int
v_matchproto_
(
vdp_fini_f
)
vped_gzgz_init
(
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
)
vped_gzgz_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
)
{
struct
req
*
req
;
ssize_t
l
;
const
char
*
p
;
struct
vped_gzgz_priv
*
foo
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
(
void
)
oc
;
req
=
vdc
->
req
;
...
...
src/vdp_pesi.c
View file @
f7abbe46
...
...
@@ -484,11 +484,12 @@ vped_include(struct req *preq, const char *src, const char *host,
*/
static
int
v_matchproto_
(
vdp_init_f
)
pesi_buf_init
(
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
)
pesi_buf_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
)
{
struct
req
*
req
;
struct
pesi
*
pesi
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
req
=
vdc
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
...
...
@@ -682,7 +683,7 @@ vdp_pesi_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
assert
(
WS_Allocated
(
req
->
ws
,
pesi
,
sizeof
*
pesi
));
node_fill_nodestock
(
req
->
ws
,
&
pesi
->
nodestock
);
get_task_cfg
(
req
,
&
pesi
->
flags
);
get_task_cfg
(
ctx
,
&
pesi
->
flags
);
#ifdef DEBUG_PESI_WS
pesi
->
ws_snap
=
WS_Snapshot
(
req
->
ws
);
#endif
...
...
@@ -719,7 +720,7 @@ vdp_pesi_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
"Cannot allocate workspace for parallel ESI data"
);
return
(
-
1
);
}
get_task_cfg
(
req
,
&
pesi
->
flags
);
get_task_cfg
(
ctx
,
&
pesi
->
flags
);
pecx
=
pesi
->
pecx
;
*
priv
=
pesi
;
...
...
@@ -1276,6 +1277,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
struct
node
*
node
,
*
parent
;
struct
nexus_gzip
*
gz
;
struct
vped_gzgz_priv
*
vgzgz
=
NULL
;
struct
vrt_ctx
ctx
[
1
];
const
struct
vdp
*
vdp
;
VSLdbgv
(
req
,
"vped_deliver: req=%p boc=%p wantbody=%d"
,
req
,
boc
,
...
...
@@ -1312,6 +1314,9 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
gz
=
&
parent
->
nexus
.
gzip
;
INIT_OBJ
(
ctx
,
VRT_CTX_MAGIC
);
VCL_Req2Ctx
(
ctx
,
req
);
if
(
gz
->
is
&&
obj_gzipped
&&
!
(
req
->
res_mode
&
RES_ESI
))
{
/* OA_GZIPBITS are not valid until BOS_FINISHED */
if
(
boc
!=
NULL
)
...
...
@@ -1350,9 +1355,10 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
AZ
(
vgzgz
);
// VDP_pesi + buf has been pushed from VCL
push_vdps
(
req
,
vgzgz
,
gz
);
push_vdps
(
ctx
,
req
,
vgzgz
,
gz
);
AN
(
parent
);
AZ
(
VDP_Push
(
req
->
vdc
,
req
->
ws
,
&
vped_to_parent
,
parent
->
nexus
.
req
));
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
vped_to_parent
,
parent
->
nexus
.
req
));
(
void
)
VDP_DeliverObj
(
req
->
vdc
,
req
->
objcore
);
...
...
@@ -1367,11 +1373,12 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
else
if
(
obj_final
&&
(
pesi
->
flags
&
PF_CFG_BLOCK_FINAL
)
==
0
)
{
VSLdbg
(
req
,
"vped_deliver: T_NEXUS buffering no ESI"
);
AZ
(
VDP_Push
(
req
->
vdc
,
req
->
ws
,
&
VDP_pesi_buf
,
pesi
));
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
VDP_pesi_buf
,
pesi
));
AN
(
parent
);
assert
(
parent
->
type
==
T_NEXUS
);
push_vdps
(
req
,
vgzgz
,
gz
);
AZ
(
VDP_Push
(
req
->
vdc
,
req
->
ws
,
&
vped_to_parent
,
parent
->
nexus
.
req
));
push_vdps
(
ctx
,
req
,
vgzgz
,
gz
);
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
vped_to_parent
,
parent
->
nexus
.
req
));
(
void
)
VDP_DeliverObj
(
req
->
vdc
,
req
->
objcore
);
...
...
@@ -1389,8 +1396,9 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
else
if
(
obj_final
)
{
VSLdbg
(
req
,
"vped_deliver: T_FINAL"
);
push_vdps
(
req
,
vgzgz
,
gz
);
AZ
(
VDP_Push
(
req
->
vdc
,
req
->
ws
,
&
vped_to_parent
,
parent
->
nexus
.
req
));
push_vdps
(
ctx
,
req
,
vgzgz
,
gz
);
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
vped_to_parent
,
parent
->
nexus
.
req
));
node_mutate_prep
(
tree
,
node
);
...
...
@@ -1428,8 +1436,9 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
VSLdbg
(
req
,
"vped_deliver: T_SUBREQ"
);
AZ
(
req
->
objcore
->
flags
&
OC_F_FINAL
);
push_vdps
(
req
,
vgzgz
,
gz
);
AZ
(
VDP_Push
(
req
->
vdc
,
req
->
ws
,
&
vped_to_parent
,
parent
->
nexus
.
req
));
push_vdps
(
ctx
,
req
,
vgzgz
,
gz
);
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
vped_to_parent
,
parent
->
nexus
.
req
));
node_mutate_prep
(
tree
,
node
);
...
...
src/vdp_pesi.h
View file @
f7abbe46
...
...
@@ -36,4 +36,4 @@ extern const struct vdp VDP_pesi;
* task config
*/
void
get_task_cfg
(
struct
req
*
,
unsigned
*
);
void
get_task_cfg
(
VRT_CTX
,
unsigned
*
);
src/vmod_pesi.c
View file @
f7abbe46
...
...
@@ -256,18 +256,13 @@ WRONG("illegal enum");
/* VDP's access to the cfg */
void
get_task_cfg
(
struct
req
*
req
,
unsigned
*
flags
)
get_task_cfg
(
VRT_CTX
,
unsigned
*
flags
)
{
struct
vmod_priv
*
priv_task
;
struct
vrt_ctx
dummy_ctx
[
1
];
unsigned
vclflags
;
INIT_OBJ
(
dummy_ctx
,
VRT_CTX_MAGIC
);
dummy_ctx
->
req
=
req
;
dummy_ctx
->
ws
=
req
->
ws
;
/* zero length in the priv task == not configured from vcl */
priv_task
=
VRT_priv_task
(
dummy_
ctx
,
priv_task_id_cfg
);
priv_task
=
VRT_priv_task
(
ctx
,
priv_task_id_cfg
);
if
(
priv_task
==
NULL
||
priv_task
->
len
==
0
)
return
;
...
...
@@ -349,6 +344,9 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
switch
(
e
)
{
case
VCL_EVENT_LOAD
:
if
(
VRT_AddFilter
(
ctx
,
NULL
,
&
VDP_pesi
))
return
(
1
);
if
(
loadcnt
++
==
0
)
{
AZ
(
vsc_seg
);
lck_bytes_tree
=
Lck_CreateClass
(
&
vsc_seg
,
"pesi.buf"
);
...
...
@@ -363,10 +361,9 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
Lck_New
(
&
stats_lock
,
lck_stats
);
}
VRT_AddVDP
(
ctx
,
&
VDP_pesi
);
break
;
case
VCL_EVENT_DISCARD
:
VRT_Remove
VDP
(
ctx
,
&
VDP_pesi
);
VRT_Remove
Filter
(
ctx
,
NULL
,
&
VDP_pesi
);
AN
(
loadcnt
);
if
(
--
loadcnt
==
0
)
{
...
...
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