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
418cea5d
Commit
418cea5d
authored
Oct 28, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add busyobj as argument to vdir->healthy()
parent
65034251
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
28 additions
and
20 deletions
+28
-20
cache_backend.c
bin/varnishd/cache/cache_backend.c
+3
-1
cache_director.c
bin/varnishd/cache/cache_director.c
+2
-2
cache_director.h
bin/varnishd/cache/cache_director.h
+3
-2
fall_back.c
lib/libvmod_directors/fall_back.c
+4
-3
random.c
lib/libvmod_directors/random.c
+3
-2
round_robin.c
lib/libvmod_directors/round_robin.c
+4
-3
vdir.c
lib/libvmod_directors/vdir.c
+4
-3
vdir.h
lib/libvmod_directors/vdir.h
+4
-3
vmod_std.c
lib/libvmod_std/vmod_std.c
+1
-1
No files found.
bin/varnishd/cache/cache_backend.c
View file @
418cea5d
...
...
@@ -370,12 +370,14 @@ vbe_dir_getfd(const struct director *d, struct busyobj *bo)
}
static
unsigned
__match_proto__
(
vdi_healthy_f
)
vbe_dir_healthy
(
const
struct
director
*
d
,
double
*
changed
)
vbe_dir_healthy
(
const
struct
director
*
d
,
const
struct
busyobj
*
bo
,
double
*
changed
)
{
struct
vbe_dir
*
vs
;
struct
backend
*
be
;
CHECK_OBJ_NOTNULL
(
d
,
DIRECTOR_MAGIC
);
CHECK_OBJ_ORNULL
(
bo
,
BUSYOBJ_MAGIC
);
CAST_OBJ_NOTNULL
(
vs
,
d
->
priv
,
VDI_SIMPLE_MAGIC
);
be
=
vs
->
backend
;
CHECK_OBJ_NOTNULL
(
be
,
BACKEND_MAGIC
);
...
...
bin/varnishd/cache/cache_director.c
View file @
418cea5d
...
...
@@ -145,12 +145,12 @@ VDI_GetFd(const struct director *d, struct worker *wrk, struct busyobj *bo)
*/
int
VDI_Healthy
(
const
struct
director
*
d
)
VDI_Healthy
(
const
struct
director
*
d
,
const
struct
busyobj
*
bo
)
{
CHECK_OBJ_NOTNULL
(
d
,
DIRECTOR_MAGIC
);
AN
(
d
->
healthy
);
return
(
d
->
healthy
(
d
,
NULL
));
return
(
d
->
healthy
(
d
,
bo
,
NULL
));
}
/* Get suckaddr ------------------------------------------------------*/
...
...
bin/varnishd/cache/cache_director.h
View file @
418cea5d
...
...
@@ -43,7 +43,8 @@
*/
typedef
int
vdi_getfd_f
(
const
struct
director
*
,
struct
busyobj
*
);
typedef
unsigned
vdi_healthy_f
(
const
struct
director
*
,
double
*
changed
);
typedef
unsigned
vdi_healthy_f
(
const
struct
director
*
,
const
struct
busyobj
*
,
double
*
changed
);
typedef
const
struct
director
*
vdi_resolve_f
(
const
struct
director
*
,
struct
worker
*
,
struct
busyobj
*
);
typedef
int
vdi_gethdrs_f
(
const
struct
director
*
,
struct
worker
*
,
...
...
@@ -77,7 +78,7 @@ int VDI_GetBody(const struct director *d, struct worker *wrk,
void
VDI_Finish
(
const
struct
director
*
d
,
struct
worker
*
wrk
,
struct
busyobj
*
bo
);
int
VDI_GetFd
(
const
struct
director
*
d
,
struct
worker
*
wrk
,
struct
busyobj
*
);
int
VDI_Healthy
(
const
struct
director
*
);
int
VDI_Healthy
(
const
struct
director
*
,
const
struct
busyobj
*
);
struct
suckaddr
*
VDI_Suckaddr
(
const
struct
director
*
d
,
struct
worker
*
wrk
,
struct
busyobj
*
bo
);
void
VDI_AddHostHeader
(
struct
http
*
to
,
const
struct
vbc
*
vbc
);
...
...
lib/libvmod_directors/fall_back.c
View file @
418cea5d
...
...
@@ -45,12 +45,13 @@ struct vmod_directors_fallback {
};
static
unsigned
__match_proto__
(
vdi_healthy
)
vmod_fallback_healthy
(
const
struct
director
*
dir
,
double
*
changed
)
vmod_fallback_healthy
(
const
struct
director
*
dir
,
const
struct
busyobj
*
bo
,
double
*
changed
)
{
struct
vmod_directors_fallback
*
rr
;
CAST_OBJ_NOTNULL
(
rr
,
dir
->
priv
,
VMOD_DIRECTORS_FALLBACK_MAGIC
);
return
(
vdir_any_healthy
(
rr
->
vd
,
changed
));
return
(
vdir_any_healthy
(
rr
->
vd
,
bo
,
changed
));
}
static
const
struct
director
*
__match_proto__
(
vdi_resolve_f
)
...
...
@@ -69,7 +70,7 @@ vmod_fallback_resolve(const struct director *dir, struct worker *wrk,
for
(
u
=
0
;
u
<
rr
->
vd
->
n_backend
;
u
++
)
{
be
=
rr
->
vd
->
backend
[
u
];
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
if
(
be
->
healthy
(
be
,
NULL
))
if
(
be
->
healthy
(
be
,
bo
,
NULL
))
break
;
}
vdir_unlock
(
rr
->
vd
);
...
...
lib/libvmod_directors/random.c
View file @
418cea5d
...
...
@@ -50,12 +50,13 @@ struct vmod_directors_random {
};
static
unsigned
__match_proto__
(
vdi_healthy
)
vmod_random_healthy
(
const
struct
director
*
dir
,
double
*
changed
)
vmod_random_healthy
(
const
struct
director
*
dir
,
const
struct
busyobj
*
bo
,
double
*
changed
)
{
struct
vmod_directors_random
*
rr
;
CAST_OBJ_NOTNULL
(
rr
,
dir
->
priv
,
VMOD_DIRECTORS_RANDOM_MAGIC
);
return
(
vdir_any_healthy
(
rr
->
vd
,
changed
));
return
(
vdir_any_healthy
(
rr
->
vd
,
bo
,
changed
));
}
static
const
struct
director
*
__match_proto__
(
vdi_resolve_f
)
...
...
lib/libvmod_directors/round_robin.c
View file @
418cea5d
...
...
@@ -46,12 +46,13 @@ struct vmod_directors_round_robin {
};
static
unsigned
__match_proto__
(
vdi_healthy
)
vmod_rr_healthy
(
const
struct
director
*
dir
,
double
*
changed
)
vmod_rr_healthy
(
const
struct
director
*
dir
,
const
struct
busyobj
*
bo
,
double
*
changed
)
{
struct
vmod_directors_round_robin
*
rr
;
CAST_OBJ_NOTNULL
(
rr
,
dir
->
priv
,
VMOD_DIRECTORS_ROUND_ROBIN_MAGIC
);
return
(
vdir_any_healthy
(
rr
->
vd
,
changed
));
return
(
vdir_any_healthy
(
rr
->
vd
,
bo
,
changed
));
}
static
const
struct
director
*
__match_proto__
(
vdi_resolve_f
)
...
...
@@ -72,7 +73,7 @@ vmod_rr_resolve(const struct director *dir, struct worker *wrk,
be
=
rr
->
vd
->
backend
[
rr
->
nxt
];
rr
->
nxt
++
;
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
if
(
be
->
healthy
(
be
,
NULL
))
if
(
be
->
healthy
(
be
,
bo
,
NULL
))
break
;
}
vdir_unlock
(
rr
->
vd
);
...
...
lib/libvmod_directors/vdir.c
View file @
418cea5d
...
...
@@ -129,7 +129,7 @@ vdir_add_backend(struct vdir *vd, VCL_BACKEND be, double weight)
}
unsigned
vdir_any_healthy
(
struct
vdir
*
vd
,
double
*
changed
)
vdir_any_healthy
(
struct
vdir
*
vd
,
const
struct
busyobj
*
bo
,
double
*
changed
)
{
unsigned
retval
=
0
;
VCL_BACKEND
be
;
...
...
@@ -137,13 +137,14 @@ vdir_any_healthy(struct vdir *vd, double *changed)
double
c
;
CHECK_OBJ_NOTNULL
(
vd
,
VDIR_MAGIC
);
CHECK_OBJ_ORNULL
(
bo
,
BUSYOBJ_MAGIC
);
vdir_lock
(
vd
);
if
(
changed
!=
NULL
)
*
changed
=
0
;
for
(
u
=
0
;
u
<
vd
->
n_backend
;
u
++
)
{
be
=
vd
->
backend
[
u
];
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
retval
=
be
->
healthy
(
be
,
&
c
);
retval
=
be
->
healthy
(
be
,
bo
,
&
c
);
if
(
changed
!=
NULL
&&
c
>
*
changed
)
*
changed
=
c
;
if
(
retval
)
...
...
@@ -190,7 +191,7 @@ vdir_pick_be(struct vdir *vd, double w, unsigned nloops)
u
=
vdir_pick_by_weight
(
vd
,
w
*
tw
,
vbm
);
be
=
vd
->
backend
[
u
];
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
if
(
be
->
healthy
(
be
,
NULL
))
if
(
be
->
healthy
(
be
,
NULL
,
NULL
))
break
;
if
(
l
==
0
)
{
vbm
=
vd
->
vbm
;
...
...
lib/libvmod_directors/vdir.h
View file @
418cea5d
...
...
@@ -46,6 +46,7 @@ void vdir_new(struct vdir **vdp, const char *vcl_name, vdi_healthy_f *healthy,
void
vdir_delete
(
struct
vdir
**
vdp
);
void
vdir_lock
(
struct
vdir
*
vd
);
void
vdir_unlock
(
struct
vdir
*
vd
);
unsigned
vdir_add_backend
(
struct
vdir
*
vd
,
VCL_BACKEND
be
,
double
weight
);
unsigned
vdir_any_healthy
(
struct
vdir
*
vd
,
double
*
changed
);
VCL_BACKEND
vdir_pick_be
(
struct
vdir
*
vd
,
double
w
,
unsigned
nloops
);
unsigned
vdir_add_backend
(
struct
vdir
*
,
VCL_BACKEND
be
,
double
weight
);
unsigned
vdir_any_healthy
(
struct
vdir
*
,
const
struct
busyobj
*
,
double
*
changed
);
VCL_BACKEND
vdir_pick_be
(
struct
vdir
*
,
double
w
,
unsigned
nloops
);
lib/libvmod_std/vmod_std.c
View file @
418cea5d
...
...
@@ -193,7 +193,7 @@ vmod_healthy(VRT_CTX, VCL_BACKEND be)
if
(
be
==
NULL
)
return
(
0
);
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
return
(
VDI_Healthy
(
be
));
return
(
VDI_Healthy
(
be
,
ctx
->
bo
));
}
VCL_INT
__match_proto__
(
td_std_port
)
...
...
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