]> err.no Git - varnish/commitdiff
Remove unused "ip" from backend.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 5 Aug 2006 12:20:13 +0000 (12:20 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 5 Aug 2006 12:20:13 +0000 (12:20 +0000)
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

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_vcl.c

index f3b48cbaaaf2bde6898efa55f2f6adee8c49a2ae..665f14610f8c33bad0301970333e1000e18036d6 100644 (file)
@@ -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 *);
index 02b23a0ebc36e407391cfb74a466dccfb427b7ea..812a411ade9a09e57920dec297e6bdf426327f23 100644 (file)
@@ -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]);