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
c1aa3c20
Commit
c1aa3c20
authored
Dec 11, 2023
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper locking around n_backend. Found by Coverity.
parent
e0d796b6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
vmod_directors.c
vmod/vmod_directors.c
+2
-0
vmod_directors_round_robin.c
vmod/vmod_directors_round_robin.c
+1
-1
No files found.
vmod/vmod_directors.c
View file @
c1aa3c20
...
@@ -94,9 +94,11 @@ vdir_release(struct vdir *vd)
...
@@ -94,9 +94,11 @@ vdir_release(struct vdir *vd)
CHECK_OBJ_NOTNULL
(
vd
,
VDIR_MAGIC
);
CHECK_OBJ_NOTNULL
(
vd
,
VDIR_MAGIC
);
vdir_wrlock
(
vd
);
for
(
u
=
0
;
u
<
vd
->
n_backend
;
u
++
)
for
(
u
=
0
;
u
<
vd
->
n_backend
;
u
++
)
VRT_Assign_Backend
(
&
vd
->
backend
[
u
],
NULL
);
VRT_Assign_Backend
(
&
vd
->
backend
[
u
],
NULL
);
vd
->
n_backend
=
0
;
vd
->
n_backend
=
0
;
vdir_unlock
(
vd
);
}
}
void
void
...
...
vmod/vmod_directors_round_robin.c
View file @
c1aa3c20
...
@@ -90,9 +90,9 @@ vmod_rr_resolve(VRT_CTX, VCL_BACKEND dir)
...
@@ -90,9 +90,9 @@ vmod_rr_resolve(VRT_CTX, VCL_BACKEND dir)
break
;
break
;
}
}
rr
->
nxt
=
nxt
;
rr
->
nxt
=
nxt
;
vdir_unlock
(
rr
->
vd
);
if
(
u
==
rr
->
vd
->
n_backend
)
if
(
u
==
rr
->
vd
->
n_backend
)
be
=
NULL
;
be
=
NULL
;
vdir_unlock
(
rr
->
vd
);
return
(
be
);
return
(
be
);
}
}
...
...
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