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
#define HTTP_HDR_RESPONSE 4
#define HTTP_HDR_FIRST 5
-struct event_base;
struct cli;
struct sbuf;
struct sess;
const char *vcl_name;
const char *hostname;
const char *portname;
- unsigned ip;
struct addrinfo *addr;
struct addrinfo *last_addr;
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 *);
return (NULL);
}
-int
+static int
VCL_Load(const char *fn, const char *name, struct cli *cli)
{
struct vcls *vcl;
(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]);