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
2f054422
Commit
2f054422
authored
Jan 27, 2017
by
Guillaume Quintard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let remove_backend tell if the current dir changed
parent
9c4e8c8d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
6 deletions
+15
-6
fall_back.c
lib/libvmod_directors/fall_back.c
+1
-1
hash.c
lib/libvmod_directors/hash.c
+1
-1
random.c
lib/libvmod_directors/random.c
+1
-1
round_robin.c
lib/libvmod_directors/round_robin.c
+1
-1
vdir.c
lib/libvmod_directors/vdir.c
+10
-1
vdir.h
lib/libvmod_directors/vdir.h
+1
-1
No files found.
lib/libvmod_directors/fall_back.c
View file @
2f054422
...
...
@@ -123,7 +123,7 @@ vmod_fallback_remove_backend(VRT_CTX,
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
fb
,
VMOD_DIRECTORS_FALLBACK_MAGIC
);
vdir_remove_backend
(
fb
->
vd
,
be
);
vdir_remove_backend
(
fb
->
vd
,
be
,
NULL
);
}
VCL_BACKEND
__match_proto__
()
...
...
lib/libvmod_directors/hash.c
View file @
2f054422
...
...
@@ -91,7 +91,7 @@ vmod_hash_remove_backend(VRT_CTX,
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
rr
,
VMOD_DIRECTORS_HASH_MAGIC
);
vdir_remove_backend
(
rr
->
vd
,
be
);
vdir_remove_backend
(
rr
->
vd
,
be
,
NULL
);
}
VCL_BACKEND
__match_proto__
()
...
...
lib/libvmod_directors/random.c
View file @
2f054422
...
...
@@ -118,7 +118,7 @@ VCL_VOID vmod_random_remove_backend(VRT_CTX,
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
rr
,
VMOD_DIRECTORS_RANDOM_MAGIC
);
vdir_remove_backend
(
rr
->
vd
,
be
);
vdir_remove_backend
(
rr
->
vd
,
be
,
NULL
);
}
VCL_BACKEND
__match_proto__
()
...
...
lib/libvmod_directors/round_robin.c
View file @
2f054422
...
...
@@ -127,7 +127,7 @@ vmod_round_robin_remove_backend(VRT_CTX,
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
rr
,
VMOD_DIRECTORS_ROUND_ROBIN_MAGIC
);
vdir_remove_backend
(
rr
->
vd
,
be
);
vdir_remove_backend
(
rr
->
vd
,
be
,
NULL
);
}
VCL_BACKEND
__match_proto__
()
...
...
lib/libvmod_directors/vdir.c
View file @
2f054422
...
...
@@ -134,7 +134,7 @@ vdir_add_backend(struct vdir *vd, VCL_BACKEND be, double weight)
}
void
vdir_remove_backend
(
struct
vdir
*
vd
,
VCL_BACKEND
be
)
vdir_remove_backend
(
struct
vdir
*
vd
,
VCL_BACKEND
be
,
unsigned
*
cur
)
{
unsigned
u
,
n
;
...
...
@@ -155,6 +155,15 @@ vdir_remove_backend(struct vdir *vd, VCL_BACKEND be)
memmove
(
&
vd
->
backend
[
u
],
&
vd
->
backend
[
u
+
1
],
n
*
sizeof
(
vd
->
backend
[
0
]));
memmove
(
&
vd
->
weight
[
u
],
&
vd
->
weight
[
u
+
1
],
n
*
sizeof
(
vd
->
weight
[
0
]));
vd
->
n_backend
--
;
if
(
cur
)
{
assert
(
*
cur
>=
0
);
assert
(
*
cur
<=
vd
->
n_backend
);
if
(
u
<
*
cur
)
(
*
cur
)
--
;
else
if
(
*
cur
==
vd
->
n_backend
)
*
cur
=
0
;
}
vdir_unlock
(
vd
);
}
...
...
lib/libvmod_directors/vdir.h
View file @
2f054422
...
...
@@ -48,7 +48,7 @@ void vdir_rdlock(struct vdir *vd);
void
vdir_wrlock
(
struct
vdir
*
vd
);
void
vdir_unlock
(
struct
vdir
*
vd
);
unsigned
vdir_add_backend
(
struct
vdir
*
,
VCL_BACKEND
be
,
double
weight
);
void
vdir_remove_backend
(
struct
vdir
*
,
VCL_BACKEND
be
);
void
vdir_remove_backend
(
struct
vdir
*
,
VCL_BACKEND
be
,
unsigned
*
cur
);
unsigned
vdir_any_healthy
(
struct
vdir
*
,
const
struct
busyobj
*
,
double
*
changed
);
VCL_BACKEND
vdir_pick_be
(
struct
vdir
*
,
double
w
,
const
struct
busyobj
*
);
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