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
dd6efb3c
Unverified
Commit
dd6efb3c
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
05dc3298
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
23 deletions
+48
-23
from_cache_esi_deliver.c
src/foreign/from_cache_esi_deliver.c
+9
-5
vdp_pesi.c
src/vdp_pesi.c
+39
-18
No files found.
src/foreign/from_cache_esi_deliver.c
View file @
dd6efb3c
...
...
@@ -139,18 +139,22 @@ const struct vdp vped_pretend_gz = {
*/
static
int
v_matchproto_
(
vdp_fini_f
)
vped_gzgz_init
(
VRT_CTX
,
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
,
struct
http
*
hd
,
intmax_t
*
cl
)
{
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
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
priv
);
CHECK_OBJ_ORNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
// caller ensures NOTNULL
CHECK_OBJ_NOTNULL
(
hd
,
HTTP_MAGIC
);
AN
(
cl
);
CAST_OBJ_NOTNULL
(
foo
,
*
priv
,
VPED_GZGZ_PRIV_MAGIC
);
CHECK_OBJ_NOTNULL
(
foo
->
objcore
,
OBJCORE_MAGIC
);
...
...
src/vdp_pesi.c
View file @
dd6efb3c
...
...
@@ -439,17 +439,21 @@ vped_include(struct req *preq, const char *src, const char *host,
*/
static
int
v_matchproto_
(
vdp_init_f
)
pesi_buf_init
(
VRT_CTX
,
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
http
*
hd
,
intmax_t
*
cl
)
{
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
);
AN
(
priv
);
CHECK_OBJ_ORNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
// caller ensures NOTNULL
CHECK_OBJ_NOTNULL
(
hd
,
HTTP_MAGIC
);
AN
(
cl
);
CAST_OBJ_NOTNULL
(
pesi
,
*
priv
,
PESI_MAGIC
);
(
void
)
oc
;
assert
(
WS_Allocated
(
req
->
ws
,
pesi
,
sizeof
*
pesi
));
node_fill_nodestock
(
req
->
ws
,
&
pesi
->
nodestock
);
...
...
@@ -646,28 +650,39 @@ root_node_new(struct pesi *pesi, struct req *req)
*/
static
int
v_matchproto_
(
vdp_init_f
)
vdp_pesi_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
)
vdp_pesi_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
,
struct
objcore
*
oc
,
struct
req
*
req
,
struct
http
*
hd
,
intmax_t
*
cl
)
{
struct
req
*
req
;
struct
pesi
*
pesi
;
struct
pecx
*
pecx
;
struct
pesi_tasks
*
pesi_tasks
;
struct
node
*
root_node
;
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
);
AZ
(
*
priv
);
if
(
oc
==
NULL
||
!
ObjHasAttr
(
vdc
->
wrk
,
oc
,
OA_ESIDATA
))
return
(
1
);
req
=
vdc
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
priv
);
if
(
req
==
NULL
)
{
VSLb
(
vdc
->
vsl
,
SLT_Error
,
"pesi can only be used on the client side"
);
return
(
1
);
}
AZ
(
*
priv
);
RFC2616_Weaken_Etag
(
req
->
resp
);
req
->
res_mode
|=
RES_ESI
;
if
(
req
->
resp_len
!=
0
)
req
->
resp_len
=
-
1
;
if
(
*
cl
!=
0
)
*
cl
=
-
1
;
if
(
req
->
esi_level
>
0
)
{
CAST_OBJ_NOTNULL
(
pesi
,
req
->
transport_priv
,
PESI_MAGIC
);
...
...
@@ -679,7 +694,8 @@ vdp_pesi_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
#ifdef DEBUG_PESI_WS
pesi
->
ws_snap
=
WS_Snapshot
(
req
->
ws
);
#endif
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
VDP_pesi_buf
,
pesi
));
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
VDP_pesi_buf
,
pesi
,
NULL
,
req
,
req
->
resp
,
&
req
->
resp_len
));
return
(
0
);
}
...
...
@@ -725,7 +741,8 @@ vdp_pesi_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
AZ
(
pecx
->
state
);
AZ
(
pesi
->
woken
);
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
VDP_pesi_buf
,
pesi
));
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
VDP_pesi_buf
,
pesi
,
NULL
,
req
,
req
->
resp
,
&
req
->
resp_len
));
#ifdef DEBUG_PESI_WS
pesi
->
ws_snap
=
WS_Snapshot
(
req
->
ws
);
#endif
...
...
@@ -1200,11 +1217,13 @@ push_vdps(VRT_CTX, struct req *req, struct vped_gzgz_priv *vgzgz,
{
if
(
vgzgz
!=
NULL
)
{
AZ
(
gz
);
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
vped_gzgz
,
vgzgz
));
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
vped_gzgz
,
vgzgz
,
NULL
,
req
,
req
->
resp
,
&
req
->
resp_len
));
}
else
if
(
gz
!=
NULL
)
{
AZ
(
vgzgz
);
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
vped_pretend_gz
,
gz
));
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
vped_pretend_gz
,
gz
,
NULL
,
req
,
req
->
resp
,
&
req
->
resp_len
));
}
else
{
AZ
(
vgzgz
);
...
...
@@ -1313,7 +1332,8 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
push_vdps
(
ctx
,
req
,
vgzgz
,
gz
);
AN
(
parent
);
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
vped_to_parent
,
parent
->
nexus
.
req
));
&
vped_to_parent
,
parent
->
nexus
.
req
,
NULL
,
req
,
req
->
resp
,
&
req
->
resp_len
));
(
void
)
VDP_DeliverObj
(
req
->
vdc
,
req
->
objcore
);
...
...
@@ -1329,7 +1349,8 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
push_vdps
(
ctx
,
req
,
vgzgz
,
gz
);
AZ
(
VDP_Push
(
ctx
,
req
->
vdc
,
req
->
ws
,
&
vped_to_parent
,
parent
->
nexus
.
req
));
&
vped_to_parent
,
parent
->
nexus
.
req
,
NULL
,
req
,
req
->
resp
,
&
req
->
resp_len
));
node_mutate_prep
(
tree
,
node
);
...
...
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