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
11c6e33e
Commit
11c6e33e
authored
Oct 21, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make space for VDP's to have a priv pointer
parent
3247c51d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
11 deletions
+34
-11
cache.h
bin/varnishd/cache/cache.h
+9
-1
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+6
-4
cache_filter.h
bin/varnishd/cache/cache_filter.h
+4
-2
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+5
-1
cache_http1_deliver.c
bin/varnishd/http1/cache_http1_deliver.c
+10
-3
No files found.
bin/varnishd/cache/cache.h
View file @
11c6e33e
...
...
@@ -616,6 +616,7 @@ struct req {
/* Deliver pipeline */
#define N_VDPS 5
vdp_bytes
*
vdps
[
N_VDPS
];
void
*
vdpp
[
N_VDPS
];
int
vdp_nxt
;
/* Range */
...
...
@@ -765,7 +766,7 @@ VDP_bytes(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
/* Call the present layer, while pointing to the next layer down */
i
=
req
->
vdp_nxt
--
;
assert
(
i
>=
0
&&
i
<
N_VDPS
);
retval
=
req
->
vdps
[
i
](
req
,
act
,
ptr
,
len
);
retval
=
req
->
vdps
[
i
](
req
,
act
,
req
->
vdpp
[
i
],
ptr
,
len
);
req
->
vdp_nxt
++
;
return
(
retval
);
}
...
...
@@ -780,6 +781,9 @@ VDP_push(struct req *req, vdp_bytes *func)
assert
(
req
->
vdp_nxt
>=
0
);
assert
(
req
->
vdp_nxt
+
1
<
N_VDPS
);
req
->
vdps
[
++
req
->
vdp_nxt
]
=
func
;
req
->
vdpp
[
req
->
vdp_nxt
]
=
NULL
;
AZ
(
req
->
vdps
[
req
->
vdp_nxt
](
req
,
VDP_INIT
,
&
req
->
vdpp
[
req
->
vdp_nxt
],
NULL
,
0
));
}
static
inline
void
...
...
@@ -791,6 +795,10 @@ VDP_pop(struct req *req, vdp_bytes *func)
assert
(
req
->
vdp_nxt
>=
1
);
assert
(
req
->
vdp_nxt
<
N_VDPS
);
assert
(
req
->
vdps
[
req
->
vdp_nxt
]
==
func
);
AZ
(
req
->
vdps
[
req
->
vdp_nxt
](
req
,
VDP_FINI
,
&
req
->
vdpp
[
req
->
vdp_nxt
],
NULL
,
0
));
AZ
(
req
->
vdpp
[
req
->
vdp_nxt
]);
req
->
vdps
[
req
->
vdp_nxt
]
=
NULL
;
req
->
vdp_nxt
--
;
}
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
11c6e33e
...
...
@@ -206,15 +206,17 @@ ved_decode_len(uint8_t **pp)
*/
int
__match_proto__
(
vdp_bytes
)
VED_pretend_gzip
(
struct
req
*
req
,
enum
vdp_action
act
,
const
void
*
p
v
,
ssize_t
l
)
VED_pretend_gzip
(
struct
req
*
req
,
enum
vdp_action
act
,
void
*
pri
v
,
const
void
*
pv
,
ssize_t
l
)
{
uint8_t
buf1
[
5
],
buf2
[
5
];
const
uint8_t
*
p
;
uint16_t
lx
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
(
void
)
act
;
(
void
)
priv
;
if
(
act
==
VDP_INIT
||
act
==
VDP_FINI
)
return
(
0
);
p
=
pv
;
lx
=
65535
;
...
...
@@ -362,7 +364,7 @@ ESI_Deliver(struct req *req)
* was not gzip'ed.
*/
(
void
)
VED_pretend_gzip
(
req
,
VDP_NULL
,
pp
,
l2
);
NULL
,
pp
,
l2
);
}
else
if
(
isgzip
)
{
/*
* A gzip'ed VEC, but ungzip'ed ESI
...
...
bin/varnishd/cache/cache_filter.h
View file @
11c6e33e
...
...
@@ -72,9 +72,11 @@ enum vfp_status VFP_Error(struct vfp_ctx *, const char *fmt, ...)
/* Deliver processors ------------------------------------------------*/
enum
vdp_action
{
VDP_INIT
,
VDP_NULL
,
VDP_FLUSH
,
VDP_FINISH
,
VDP_FINI
,
};
typedef
int
vdp_bytes
(
struct
req
*
,
enum
vdp_action
,
const
void
*
ptr
,
ssize_t
len
);
typedef
int
vdp_bytes
(
struct
req
*
,
enum
vdp_action
,
void
*
priv
,
const
void
*
ptr
,
ssize_t
len
);
bin/varnishd/cache/cache_gzip.c
View file @
11c6e33e
...
...
@@ -285,7 +285,8 @@ VGZ_WrwInit(struct vgz *vg)
*/
int
__match_proto__
(
vdp_bytes
)
VDP_gunzip
(
struct
req
*
req
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
)
VDP_gunzip
(
struct
req
*
req
,
enum
vdp_action
act
,
void
*
priv
,
const
void
*
ptr
,
ssize_t
len
)
{
enum
vgzret_e
vr
;
ssize_t
dl
;
...
...
@@ -296,6 +297,9 @@ VDP_gunzip(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
wrk
=
req
->
wrk
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
(
void
)
priv
;
if
(
act
==
VDP_INIT
||
act
==
VDP_FINI
)
return
(
0
);
vg
=
req
->
vgz
;
CHECK_OBJ_NOTNULL
(
vg
,
VGZ_MAGIC
);
AN
(
vg
->
m_buf
);
...
...
bin/varnishd/http1/cache_http1_deliver.c
View file @
11c6e33e
...
...
@@ -36,11 +36,15 @@
/*--------------------------------------------------------------------*/
static
int
__match_proto__
(
vdp_bytes
)
v1d_bytes
(
struct
req
*
req
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
)
v1d_bytes
(
struct
req
*
req
,
enum
vdp_action
act
,
void
*
priv
,
const
void
*
ptr
,
ssize_t
len
)
{
ssize_t
wl
=
0
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
(
void
)
priv
;
if
(
act
==
VDP_INIT
||
act
==
VDP_FINI
)
return
(
0
);
assert
(
req
->
vdp_nxt
==
-
1
);
/* always at the bottom of the pile */
...
...
@@ -57,14 +61,17 @@ v1d_bytes(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
/*--------------------------------------------------------------------*/
static
int
__match_proto__
(
vdp_bytes
)
v1d_range_bytes
(
struct
req
*
req
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
)
v1d_range_bytes
(
struct
req
*
req
,
enum
vdp_action
act
,
void
*
priv
,
const
void
*
ptr
,
ssize_t
len
)
{
int
retval
=
0
;
ssize_t
l
;
const
char
*
p
=
ptr
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
(
void
)
priv
;
if
(
act
==
VDP_INIT
||
act
==
VDP_FINI
)
return
(
0
);
l
=
req
->
range_low
-
req
->
range_off
;
if
(
l
>
0
)
{
if
(
l
>
len
)
...
...
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