Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
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
unique-xids
Commits
928dd021
Commit
928dd021
authored
Apr 29, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass the digest to the backend->healthy() check, rather than the req*
parent
95c563e5
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
26 additions
and
25 deletions
+26
-25
cache.h
bin/varnishd/cache/cache.h
+2
-2
cache_backend.c
bin/varnishd/cache/cache_backend.c
+8
-7
cache_backend.h
bin/varnishd/cache/cache_backend.h
+2
-2
cache_dir.c
bin/varnishd/cache/cache_dir.c
+1
-1
hash_slinger.h
bin/varnishd/hash/hash_slinger.h
+1
-1
fall_back.c
lib/libvmod_directors/fall_back.c
+3
-3
random.c
lib/libvmod_directors/random.c
+2
-2
round_robin.c
lib/libvmod_directors/round_robin.c
+3
-3
vdir.c
lib/libvmod_directors/vdir.c
+3
-3
vdir.h
lib/libvmod_directors/vdir.h
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
928dd021
...
...
@@ -516,7 +516,7 @@ struct busyobj {
struct
http
*
bereq
;
struct
http
*
beresp
;
struct
object
*
fetch_obj
;
u
nsigned
char
digest
[
DIGEST_LEN
];
u
int8_t
digest
[
DIGEST_LEN
];
struct
exp
exp
;
struct
http_conn
htc
;
...
...
@@ -615,7 +615,7 @@ struct req {
uint8_t
*
vary_l
;
uint8_t
*
vary_e
;
u
nsigned
char
digest
[
DIGEST_LEN
];
u
int8_t
digest
[
DIGEST_LEN
];
enum
sess_close
doclose
;
struct
exp
exp
;
...
...
bin/varnishd/cache/cache_backend.c
View file @
928dd021
...
...
@@ -42,6 +42,7 @@
#include "cache_backend.h"
#include "vrt.h"
#include "vtcp.h"
#include "vtim.h"
static
struct
mempool
*
vbcpool
;
...
...
@@ -264,7 +265,7 @@ VBE_AddTrouble(const struct busyobj *bo, double expires)
*/
static
unsigned
int
vbe_Healthy
(
const
struct
vdi_simple
*
vs
,
const
struct
req
*
req
)
vbe_Healthy
(
const
struct
vdi_simple
*
vs
,
const
uint8_t
*
digest
)
{
struct
trouble
*
tr
;
struct
trouble
*
tr2
;
...
...
@@ -274,7 +275,7 @@ vbe_Healthy(const struct vdi_simple *vs, const struct req *req)
VTAILQ_HEAD
(,
trouble
)
troublelist
;
double
now
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
digest
);
CHECK_OBJ_NOTNULL
(
vs
,
VDI_SIMPLE_MAGIC
);
backend
=
vs
->
backend
;
CHECK_OBJ_NOTNULL
(
backend
,
BACKEND_MAGIC
);
...
...
@@ -299,7 +300,7 @@ vbe_Healthy(const struct vdi_simple *vs, const struct req *req)
if
(
threshold
==
0
||
backend
->
n_trouble
==
0
)
return
(
1
);
now
=
req
->
t_req
;
now
=
VTIM_real
()
;
retval
=
1
;
VTAILQ_INIT
(
&
troublelist
);
...
...
@@ -314,7 +315,7 @@ vbe_Healthy(const struct vdi_simple *vs, const struct req *req)
continue
;
}
if
(
!
memcmp
(
tr
->
digest
,
req
->
digest
,
sizeof
tr
->
digest
))
{
if
(
!
memcmp
(
tr
->
digest
,
digest
,
sizeof
tr
->
digest
))
{
retval
=
0
;
break
;
}
...
...
@@ -382,7 +383,7 @@ vbe_GetVbe(struct req *req, struct vdi_simple *vs)
VBE_ReleaseConn
(
vc
);
}
if
(
!
vbe_Healthy
(
vs
,
req
))
{
if
(
!
vbe_Healthy
(
vs
,
req
->
digest
))
{
VSC_C_main
->
backend_unhealthy
++
;
return
(
NULL
);
}
...
...
@@ -472,13 +473,13 @@ vdi_simple_getfd(const struct director *d, struct req *req)
}
static
unsigned
vdi_simple_healthy
(
const
struct
director
*
d
,
const
struct
req
*
req
)
vdi_simple_healthy
(
const
struct
director
*
d
,
const
uint8_t
*
digest
)
{
struct
vdi_simple
*
vs
;
CHECK_OBJ_NOTNULL
(
d
,
DIRECTOR_MAGIC
);
CAST_OBJ_NOTNULL
(
vs
,
d
->
priv
,
VDI_SIMPLE_MAGIC
);
return
(
vbe_Healthy
(
vs
,
req
));
return
(
vbe_Healthy
(
vs
,
digest
));
}
static
void
...
...
bin/varnishd/cache/cache_backend.h
View file @
928dd021
...
...
@@ -77,7 +77,7 @@ struct vrt_backend_probe;
typedef
struct
vbc
*
vdi_getfd_f
(
const
struct
director
*
,
struct
req
*
);
typedef
void
vdi_fini_f
(
const
struct
director
*
);
typedef
unsigned
vdi_healthy
(
const
struct
director
*
,
const
struct
req
*
);
typedef
unsigned
vdi_healthy
(
const
struct
director
*
,
const
uint8_t
*
digest
);
struct
director
{
unsigned
magic
;
...
...
@@ -97,7 +97,7 @@ struct director {
struct
trouble
{
unsigned
magic
;
#define TROUBLE_MAGIC 0x4211ab21
u
nsigned
char
digest
[
DIGEST_LEN
];
u
int8_t
digest
[
DIGEST_LEN
];
double
timeout
;
VTAILQ_ENTRY
(
trouble
)
list
;
};
...
...
bin/varnishd/cache/cache_dir.c
View file @
928dd021
...
...
@@ -128,5 +128,5 @@ VDI_Healthy(const struct director *d, const struct req *req)
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
d
,
DIRECTOR_MAGIC
);
return
(
d
->
healthy
(
d
,
req
));
return
(
d
->
healthy
(
d
,
req
->
digest
));
}
bin/varnishd/hash/hash_slinger.h
View file @
928dd021
...
...
@@ -90,7 +90,7 @@ struct objhead {
int
refcnt
;
struct
lock
mtx
;
VTAILQ_HEAD
(,
objcore
)
objcs
;
u
nsigned
char
digest
[
DIGEST_LEN
];
u
int8_t
digest
[
DIGEST_LEN
];
struct
waitinglist
*
waitinglist
;
/*----------------------------------------------------
...
...
lib/libvmod_directors/fall_back.c
View file @
928dd021
...
...
@@ -45,12 +45,12 @@ struct vmod_directors_fallback {
};
static
unsigned
__match_proto__
(
vdi_healthy
)
vmod_rr_healthy
(
const
struct
director
*
dir
,
const
struct
req
*
req
)
vmod_rr_healthy
(
const
struct
director
*
dir
,
const
uint8_t
*
digest
)
{
struct
vmod_directors_fallback
*
rr
;
CAST_OBJ_NOTNULL
(
rr
,
dir
->
priv
,
VMOD_DIRECTORS_FALLBACK_MAGIC
);
return
(
vdir_any_healthy
(
rr
->
vd
,
req
));
return
(
vdir_any_healthy
(
rr
->
vd
,
digest
));
}
static
struct
vbc
*
__match_proto__
(
vdi_getfd_f
)
...
...
@@ -65,7 +65,7 @@ vmod_rr_getfd(const struct director *dir, struct req *req)
for
(
u
=
0
;
u
<
rr
->
vd
->
n_backend
;
u
++
)
{
be
=
rr
->
vd
->
backend
[
u
];
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
if
(
be
->
healthy
(
be
,
req
))
if
(
be
->
healthy
(
be
,
req
->
digest
))
break
;
}
vdir_unlock
(
rr
->
vd
);
...
...
lib/libvmod_directors/random.c
View file @
928dd021
...
...
@@ -50,12 +50,12 @@ struct vmod_directors_random {
};
static
unsigned
__match_proto__
(
vdi_healthy
)
vmod_rr_healthy
(
const
struct
director
*
dir
,
const
struct
req
*
req
)
vmod_rr_healthy
(
const
struct
director
*
dir
,
const
uint8_t
*
digest
)
{
struct
vmod_directors_random
*
rr
;
CAST_OBJ_NOTNULL
(
rr
,
dir
->
priv
,
VMOD_DIRECTORS_RANDOM_MAGIC
);
return
(
vdir_any_healthy
(
rr
->
vd
,
req
));
return
(
vdir_any_healthy
(
rr
->
vd
,
digest
));
}
static
struct
vbc
*
__match_proto__
(
vdi_getfd_f
)
...
...
lib/libvmod_directors/round_robin.c
View file @
928dd021
...
...
@@ -46,12 +46,12 @@ struct vmod_directors_round_robin {
};
static
unsigned
__match_proto__
(
vdi_healthy
)
vmod_rr_healthy
(
const
struct
director
*
dir
,
const
struct
req
*
req
)
vmod_rr_healthy
(
const
struct
director
*
dir
,
const
uint8_t
*
digest
)
{
struct
vmod_directors_round_robin
*
rr
;
CAST_OBJ_NOTNULL
(
rr
,
dir
->
priv
,
VMOD_DIRECTORS_ROUND_ROBIN_MAGIC
);
return
(
vdir_any_healthy
(
rr
->
vd
,
req
));
return
(
vdir_any_healthy
(
rr
->
vd
,
digest
));
}
static
struct
vbc
*
__match_proto__
(
vdi_getfd_f
)
...
...
@@ -68,7 +68,7 @@ vmod_rr_getfd(const struct director *dir, struct req *req)
be
=
rr
->
vd
->
backend
[
rr
->
nxt
];
rr
->
nxt
++
;
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
if
(
be
->
healthy
(
be
,
req
))
if
(
be
->
healthy
(
be
,
req
->
digest
))
break
;
}
vdir_unlock
(
rr
->
vd
);
...
...
lib/libvmod_directors/vdir.c
View file @
928dd021
...
...
@@ -128,7 +128,7 @@ vdir_add_backend(struct vdir *vd, VCL_BACKEND be, double weight)
}
unsigned
vdir_any_healthy
(
struct
vdir
*
vd
,
const
struct
req
*
req
)
vdir_any_healthy
(
struct
vdir
*
vd
,
const
uint8_t
*
digest
)
{
unsigned
retval
=
0
;
VCL_BACKEND
be
;
...
...
@@ -139,7 +139,7 @@ vdir_any_healthy(struct vdir *vd, const struct req *req)
for
(
u
=
0
;
u
<
vd
->
n_backend
;
u
++
)
{
be
=
vd
->
backend
[
u
];
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
if
(
be
->
healthy
(
be
,
req
))
{
if
(
be
->
healthy
(
be
,
digest
))
{
retval
=
1
;
break
;
}
...
...
@@ -185,7 +185,7 @@ vdir_pick_be(struct vdir *vd, const struct req *req, 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
,
req
))
if
(
be
->
healthy
(
be
,
req
->
digest
))
break
;
if
(
l
==
0
)
{
vbm
=
vd
->
vbm
;
...
...
lib/libvmod_directors/vdir.h
View file @
928dd021
...
...
@@ -47,6 +47,6 @@ 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
,
const
struct
req
*
);
unsigned
vdir_any_healthy
(
struct
vdir
*
vd
,
const
uint8_t
*
digest
);
VCL_BACKEND
vdir_pick_be
(
struct
vdir
*
vd
,
const
struct
req
*
req
,
double
w
,
unsigned
nloops
);
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