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
5df6f8d4
Commit
5df6f8d4
authored
May 07, 2019
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change VRT_re[fl]_vcl() to VRT_VCL_{Prevent|Allow}_Discard()
parent
d7a81fe8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
24 deletions
+10
-24
cache_vcl.h
bin/varnishd/cache/cache_vcl.h
+1
-1
cache_vrt_vcl.c
bin/varnishd/cache/cache_vrt_vcl.c
+3
-6
vrt.h
include/vrt.h
+3
-2
vmod_debug.c
lib/libvmod_debug/vmod_debug.c
+3
-15
No files found.
bin/varnishd/cache/cache_vcl.h
View file @
5df6f8d4
...
...
@@ -60,7 +60,7 @@ struct vcl {
struct
vclref
{
unsigned
magic
;
#define VCLREF_MAGIC 0x47fb6848
const
struct
vcl
*
vcl
;
struct
vcl
*
vcl
;
VTAILQ_ENTRY
(
vclref
)
list
;
char
desc
[
32
];
};
...
...
bin/varnishd/cache/cache_vrt_vcl.c
View file @
5df6f8d4
...
...
@@ -323,7 +323,7 @@ VCL_DefaultProbe(const struct vcl *vcl)
}
struct
vclref
*
VRT_
ref_vcl
(
VRT_CTX
,
const
char
*
desc
)
VRT_
VCL_Prevent_Discard
(
VRT_CTX
,
const
char
*
desc
)
{
struct
vcl
*
vcl
;
struct
vclref
*
ref
;
...
...
@@ -351,7 +351,7 @@ VRT_ref_vcl(VRT_CTX, const char *desc)
}
void
VRT_
rel_vcl
(
VRT_CTX
,
struct
vclref
**
refp
)
VRT_
VCL_Allow_Discard
(
struct
vclref
**
refp
)
{
struct
vcl
*
vcl
;
struct
vclref
*
ref
;
...
...
@@ -360,12 +360,9 @@ VRT_rel_vcl(VRT_CTX, struct vclref **refp)
ref
=
*
refp
;
*
refp
=
NULL
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ref
,
VCLREF_MAGIC
);
vcl
=
ctx
->
vcl
;
vcl
=
ref
->
vcl
;
CHECK_OBJ_NOTNULL
(
vcl
,
VCL_MAGIC
);
assert
(
vcl
==
ref
->
vcl
);
/* NB: A VCL may be released by a VMOD at any time, but it must happen
* after a warmup and before the end of a cooldown. The release may or
...
...
include/vrt.h
View file @
5df6f8d4
...
...
@@ -52,6 +52,7 @@
* binary/load-time compatible, increment MAJOR version
*
* unreleased (planned for 2019-09-15)
* VRT_re[fl]_vcl changed to VRT_VCL_{Prevent|Allow}_Discard
* VRT_Vmod_{Init|Unload} moved to vcc_interface.h
* VRT_count moved to vcc_interface.h
* VRT_VCL_Busy() and VRT_VCL_Unbusy() added.
...
...
@@ -523,8 +524,8 @@ struct vmod_priv {
};
struct
vclref
;
struct
vclref
*
VRT_
ref_vcl
(
VRT_CTX
,
const
char
*
);
void
VRT_
rel_vcl
(
VRT_CTX
,
struct
vclref
**
);
struct
vclref
*
VRT_
VCL_Prevent_Discard
(
VRT_CTX
,
const
char
*
);
void
VRT_
VCL_Allow_Discard
(
struct
vclref
**
);
void
VRT_priv_fini
(
const
struct
vmod_priv
*
p
);
struct
vmod_priv
*
VRT_priv_task
(
VRT_CTX
,
const
void
*
vmod_id
);
...
...
lib/libvmod_debug/vmod_debug.c
View file @
5df6f8d4
...
...
@@ -47,7 +47,6 @@ struct priv_vcl {
#define PRIV_VCL_MAGIC 0x8E62FA9D
char
*
foo
;
uintptr_t
obj_cb
;
struct
vcl
*
vcl
;
struct
vclref
*
vclref
;
};
...
...
@@ -341,7 +340,6 @@ priv_vcl_free(void *priv)
ObjUnsubscribeEvents
(
&
priv_vcl
->
obj_cb
);
VSL
(
SLT_Debug
,
0
,
"Unsubscribed from Object Events"
);
}
AZ
(
priv_vcl
->
vcl
);
AZ
(
priv_vcl
->
vclref
);
FREE_OBJ
(
priv_vcl
);
AZ
(
priv_vcl
);
...
...
@@ -393,31 +391,23 @@ event_warm(VRT_CTX, const struct vmod_priv *priv)
}
CAST_OBJ_NOTNULL
(
priv_vcl
,
priv
->
priv
,
PRIV_VCL_MAGIC
);
AZ
(
priv_vcl
->
vcl
);
AZ
(
priv_vcl
->
vclref
);
bprintf
(
buf
,
"vmod-debug ref on %s"
,
VCL_Name
(
ctx
->
vcl
));
priv_vcl
->
vcl
=
ctx
->
vcl
;
priv_vcl
->
vclref
=
VRT_ref_vcl
(
ctx
,
buf
);
priv_vcl
->
vclref
=
VRT_VCL_Prevent_Discard
(
ctx
,
buf
);
return
(
0
);
}
static
void
*
cooldown_thread
(
void
*
priv
)
{
struct
vrt_ctx
ctx
;
struct
priv_vcl
*
priv_vcl
;
CAST_OBJ_NOTNULL
(
priv_vcl
,
priv
,
PRIV_VCL_MAGIC
);
AN
(
priv_vcl
->
vcl
);
AN
(
priv_vcl
->
vclref
);
INIT_OBJ
(
&
ctx
,
VRT_CTX_MAGIC
);
ctx
.
vcl
=
priv_vcl
->
vcl
;
VTIM_sleep
(
vcl_release_delay
);
VRT_rel_vcl
(
&
ctx
,
&
priv_vcl
->
vclref
);
priv_vcl
->
vcl
=
NULL
;
VRT_VCL_Allow_Discard
(
&
priv_vcl
->
vclref
);
return
(
NULL
);
}
...
...
@@ -428,14 +418,12 @@ event_cold(VRT_CTX, const struct vmod_priv *priv)
struct
priv_vcl
*
priv_vcl
;
CAST_OBJ_NOTNULL
(
priv_vcl
,
priv
->
priv
,
PRIV_VCL_MAGIC
);
AN
(
priv_vcl
->
vcl
);
AN
(
priv_vcl
->
vclref
);
VSL
(
SLT_Debug
,
0
,
"%s: VCL_EVENT_COLD"
,
VCL_Name
(
ctx
->
vcl
));
if
(
vcl_release_delay
==
0
.
0
)
{
VRT_rel_vcl
(
ctx
,
&
priv_vcl
->
vclref
);
priv_vcl
->
vcl
=
NULL
;
VRT_VCL_Allow_Discard
(
&
priv_vcl
->
vclref
);
return
(
0
);
}
...
...
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