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
c72cfed7
Commit
c72cfed7
authored
Jun 17, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the VCL reference in vrt_ctx point to our internal
housekeeping rather than the compile config structure.
parent
08fe2b87
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
29 deletions
+38
-29
cache_backend.c
bin/varnishd/cache/cache_backend.c
+2
-2
cache_backend.h
bin/varnishd/cache/cache_backend.h
+3
-1
cache_backend_cfg.c
bin/varnishd/cache/cache_backend_cfg.c
+4
-2
cache_vcl.c
bin/varnishd/cache/cache_vcl.c
+20
-4
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+0
-12
cache_vrt_priv.c
bin/varnishd/cache/cache_vrt_priv.c
+1
-1
vrt.h
include/vrt.h
+8
-7
No files found.
bin/varnishd/cache/cache_backend.c
View file @
c72cfed7
...
...
@@ -308,9 +308,9 @@ VRT_init_vbe(VRT_CTX, struct director **dp, const struct vrt_backend *vrt)
AN
(
dp
);
AZ
(
*
dp
);
CHECK_OBJ_NOTNULL
(
vrt
,
VRT_BACKEND_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
vcl
,
VCL_CONF_MAGIC
);
AN
(
ctx
->
vcl
);
be
=
VBE_AddBackend
(
ctx
->
vcl
->
loaded_name
,
vrt
);
be
=
VBE_AddBackend
(
ctx
,
vrt
);
AN
(
be
);
ALLOC_OBJ
(
d
,
DIRECTOR_MAGIC
);
XXXAN
(
d
);
...
...
bin/varnishd/cache/cache_backend.h
View file @
c72cfed7
...
...
@@ -39,6 +39,7 @@
struct
vbp_target
;
struct
vbc
;
struct
vrt_ctx
;
struct
vrt_backend_probe
;
struct
tcp_pool
;
...
...
@@ -105,7 +106,8 @@ struct vbc {
/* cache_backend_cfg.c */
unsigned
VBE_Healthy
(
const
struct
backend
*
b
,
double
*
changed
);
struct
backend
*
VBE_AddBackend
(
const
char
*
vcl
,
const
struct
vrt_backend
*
vb
);
struct
backend
*
VBE_AddBackend
(
const
struct
vrt_ctx
*
,
const
struct
vrt_backend
*
);
void
VBE_DeleteBackend
(
struct
backend
*
);
/* cache_backend_poll.c */
...
...
bin/varnishd/cache/cache_backend_cfg.c
View file @
c72cfed7
...
...
@@ -76,11 +76,13 @@ VBE_DeleteBackend(struct backend *b)
*/
struct
backend
*
VBE_AddBackend
(
const
char
*
vcl
,
const
struct
vrt_backend
*
vb
)
VBE_AddBackend
(
const
struct
vrt_ctx
*
ctx
,
const
struct
vrt_backend
*
vb
)
{
struct
backend
*
b
;
char
buf
[
128
];
struct
vcl
*
vcl
;
vcl
=
ctx
->
vcl
;
AN
(
vb
->
vcl_name
);
assert
(
vb
->
ipv4_suckaddr
!=
NULL
||
vb
->
ipv6_suckaddr
!=
NULL
);
...
...
@@ -89,7 +91,7 @@ VBE_AddBackend(const char *vcl, const struct vrt_backend *vb)
XXXAN
(
b
);
Lck_New
(
&
b
->
mtx
,
lck_backend
);
bprintf
(
buf
,
"%s.%s"
,
vcl
,
vb
->
vcl_name
);
bprintf
(
buf
,
"%s.%s"
,
VCL_Name
(
vcl
)
,
vb
->
vcl_name
);
REPLACE
(
b
->
display_name
,
buf
);
b
->
vcl_name
=
vb
->
vcl_name
;
...
...
bin/varnishd/cache/cache_vcl.c
View file @
c72cfed7
...
...
@@ -262,6 +262,20 @@ VCL_Name(const struct vcl *vcc)
/*--------------------------------------------------------------------*/
void
VRT_count
(
VRT_CTX
,
unsigned
u
)
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
vcl
,
VCL_MAGIC
);
assert
(
u
<
ctx
->
vcl
->
conf
->
nref
);
if
(
ctx
->
vsl
!=
NULL
)
VSLb
(
ctx
->
vsl
,
SLT_VCL_trace
,
"%u %u.%u"
,
u
,
ctx
->
vcl
->
conf
->
ref
[
u
].
line
,
ctx
->
vcl
->
conf
->
ref
[
u
].
pos
);
}
/*--------------------------------------------------------------------*/
static
struct
vcl
*
vcl_find
(
const
char
*
name
)
{
...
...
@@ -332,7 +346,7 @@ VCL_Load(struct cli *cli, const char *name, const char *fn, const char *state)
INIT_OBJ
(
&
ctx
,
VRT_CTX_MAGIC
);
ctx
.
method
=
VCL_MET_INIT
;
ctx
.
handling
=
&
hand
;
ctx
.
vcl
=
vcl
->
conf
;
ctx
.
vcl
=
vcl
;
VSB_clear
(
vsb
);
ctx
.
msg
=
vsb
;
...
...
@@ -380,7 +394,7 @@ VCL_Nuke(struct vcl *vcl)
VTAILQ_REMOVE
(
&
vcl_head
,
vcl
,
list
);
ctx
.
method
=
VCL_MET_FINI
;
ctx
.
handling
=
&
hand
;
ctx
.
vcl
=
vcl
->
conf
;
ctx
.
vcl
=
vcl
;
AZ
(
vcl
->
conf
->
event_vcl
(
&
ctx
,
VCL_EVENT_DISCARD
));
free
(
vcl
->
conf
->
loaded_name
);
VCL_Close
(
&
vcl
);
...
...
@@ -569,8 +583,9 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
if
(
req
!=
NULL
)
{
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
vcl
,
VCL_MAGIC
);
vsl
=
req
->
vsl
;
ctx
.
vcl
=
req
->
vcl
->
conf
;
ctx
.
vcl
=
req
->
vcl
;
ctx
.
http_req
=
req
->
http
;
ctx
.
http_req_top
=
req
->
top
->
http
;
ctx
.
http_resp
=
req
->
resp
;
...
...
@@ -580,8 +595,9 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
}
if
(
bo
!=
NULL
)
{
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
vcl
,
VCL_MAGIC
);
vsl
=
bo
->
vsl
;
ctx
.
vcl
=
bo
->
vcl
->
conf
;
ctx
.
vcl
=
bo
->
vcl
;
ctx
.
http_bereq
=
bo
->
bereq
;
ctx
.
http_beresp
=
bo
->
beresp
;
ctx
.
bo
=
bo
;
...
...
bin/varnishd/cache/cache_vrt.c
View file @
c72cfed7
...
...
@@ -64,18 +64,6 @@ VRT_error(VRT_CTX, unsigned code, const char *reason)
/*--------------------------------------------------------------------*/
void
VRT_count
(
VRT_CTX
,
unsigned
u
)
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
ctx
->
vsl
!=
NULL
)
VSLb
(
ctx
->
vsl
,
SLT_VCL_trace
,
"%u %u.%u"
,
u
,
ctx
->
vcl
->
ref
[
u
].
line
,
ctx
->
vcl
->
ref
[
u
].
pos
);
}
/*--------------------------------------------------------------------*/
void
VRT_acl_log
(
VRT_CTX
,
const
char
*
msg
)
{
...
...
bin/varnishd/cache/cache_vrt_priv.c
View file @
c72cfed7
...
...
@@ -43,7 +43,7 @@ struct vrt_priv {
#define VRT_PRIV_MAGIC 0x24157a52
VTAILQ_ENTRY
(
vrt_priv
)
list
;
struct
vmod_priv
priv
[
1
];
const
struct
VCL_conf
*
vcl
;
const
struct
vcl
*
vcl
;
uintptr_t
id
;
uintptr_t
vmod_id
;
};
...
...
include/vrt.h
View file @
c72cfed7
...
...
@@ -49,16 +49,17 @@
/***********************************************************************/
struct
req
;
struct
VCL_conf
;
struct
busyobj
;
struct
vsl_log
;
struct
http
;
struct
ws
;
struct
vsb
;
struct
director
;
struct
VCL_conf
;
struct
http
;
struct
req
;
struct
suckaddr
;
struct
vcl
;
struct
vmod
;
struct
vsb
;
struct
vsl_log
;
struct
ws
;
/***********************************************************************
* This is the central definition of the mapping from VCL types to
...
...
@@ -95,7 +96,7 @@ struct vrt_ctx {
struct
vsb
*
msg
;
// Only in ...init()
struct
vsl_log
*
vsl
;
struct
VCL_conf
*
vcl
;
struct
vcl
*
vcl
;
struct
ws
*
ws
;
struct
req
*
req
;
...
...
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