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
3e2e3fbd
Commit
3e2e3fbd
authored
Sep 25, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Name variables which point to struct vdp_entry_s "vdpe" to make
life easier for patch in the pipeline.
parent
7b157820
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
42 deletions
+42
-42
cache.h
bin/varnishd/cache/cache.h
+3
-3
cache_deliver_proc.c
bin/varnishd/cache/cache_deliver_proc.c
+33
-33
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+2
-2
cache_req.c
bin/varnishd/cache/cache_req.c
+2
-2
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 @
3e2e3fbd
...
...
@@ -574,9 +574,9 @@ struct req {
struct
objcore
*
stale_oc
;
/* Deliver pipeline */
struct
vdp_entry_s
vdp
;
struct
vdp_entry
*
vdp_nxt
;
unsigned
vdp_retval
;
struct
vdp_entry_s
vdp
e
;
struct
vdp_entry
*
vdp
e
_nxt
;
unsigned
vdp
e
_retval
;
/* Delivery mode */
unsigned
res_mode
;
...
...
bin/varnishd/cache/cache_deliver_proc.c
View file @
3e2e3fbd
...
...
@@ -39,7 +39,7 @@
* This function picks and calls the next delivery processor from the
* list. The return value is the return value of the delivery
* processor. Upon seeing a non-zero return value, that lowest value
* observed is latched in req->vdp_retval and all subsequent calls to
* observed is latched in req->vdp
e
_retval and all subsequent calls to
* VDP_bytes will return that value directly without calling the next
* processor.
*
...
...
@@ -52,63 +52,63 @@ int
VDP_bytes
(
struct
req
*
req
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
)
{
int
retval
;
struct
vdp_entry
*
vdp
;
struct
vdp_entry
*
vdp
e
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
assert
(
act
==
VDP_NULL
||
act
==
VDP_FLUSH
);
if
(
req
->
vdp_retval
)
return
(
req
->
vdp_retval
);
vdp
=
req
->
vdp
_nxt
;
CHECK_OBJ_NOTNULL
(
vdp
,
VDP_ENTRY_MAGIC
);
req
->
vdp
_nxt
=
VTAILQ_NEXT
(
vdp
,
list
);
if
(
req
->
vdp
e
_retval
)
return
(
req
->
vdp
e
_retval
);
vdp
e
=
req
->
vdpe
_nxt
;
CHECK_OBJ_NOTNULL
(
vdp
e
,
VDP_ENTRY_MAGIC
);
req
->
vdp
e_nxt
=
VTAILQ_NEXT
(
vdpe
,
list
);
assert
(
act
>
VDP_NULL
||
len
>
0
);
/* Call the present layer, while pointing to the next layer down */
retval
=
vdp
->
func
(
req
,
act
,
&
vdp
->
priv
,
ptr
,
len
);
if
(
retval
&&
(
req
->
vdp
_retval
==
0
||
retval
<
req
->
vdp
_retval
))
req
->
vdp_retval
=
retval
;
/* Latch error value */
req
->
vdp
_nxt
=
vdp
;
return
(
req
->
vdp_retval
);
retval
=
vdp
e
->
func
(
req
,
act
,
&
vdpe
->
priv
,
ptr
,
len
);
if
(
retval
&&
(
req
->
vdp
e_retval
==
0
||
retval
<
req
->
vdpe
_retval
))
req
->
vdp
e
_retval
=
retval
;
/* Latch error value */
req
->
vdp
e_nxt
=
vdpe
;
return
(
req
->
vdp
e
_retval
);
}
void
VDP_push
(
struct
req
*
req
,
vdp_bytes
*
func
,
void
*
priv
,
int
bottom
,
const
char
*
id
)
{
struct
vdp_entry
*
vdp
;
struct
vdp_entry
*
vdp
e
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
func
);
vdp
=
WS_Alloc
(
req
->
ws
,
sizeof
*
vdp
);
if
(
vdp
==
NULL
)
vdp
e
=
WS_Alloc
(
req
->
ws
,
sizeof
*
vdpe
);
if
(
vdp
e
==
NULL
)
return
;
INIT_OBJ
(
vdp
,
VDP_ENTRY_MAGIC
);
vdp
->
func
=
func
;
vdp
->
priv
=
priv
;
vdp
->
id
=
id
;
INIT_OBJ
(
vdp
e
,
VDP_ENTRY_MAGIC
);
vdp
e
->
func
=
func
;
vdp
e
->
priv
=
priv
;
vdp
e
->
id
=
id
;
if
(
bottom
)
VTAILQ_INSERT_TAIL
(
&
req
->
vdp
,
vdp
,
list
);
VTAILQ_INSERT_TAIL
(
&
req
->
vdp
e
,
vdpe
,
list
);
else
VTAILQ_INSERT_HEAD
(
&
req
->
vdp
,
vdp
,
list
);
req
->
vdp
_nxt
=
VTAILQ_FIRST
(
&
req
->
vdp
);
VTAILQ_INSERT_HEAD
(
&
req
->
vdp
e
,
vdpe
,
list
);
req
->
vdp
e_nxt
=
VTAILQ_FIRST
(
&
req
->
vdpe
);
AZ
(
vdp
->
func
(
req
,
VDP_INIT
,
&
vdp
->
priv
,
NULL
,
0
));
AZ
(
vdp
e
->
func
(
req
,
VDP_INIT
,
&
vdpe
->
priv
,
NULL
,
0
));
}
static
void
vdp_pop
(
struct
req
*
req
,
vdp_bytes
*
func
)
{
struct
vdp_entry
*
vdp
;
struct
vdp_entry
*
vdp
e
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
vdp
=
VTAILQ_FIRST
(
&
req
->
vdp
);
CHECK_OBJ_NOTNULL
(
vdp
,
VDP_ENTRY_MAGIC
);
assert
(
vdp
->
func
==
func
);
VTAILQ_REMOVE
(
&
req
->
vdp
,
vdp
,
list
);
AZ
(
vdp
->
func
(
req
,
VDP_FINI
,
&
vdp
->
priv
,
NULL
,
0
));
AZ
(
vdp
->
priv
);
req
->
vdp
_nxt
=
VTAILQ_FIRST
(
&
req
->
vdp
);
vdp
e
=
VTAILQ_FIRST
(
&
req
->
vdpe
);
CHECK_OBJ_NOTNULL
(
vdp
e
,
VDP_ENTRY_MAGIC
);
assert
(
vdp
e
->
func
==
func
);
VTAILQ_REMOVE
(
&
req
->
vdp
e
,
vdpe
,
list
);
AZ
(
vdp
e
->
func
(
req
,
VDP_FINI
,
&
vdpe
->
priv
,
NULL
,
0
));
AZ
(
vdp
e
->
priv
);
req
->
vdp
e_nxt
=
VTAILQ_FIRST
(
&
req
->
vdpe
);
}
void
...
...
@@ -116,8 +116,8 @@ VDP_close(struct req *req)
{
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
while
(
!
VTAILQ_EMPTY
(
&
req
->
vdp
))
vdp_pop
(
req
,
VTAILQ_FIRST
(
&
req
->
vdp
)
->
func
);
while
(
!
VTAILQ_EMPTY
(
&
req
->
vdp
e
))
vdp_pop
(
req
,
VTAILQ_FIRST
(
&
req
->
vdp
e
)
->
func
);
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishd/cache/cache_gzip.c
View file @
3e2e3fbd
...
...
@@ -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
->
vdp
)
->
func
==
VDP_gunzip
)
if
(
u
!=
0
&&
VTAILQ_FIRST
(
&
req
->
vdp
e
)
->
func
==
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
->
vdp_retval
);
return
(
req
->
vdp
e
_retval
);
vg
->
m_len
=
0
;
VGZ_Obuf
(
vg
,
vg
->
m_buf
,
vg
->
m_sz
);
}
...
...
bin/varnishd/cache/cache_req.c
View file @
3e2e3fbd
...
...
@@ -132,8 +132,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
);
req
->
vdp
e
_nxt
=
0
;
VTAILQ_INIT
(
&
req
->
vdp
e
);
return
(
req
);
}
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
3e2e3fbd
...
...
@@ -793,7 +793,7 @@ cnt_recv(struct worker *wrk, struct req *req)
req
->
director_hint
=
VCL_DefaultDirector
(
req
->
vcl
);
AN
(
req
->
director_hint
);
req
->
vdp_retval
=
0
;
req
->
vdp
e
_retval
=
0
;
req
->
d_ttl
=
-
1
;
req
->
disable_esi
=
0
;
req
->
hash_always_miss
=
0
;
...
...
bin/varnishd/http1/cache_http1_deliver.c
View file @
3e2e3fbd
...
...
@@ -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
->
vdp_nxt
);
/* always at the bottom of the pile */
AZ
(
req
->
vdp
e
_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