Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-weightadjust
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-weightadjust
Commits
c5710755
Commit
c5710755
authored
Oct 04, 2017
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix remove_backend
parent
946bc54d
Pipeline
#306
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
vmod_weightadjust.c
src/vmod_weightadjust.c
+13
-4
No files found.
src/vmod_weightadjust.c
View file @
c5710755
...
@@ -335,20 +335,29 @@ vmod_random_add_backend(VRT_CTX, struct vmod_weightadjust_random *rr,
...
@@ -335,20 +335,29 @@ vmod_random_add_backend(VRT_CTX, struct vmod_weightadjust_random *rr,
VCL_VOID
__match_proto__
()
VCL_VOID
__match_proto__
()
vmod_random_remove_backend
(
VRT_CTX
,
vmod_random_remove_backend
(
VRT_CTX
,
struct
vmod_weightadjust_random
*
rr
,
VCL_BACKEND
be
)
struct
vmod_weightadjust_random
*
rr
,
VCL_BACKEND
vcl_
be
)
{
{
struct
vmod_wadj_vcl
*
wa_vcl
;
struct
vmod_wadj_vcl
*
wa_vcl
;
struct
wadj_prop
*
prop
;
struct
wadj_prop
*
prop
;
struct
wadj_prop_head
props
;
struct
wadj_prop_head
props
;
struct
backend
*
be
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
rr
,
VMOD_WEIGHTADJUST_RANDOM_MAGIC
);
CHECK_OBJ_NOTNULL
(
rr
,
VMOD_WEIGHTADJUST_RANDOM_MAGIC
);
wa_vcl
=
rr
->
extra
.
wa_vcl
;
wa_vcl
=
rr
->
extra
.
wa_vcl
;
CHECK_OBJ_NOTNULL
(
wa_vcl
,
VMOD_WADJ_VCL_MAGIC
);
CHECK_OBJ_NOTNULL
(
wa_vcl
,
VMOD_WADJ_VCL_MAGIC
);
if
(
vcl_be
->
priv
==
NULL
)
{
ERR
(
ctx
,
"can only be used with real backends "
"(no director layering)"
);
return
;
}
CAST_OBJ_NOTNULL
(
be
,
vcl_be
->
priv
,
BACKEND_MAGIC
);
vdir_wrlock
(
rr
->
vd
);
vdir_wrlock
(
rr
->
vd
);
VTAILQ_FOREACH
(
prop
,
&
rr
->
extra
.
props
,
list_vd
)
{
VTAILQ_FOREACH
(
prop
,
&
rr
->
extra
.
props
,
list_vd
)
{
if
(
prop
->
vd
==
rr
->
vd
)
if
(
prop
->
be
==
be
)
break
;
break
;
}
}
if
(
prop
==
NULL
)
{
if
(
prop
==
NULL
)
{
...
@@ -358,7 +367,6 @@ vmod_random_remove_backend(VRT_CTX,
...
@@ -358,7 +367,6 @@ vmod_random_remove_backend(VRT_CTX,
assert
(
prop
->
vd
==
rr
->
vd
);
assert
(
prop
->
vd
==
rr
->
vd
);
VTAILQ_REMOVE
(
&
rr
->
extra
.
props
,
prop
,
list_vd
);
VTAILQ_REMOVE
(
&
rr
->
extra
.
props
,
prop
,
list_vd
);
vdir_unlock
(
rr
->
vd
);
VTAILQ_INIT
(
&
props
);
VTAILQ_INIT
(
&
props
);
VTAILQ_INSERT_HEAD
(
&
props
,
prop
,
list_vd
);
VTAILQ_INSERT_HEAD
(
&
props
,
prop
,
list_vd
);
...
@@ -366,7 +374,8 @@ vmod_random_remove_backend(VRT_CTX,
...
@@ -366,7 +374,8 @@ vmod_random_remove_backend(VRT_CTX,
AZ
(
pthread_mutex_lock
(
&
wa_vcl
->
mtx
));
AZ
(
pthread_mutex_lock
(
&
wa_vcl
->
mtx
));
wadj_dir_fini
(
&
props
,
&
wa_vcl
->
props
);
wadj_dir_fini
(
&
props
,
&
wa_vcl
->
props
);
AZ
(
pthread_mutex_unlock
(
&
wa_vcl
->
mtx
));
AZ
(
pthread_mutex_unlock
(
&
wa_vcl
->
mtx
));
vdir_unlock
(
rr
->
vd
);
no_weightadjust:
no_weightadjust:
vdir_remove_backend
(
rr
->
vd
,
be
,
NULL
);
vdir_remove_backend
(
rr
->
vd
,
vcl_
be
,
NULL
);
}
}
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