From ee7138a28e59d1bbf5fbbbf8b83ef18cf8c8817f Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 20 Sep 2007 07:19:34 +0000 Subject: [PATCH] Make updatehealth an optional method for backends git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1961 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_backend.c | 4 ++-- .../bin/varnishd/cache_backend_simple.c | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_backend.c b/varnish-cache/bin/varnishd/cache_backend.c index de25eb10..3d32ca28 100644 --- a/varnish-cache/bin/varnishd/cache_backend.c +++ b/varnish-cache/bin/varnishd/cache_backend.c @@ -242,8 +242,8 @@ VBE_UpdateHealth(struct sess *sp, struct vbe_conn *vc, int a) CHECK_OBJ_NOTNULL(vc->backend, BACKEND_MAGIC); b = vc->backend; AN(b->method); - AN(b->method->updatehealth); - b->method->updatehealth(sp, vc, a); + if(b->method->updatehealth != NULL) + b->method->updatehealth(sp, vc, a); CHECK_OBJ_NOTNULL(b, BACKEND_MAGIC); } diff --git a/varnish-cache/bin/varnishd/cache_backend_simple.c b/varnish-cache/bin/varnishd/cache_backend_simple.c index 1275ce9d..349cfc86 100644 --- a/varnish-cache/bin/varnishd/cache_backend_simple.c +++ b/varnish-cache/bin/varnishd/cache_backend_simple.c @@ -347,21 +347,6 @@ bes_GetHostname(struct backend *b) /*--------------------------------------------------------------------*/ -static void -bes_UpdateHealth(struct sess *sp, struct vbe_conn *vc, int a) -{ - (void)sp; - (void)vc; - (void)a; - - /* - * Not of any use for simple backend. The global health - * parameter of the backend should be enough. - */ -} - -/*--------------------------------------------------------------------*/ - static void bes_Init(void) { @@ -376,7 +361,6 @@ struct backend_method backend_method_simple = { .close = bes_ClosedFd, .recycle = bes_RecycleFd, .gethostname = bes_GetHostname, - .updatehealth = bes_UpdateHealth, .cleanup = bes_Cleanup, .init = bes_Init }; -- 2.39.5