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
73fd9d73
Commit
73fd9d73
authored
Aug 23, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Register the vmods unique (per-vcl) number
parent
399bc4c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
cache_vrt_vmod.c
bin/varnishd/cache/cache_vrt_vmod.c
+4
-2
vrt.h
include/vrt.h
+2
-1
vcc_vmod.c
lib/libvcc/vcc_vmod.c
+1
-1
No files found.
bin/varnishd/cache/cache_vrt_vmod.c
View file @
73fd9d73
...
@@ -53,6 +53,7 @@ struct vmod {
...
@@ -53,6 +53,7 @@ struct vmod {
int
ref
;
int
ref
;
char
*
nm
;
char
*
nm
;
unsigned
nbr
;
char
*
path
;
char
*
path
;
char
*
backup
;
char
*
backup
;
void
*
hdl
;
void
*
hdl
;
...
@@ -77,8 +78,8 @@ vmod_abi_mismatch(const struct vmod_data *d)
...
@@ -77,8 +78,8 @@ vmod_abi_mismatch(const struct vmod_data *d)
}
}
int
int
VRT_Vmod_Init
(
VRT_CTX
,
struct
vmod
**
hdl
,
void
*
ptr
,
int
len
,
const
char
*
nm
,
VRT_Vmod_Init
(
VRT_CTX
,
struct
vmod
**
hdl
,
unsigned
nbr
,
void
*
ptr
,
int
len
,
const
char
*
path
,
const
char
*
file_id
,
const
char
*
backup
)
const
char
*
nm
,
const
char
*
path
,
const
char
*
file_id
,
const
char
*
backup
)
{
{
struct
vmod
*
v
;
struct
vmod
*
v
;
const
struct
vmod_data
*
d
;
const
struct
vmod_data
*
d
;
...
@@ -138,6 +139,7 @@ VRT_Vmod_Init(VRT_CTX, struct vmod **hdl, void *ptr, int len, const char *nm,
...
@@ -138,6 +139,7 @@ VRT_Vmod_Init(VRT_CTX, struct vmod **hdl, void *ptr, int len, const char *nm,
return
(
1
);
return
(
1
);
}
}
v
->
nbr
=
nbr
;
v
->
funclen
=
d
->
func_len
;
v
->
funclen
=
d
->
func_len
;
v
->
funcs
=
d
->
func
;
v
->
funcs
=
d
->
func
;
v
->
abi
=
d
->
abi
;
v
->
abi
=
d
->
abi
;
...
...
include/vrt.h
View file @
73fd9d73
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
* VRT_CollectStrands() added
* VRT_CollectStrands() added
* VRT_STRANDS_string() removed from vrt.h (never implemented)
* VRT_STRANDS_string() removed from vrt.h (never implemented)
* VRT_Healthy() changed prototype
* VRT_Healthy() changed prototype
* VRT_Vmod_Init signature changed
* 7.0 (2018-03-15)
* 7.0 (2018-03-15)
* lots of stuff moved from cache.h to cache_varnishd.h
* lots of stuff moved from cache.h to cache_varnishd.h
* (ie: from "$Abi vrt" to "$Abi strict")
* (ie: from "$Abi vrt" to "$Abi strict")
...
@@ -471,7 +472,7 @@ void VRT_DelDirector(VCL_BACKEND *);
...
@@ -471,7 +472,7 @@ void VRT_DelDirector(VCL_BACKEND *);
int
VRT_VSA_GetPtr
(
const
struct
suckaddr
*
sua
,
const
unsigned
char
**
dst
);
int
VRT_VSA_GetPtr
(
const
struct
suckaddr
*
sua
,
const
unsigned
char
**
dst
);
/* VMOD/Modules related */
/* VMOD/Modules related */
int
VRT_Vmod_Init
(
VRT_CTX
,
struct
vmod
**
hdl
,
void
*
ptr
,
int
len
,
int
VRT_Vmod_Init
(
VRT_CTX
,
struct
vmod
**
hdl
,
unsigned
nbr
,
void
*
ptr
,
int
len
,
const
char
*
nm
,
const
char
*
path
,
const
char
*
file_id
,
const
char
*
backup
);
const
char
*
nm
,
const
char
*
path
,
const
char
*
file_id
,
const
char
*
backup
);
void
VRT_Vmod_Fini
(
struct
vmod
**
hdl
);
void
VRT_Vmod_Fini
(
struct
vmod
**
hdl
);
...
...
lib/libvcc/vcc_vmod.c
View file @
73fd9d73
...
@@ -305,6 +305,7 @@ vcc_ParseImport(struct vcc *tl)
...
@@ -305,6 +305,7 @@ vcc_ParseImport(struct vcc *tl)
VSB_printf
(
ifp
->
ini
,
"
\t
if (VRT_Vmod_Init(ctx,
\n
"
);
VSB_printf
(
ifp
->
ini
,
"
\t
if (VRT_Vmod_Init(ctx,
\n
"
);
VSB_printf
(
ifp
->
ini
,
"
\t
&VGC_vmod_%.*s,
\n
"
,
PF
(
mod
));
VSB_printf
(
ifp
->
ini
,
"
\t
&VGC_vmod_%.*s,
\n
"
,
PF
(
mod
));
VSB_printf
(
ifp
->
ini
,
"
\t
%u,
\n
"
,
tl
->
vmod_count
++
);
VSB_printf
(
ifp
->
ini
,
"
\t
&Vmod_%.*s_Func,
\n
"
,
PF
(
mod
));
VSB_printf
(
ifp
->
ini
,
"
\t
&Vmod_%.*s_Func,
\n
"
,
PF
(
mod
));
VSB_printf
(
ifp
->
ini
,
"
\t
sizeof(Vmod_%.*s_Func),
\n
"
,
PF
(
mod
));
VSB_printf
(
ifp
->
ini
,
"
\t
sizeof(Vmod_%.*s_Func),
\n
"
,
PF
(
mod
));
VSB_printf
(
ifp
->
ini
,
"
\t
\"
%.*s
\"
,
\n
"
,
PF
(
mod
));
VSB_printf
(
ifp
->
ini
,
"
\t
\"
%.*s
\"
,
\n
"
,
PF
(
mod
));
...
@@ -336,7 +337,6 @@ vcc_ParseImport(struct vcc *tl)
...
@@ -336,7 +337,6 @@ vcc_ParseImport(struct vcc *tl)
vcc_json_always
(
tl
,
msym
);
vcc_json_always
(
tl
,
msym
);
Fh
(
tl
,
0
,
"
\n
/* --- BEGIN VMOD %.*s --- */
\n\n
"
,
PF
(
mod
));
Fh
(
tl
,
0
,
"
\n
/* --- BEGIN VMOD %.*s --- */
\n\n
"
,
PF
(
mod
));
Fh
(
tl
,
0
,
"#define VMOD_NUMBER_%.*s %u
\n
"
,
PF
(
mod
),
tl
->
vmod_count
++
);
Fh
(
tl
,
0
,
"static struct vmod *VGC_vmod_%.*s;
\n
"
,
PF
(
mod
));
Fh
(
tl
,
0
,
"static struct vmod *VGC_vmod_%.*s;
\n
"
,
PF
(
mod
));
Fh
(
tl
,
0
,
"static struct vmod_priv vmod_priv_%.*s;
\n
"
,
PF
(
mod
));
Fh
(
tl
,
0
,
"static struct vmod_priv vmod_priv_%.*s;
\n
"
,
PF
(
mod
));
Fh
(
tl
,
0
,
"
\n
%s
\n
"
,
vmd
->
proto
);
Fh
(
tl
,
0
,
"
\n
%s
\n
"
,
vmd
->
proto
);
...
...
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