Commit 82db9328 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make init an optional method for backends


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1962 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 7c4fe002
......@@ -249,12 +249,22 @@ VBE_UpdateHealth(struct sess *sp, struct vbe_conn *vc, int a)
/*--------------------------------------------------------------------*/
static void
VBE_AddBackendMethod(struct backend_method *bem)
{
if (bem->init != NULL)
bem->init();
}
/*--------------------------------------------------------------------*/
void
VBE_Init(void)
{
MTX_INIT(&VBE_mtx);
backend_method_simple.init();
backend_method_random.init();
backend_method_round_robin.init();
VBE_AddBackendMethod(&backend_method_simple);
VBE_AddBackendMethod(&backend_method_random);
VBE_AddBackendMethod(&backend_method_round_robin);
}
......@@ -347,14 +347,6 @@ bes_GetHostname(struct backend *b)
/*--------------------------------------------------------------------*/
static void
bes_Init(void)
{
}
/*--------------------------------------------------------------------*/
struct backend_method backend_method_simple = {
.name = "simple",
.getfd = bes_GetFd,
......@@ -362,7 +354,6 @@ struct backend_method backend_method_simple = {
.recycle = bes_RecycleFd,
.gethostname = bes_GetHostname,
.cleanup = bes_Cleanup,
.init = bes_Init
};
/*--------------------------------------------------------------------*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment