Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-all_healthy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-all_healthy
Commits
38918855
Unverified
Commit
38918855
authored
Aug 01, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use release and destroy callbacks
parent
9daa571b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
5 deletions
+28
-5
vmod_all_healthy.c
src/vmod_all_healthy.c
+28
-5
No files found.
src/vmod_all_healthy.c
View file @
38918855
...
...
@@ -107,11 +107,39 @@ vmod_director_healthy(VRT_CTX, VCL_BACKEND b, VCL_TIME *t)
return
(
r
);
}
static
void
v_matchproto_
(
vdi_release_f
)
vmod_director_release
(
VCL_BACKEND
dir
)
{
struct
vmod_all_healthy_director
*
d
;
int
i
;
CHECK_OBJ_NOTNULL
(
dir
,
DIRECTOR_MAGIC
);
CAST_OBJ_NOTNULL
(
d
,
dir
->
priv
,
VMOD_ALL_HEALTHY_DIRECTOR_MAGIC
);
for
(
i
=
0
;
i
<
d
->
nconsider
;
i
++
)
VRT_Assign_Backend
(
&
d
->
consider
[
i
],
NULL
);
VRT_Assign_Backend
(
&
d
->
backend
,
NULL
);
}
static
void
v_matchproto_
(
vdi_destroy_f
)
vmod_director_destroy
(
VCL_BACKEND
dir
)
{
struct
vmod_all_healthy_director
*
d
;
CHECK_OBJ_NOTNULL
(
dir
,
DIRECTOR_MAGIC
);
CAST_OBJ_NOTNULL
(
d
,
dir
->
priv
,
VMOD_ALL_HEALTHY_DIRECTOR_MAGIC
);
free
(
TRUST_ME
(
d
->
consider
));
FREE_OBJ
(
d
);
}
static
const
struct
vdi_methods
vmod_director_methods
[
1
]
=
{{
.
magic
=
VDI_METHODS_MAGIC
,
.
type
=
"all_healthy"
,
.
healthy
=
vmod_director_healthy
,
.
resolve
=
vmod_director_resolve
,
.
release
=
vmod_director_release
,
.
destroy
=
vmod_director_destroy
,
}};
VCL_VOID
...
...
@@ -159,12 +187,7 @@ vmod_director__fini(struct vmod_all_healthy_director **dp)
if
(
d
==
NULL
)
return
;
CHECK_OBJ
(
d
,
VMOD_ALL_HEALTHY_DIRECTOR_MAGIC
);
for
(
i
=
0
;
i
<
d
->
nconsider
;
i
++
)
VRT_Assign_Backend
(
&
d
->
consider
[
i
],
NULL
);
VRT_Assign_Backend
(
&
d
->
backend
,
NULL
);
VRT_DelDirector
(
&
d
->
dir
);
free
(
TRUST_ME
(
d
->
consider
));
FREE_OBJ
(
d
);
}
#define check_init(ctx, name) do { \
...
...
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