Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
57359c50
Commit
57359c50
authored
Oct 26, 2020
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give VDP->init() vdp_ctx arg instead of req
parent
dfaa9703
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
23 deletions
+36
-23
cache_deliver_proc.c
bin/varnishd/cache/cache_deliver_proc.c
+1
-1
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+12
-6
cache_filter.h
bin/varnishd/cache/cache_filter.h
+1
-1
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+4
-1
cache_range.c
bin/varnishd/cache/cache_range.c
+12
-10
cache_http2_deliver.c
bin/varnishd/http2/cache_http2_deliver.c
+4
-2
vmod_debug.c
lib/libvmod_debug/vmod_debug.c
+2
-2
No files found.
bin/varnishd/cache/cache_deliver_proc.c
View file @
57359c50
...
...
@@ -141,7 +141,7 @@ VDP_Push(struct req *req, const struct vdp *vdp, void *priv)
AZ
(
vdc
->
retval
);
if
(
vdpe
->
vdp
->
init
!=
NULL
)
vdc
->
retval
=
vdpe
->
vdp
->
init
(
req
,
&
vdpe
->
priv
);
vdc
->
retval
=
vdpe
->
vdp
->
init
(
vdc
,
&
vdpe
->
priv
);
if
(
vdc
->
retval
>
0
)
{
VTAILQ_REMOVE
(
&
vdc
->
vdp
,
vdpe
,
list
);
vdc
->
nxt
=
VTAILQ_FIRST
(
&
vdc
->
vdp
);
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
57359c50
...
...
@@ -254,15 +254,18 @@ ved_decode_len(struct vsl_log *vsl, const uint8_t **pp)
*/
static
int
v_matchproto_
(
vdp_init_f
)
ved_vdp_esi_init
(
struct
req
*
req
,
void
**
priv
)
ved_vdp_esi_init
(
struct
vdp_ctx
*
vdc
,
void
**
priv
)
{
struct
ecx
*
ecx
;
struct
req
*
req
;
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
req
=
vdc
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
priv
);
AZ
(
*
priv
);
if
(
!
ObjHasAttr
(
req
->
wrk
,
req
->
objcore
,
OA_ESIDATA
))
if
(
!
ObjHasAttr
(
vdc
->
wrk
,
req
->
objcore
,
OA_ESIDATA
))
return
(
1
);
ALLOC_OBJ
(
ecx
,
ECX_MAGIC
);
...
...
@@ -584,26 +587,29 @@ struct ved_foo {
};
static
int
v_matchproto_
(
vdp_fini_f
)
ved_gzgz_init
(
struct
req
*
req
,
void
**
priv
)
ved_gzgz_init
(
struct
vdp_ctx
*
vdc
,
void
**
priv
)
{
ssize_t
l
;
const
char
*
p
;
struct
ved_foo
*
foo
;
struct
req
*
req
;
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
req
=
vdc
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CAST_OBJ_NOTNULL
(
foo
,
*
priv
,
VED_FOO_MAGIC
);
memset
(
foo
->
tailbuf
,
0xdd
,
sizeof
foo
->
tailbuf
);
AN
(
ObjCheckFlag
(
req
->
wrk
,
req
->
objcore
,
OF_GZIPED
));
AN
(
ObjCheckFlag
(
vdc
->
wrk
,
req
->
objcore
,
OF_GZIPED
));
p
=
ObjGetAttr
(
req
->
wrk
,
req
->
objcore
,
OA_GZIPBITS
,
&
l
);
p
=
ObjGetAttr
(
vdc
->
wrk
,
req
->
objcore
,
OA_GZIPBITS
,
&
l
);
AN
(
p
);
assert
(
l
==
32
);
foo
->
start
=
vbe64dec
(
p
);
foo
->
last
=
vbe64dec
(
p
+
8
);
foo
->
stop
=
vbe64dec
(
p
+
16
);
foo
->
olen
=
ObjGetLen
(
req
->
wrk
,
req
->
objcore
);
foo
->
olen
=
ObjGetLen
(
vdc
->
wrk
,
req
->
objcore
);
assert
(
foo
->
start
>
0
&&
foo
->
start
<
foo
->
olen
*
8
);
assert
(
foo
->
last
>
0
&&
foo
->
last
<
foo
->
olen
*
8
);
assert
(
foo
->
stop
>
0
&&
foo
->
stop
<
foo
->
olen
*
8
);
...
...
bin/varnishd/cache/cache_filter.h
View file @
57359c50
...
...
@@ -102,7 +102,7 @@ enum vdp_action {
VDP_END
,
/* Last buffer or after, implies VDP_FLUSH */
};
typedef
int
vdp_init_f
(
struct
req
*
,
void
**
priv
);
typedef
int
vdp_init_f
(
struct
vdp_ctx
*
,
void
**
priv
);
/*
* Return value:
* negative: Error - abandon delivery
...
...
bin/varnishd/cache/cache_gzip.c
View file @
57359c50
...
...
@@ -288,15 +288,18 @@ VGZ_Gzip(struct vgz *vg, const void **pptr, ssize_t *plen, enum vgz_flag flags)
*/
static
int
v_matchproto_
(
vdp_init_f
)
vdp_gunzip_init
(
struct
req
*
req
,
void
**
priv
)
vdp_gunzip_init
(
struct
vdp_ctx
*
vdp
,
void
**
priv
)
{
struct
vgz
*
vg
;
struct
boc
*
boc
;
struct
req
*
req
;
enum
boc_state_e
bos
;
const
char
*
p
;
ssize_t
dl
;
uint64_t
u
;
CHECK_OBJ_NOTNULL
(
vdp
,
VDP_CTX_MAGIC
);
req
=
vdp
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
objcore
,
OBJCORE_MAGIC
);
...
...
bin/varnishd/cache/cache_range.c
View file @
57359c50
...
...
@@ -243,29 +243,31 @@ vrg_ifrange(struct req *req)
}
static
int
v_matchproto_
(
vdp_init_f
)
vrg_range_init
(
struct
req
*
req
,
void
**
priv
)
vrg_range_init
(
struct
vdp_ctx
*
vdc
,
void
**
priv
)
{
const
char
*
r
;
const
char
*
err
;
assert
(
http_GetHdr
(
req
->
http
,
H_Range
,
&
r
));
if
(
!
vrg_ifrange
(
req
))
// rfc7233,l,455,456
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
->
req
,
REQ_MAGIC
);
assert
(
http_GetHdr
(
vdc
->
req
->
http
,
H_Range
,
&
r
));
if
(
!
vrg_ifrange
(
vdc
->
req
))
// rfc7233,l,455,456
return
(
1
);
err
=
vrg_dorange
(
req
,
r
,
priv
);
err
=
vrg_dorange
(
vdc
->
req
,
r
,
priv
);
if
(
err
==
NULL
)
return
(
*
priv
==
NULL
?
1
:
0
);
VSLb
(
req
->
vsl
,
SLT_Debug
,
"RANGE_FAIL %s"
,
err
);
if
(
req
->
resp_len
>=
0
)
http_PrintfHeader
(
req
->
resp
,
VSLb
(
vdc
->
vsl
,
SLT_Debug
,
"RANGE_FAIL %s"
,
err
);
if
(
vdc
->
req
->
resp_len
>=
0
)
http_PrintfHeader
(
vdc
->
req
->
resp
,
"Content-Range: bytes */%jd"
,
(
intmax_t
)
req
->
resp_len
);
http_PutResponse
(
req
->
resp
,
"HTTP/1.1"
,
416
,
NULL
);
(
intmax_t
)
vdc
->
req
->
resp_len
);
http_PutResponse
(
vdc
->
req
->
resp
,
"HTTP/1.1"
,
416
,
NULL
);
/*
* XXX: We ought to produce a body explaining things.
* XXX: That really calls for us to hit vcl_synth{}
*/
req
->
resp_len
=
0
;
vdc
->
req
->
resp_len
=
0
;
return
(
1
);
}
...
...
bin/varnishd/http2/cache_http2_deliver.c
View file @
57359c50
...
...
@@ -75,10 +75,12 @@ V2D_Init(void)
/**********************************************************************/
static
int
v_matchproto_
(
vdp_init_f
)
h2_init
(
struct
req
*
req
,
void
**
priv
)
h2_init
(
struct
vdp_ctx
*
vdc
,
void
**
priv
)
{
*
priv
=
req
->
transport_priv
;
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
->
req
,
REQ_MAGIC
);
*
priv
=
vdc
->
req
->
transport_priv
;
return
(
0
);
}
...
...
lib/libvmod_debug/vmod_debug.c
View file @
57359c50
...
...
@@ -101,9 +101,9 @@ static const struct vfp xyzzy_rot13 = {
#define ROT13_BUFSZ 8
static
int
v_matchproto_
(
vdp_init_f
)
xyzzy_rot13_init
(
struct
req
*
req
,
void
**
priv
)
xyzzy_rot13_init
(
struct
vdp_ctx
*
vdc
,
void
**
priv
)
{
(
void
)
req
;
(
void
)
vdc
;
AN
(
priv
);
*
priv
=
malloc
(
ROT13_BUFSZ
);
if
(
*
priv
==
NULL
)
...
...
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