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
cd30d116
Commit
cd30d116
authored
Oct 27, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move VDP context to cache_filter.h
parent
571a1e33
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
18 deletions
+24
-18
cache.h
bin/varnishd/cache/cache.h
+1
-7
cache_deliver_proc.c
bin/varnishd/cache/cache_deliver_proc.c
+3
-3
cache_filter.h
bin/varnishd/cache/cache_filter.h
+10
-0
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+2
-2
cache_req.c
bin/varnishd/cache/cache_req.c
+6
-4
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+1
-1
cache_http1_deliver.c
bin/varnishd/http1/cache_http1_deliver.c
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
cd30d116
...
...
@@ -460,8 +460,6 @@ struct busyobj {
/*--------------------------------------------------------------------*/
VTAILQ_HEAD
(
vdp_entry_s
,
vdp_entry
);
struct
req
{
unsigned
magic
;
#define REQ_MAGIC 0x2751aaa1
...
...
@@ -532,11 +530,7 @@ struct req {
struct
objcore
*
stale_oc
;
/* Deliver pipeline */
struct
vdp_ctx
{
struct
vdp_entry_s
vdp
;
struct
vdp_entry
*
nxt
;
unsigned
retval
;
}
vdp
[
1
];
struct
vdp_ctx
*
vdc
;
/* Delivery mode */
unsigned
res_mode
;
...
...
bin/varnishd/cache/cache_deliver_proc.c
View file @
cd30d116
...
...
@@ -56,7 +56,7 @@ VDP_bytes(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
struct
vdp_ctx
*
vdc
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
vdc
=
req
->
vd
p
;
vdc
=
req
->
vd
c
;
assert
(
act
==
VDP_NULL
||
act
==
VDP_FLUSH
);
if
(
vdc
->
retval
)
return
(
vdc
->
retval
);
...
...
@@ -80,7 +80,7 @@ VDP_push(struct req *req, const struct vdp *vdp, void *priv, int bottom)
struct
vdp_ctx
*
vdc
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
vdc
=
req
->
vd
p
;
vdc
=
req
->
vd
c
;
AN
(
vdp
);
AN
(
vdp
->
name
);
AN
(
vdp
->
func
);
...
...
@@ -107,7 +107,7 @@ VDP_close(struct req *req)
struct
vdp_ctx
*
vdc
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
vdc
=
req
->
vd
p
;
vdc
=
req
->
vd
c
;
while
(
!
VTAILQ_EMPTY
(
&
vdc
->
vdp
))
{
vdpe
=
VTAILQ_FIRST
(
&
vdc
->
vdp
);
CHECK_OBJ_NOTNULL
(
vdpe
,
VDP_ENTRY_MAGIC
);
...
...
bin/varnishd/cache/cache_filter.h
View file @
cd30d116
...
...
@@ -113,5 +113,15 @@ struct vdp_entry {
VTAILQ_ENTRY
(
vdp_entry
)
list
;
};
VTAILQ_HEAD
(
vdp_entry_s
,
vdp_entry
);
struct
vdp_ctx
{
unsigned
magic
;
#define VDP_CTX_MAGIC 0xee501df7
struct
vdp_entry_s
vdp
;
struct
vdp_entry
*
nxt
;
unsigned
retval
;
};
int
VDP_bytes
(
struct
req
*
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
);
void
VDP_push
(
struct
req
*
,
const
struct
vdp
*
,
void
*
priv
,
int
bottom
);
bin/varnishd/cache/cache_gzip.c
View file @
cd30d116
...
...
@@ -327,7 +327,7 @@ vdp_gunzip(struct req *req, enum vdp_action act, void **priv,
* If the size is non-zero AND we are the top
* VDP (ie: no ESI), we know what size the output will be.
*/
if
(
u
!=
0
&&
VTAILQ_FIRST
(
&
req
->
vd
p
->
vdp
)
->
vdp
==
&
VDP_gunzip
)
if
(
u
!=
0
&&
VTAILQ_FIRST
(
&
req
->
vd
c
->
vdp
)
->
vdp
==
&
VDP_gunzip
)
req
->
resp_len
=
u
;
return
(
0
);
...
...
@@ -355,7 +355,7 @@ vdp_gunzip(struct req *req, enum vdp_action act, void **priv,
return
(
-
1
);
if
(
vg
->
m_len
==
vg
->
m_sz
||
vr
!=
VGZ_OK
)
{
if
(
VDP_bytes
(
req
,
VDP_FLUSH
,
vg
->
m_buf
,
vg
->
m_len
))
return
(
req
->
vd
p
->
retval
);
return
(
req
->
vd
c
->
retval
);
vg
->
m_len
=
0
;
VGZ_Obuf
(
vg
,
vg
->
m_buf
,
vg
->
m_sz
);
}
...
...
bin/varnishd/cache/cache_req.c
View file @
cd30d116
...
...
@@ -124,8 +124,13 @@ Req_New(const struct worker *wrk, struct sess *sp)
p
=
(
void
*
)
PRNDUP
(
p
);
req
->
vfc
=
(
void
*
)
p
;
p
+=
sizeof
(
*
req
->
vfc
);
INIT_OBJ
(
req
->
vfc
,
VFP_CTX_MAGIC
);
p
=
(
void
*
)
PRNDUP
(
p
+
sizeof
(
*
req
->
vfc
));
req
->
vdc
=
(
void
*
)
p
;
INIT_OBJ
(
req
->
vdc
,
VDP_CTX_MAGIC
);
VTAILQ_INIT
(
&
req
->
vdc
->
vdp
);
p
=
(
void
*
)
PRNDUP
(
p
+
sizeof
(
*
req
->
vdc
));
assert
(
p
<
e
);
...
...
@@ -137,11 +142,8 @@ Req_New(const struct worker *wrk, struct sess *sp)
req
->
t_prev
=
NAN
;
req
->
t_req
=
NAN
;
req
->
vdp
->
nxt
=
0
;
VTAILQ_INIT
(
&
req
->
vdp
->
vdp
);
VRTPRIV_init
(
req
->
privs
);
return
(
req
);
}
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
cd30d116
...
...
@@ -790,7 +790,7 @@ cnt_recv(struct worker *wrk, struct req *req)
req
->
director_hint
=
VCL_DefaultDirector
(
req
->
vcl
);
AN
(
req
->
director_hint
);
req
->
vd
p
->
retval
=
0
;
req
->
vd
c
->
retval
=
0
;
req
->
d_ttl
=
-
1
;
req
->
disable_esi
=
0
;
req
->
hash_always_miss
=
0
;
...
...
bin/varnishd/http1/cache_http1_deliver.c
View file @
cd30d116
...
...
@@ -46,7 +46,7 @@ v1d_bytes(struct req *req, enum vdp_action act, void **priv,
if
(
act
==
VDP_INIT
||
act
==
VDP_FINI
)
return
(
0
);
AZ
(
req
->
vd
p
->
nxt
);
/* always at the bottom of the pile */
AZ
(
req
->
vd
c
->
nxt
);
/* always at the bottom of the pile */
if
(
len
>
0
)
wl
=
V1L_Write
(
req
->
wrk
,
ptr
,
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