From: phk Date: Sat, 5 Aug 2006 12:20:13 +0000 (+0000) Subject: Remove unused "ip" from backend. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a4bbead2f2aea34b934c4049e9d759823e0c47c;p=varnish Remove unused "ip" from backend. Make VCL_Load static, and give it a NULL check. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@661 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index f3b48cba..665f1461 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -25,7 +25,6 @@ #define HTTP_HDR_RESPONSE 4 #define HTTP_HDR_FIRST 5 -struct event_base; struct cli; struct sbuf; struct sess; @@ -265,7 +264,6 @@ struct backend { const char *vcl_name; const char *hostname; const char *portname; - unsigned ip; struct addrinfo *addr; struct addrinfo *last_addr; @@ -397,7 +395,6 @@ void RES_WriteObj(struct sess *sp); void VCL_Init(void); void VCL_Rel(struct VCL_conf *vc); struct VCL_conf *VCL_Get(void); -int VCL_Load(const char *fn, const char *name, struct cli *cli); #define VCL_RET_MAC(l,u,b,n) #define VCL_MET_MAC(l,u,b) void VCL_##l##_method(struct sess *); diff --git a/varnish-cache/bin/varnishd/cache_vcl.c b/varnish-cache/bin/varnishd/cache_vcl.c index 02b23a0e..812a411a 100644 --- a/varnish-cache/bin/varnishd/cache_vcl.c +++ b/varnish-cache/bin/varnishd/cache_vcl.c @@ -92,7 +92,7 @@ vcl_find(const char *name) return (NULL); } -int +static int VCL_Load(const char *fn, const char *name, struct cli *cli) { struct vcls *vcl; @@ -191,6 +191,11 @@ cli_func_config_discard(struct cli *cli, char **av, void *priv) (void)av; (void)priv; vcl = vcl_find(av[2]); + if (vcl == NULL) { + cli_result(cli, CLIS_PARAM); + cli_out(cli, "VCL '%s' unknown", av[2]); + return; + } if (vcl->discard) { cli_result(cli, CLIS_PARAM); cli_out(cli, "VCL %s already discarded", av[2]);