r661 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sat Aug 5 14:20:13 CEST 2006


Author: phk
Date: 2006-08-05 14:20:13 +0200 (Sat, 05 Aug 2006)
New Revision: 661

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_vcl.c
Log:
Remove unused "ip" from backend.

Make VCL_Load static, and give it a NULL check.



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2006-08-05 12:19:33 UTC (rev 660)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2006-08-05 12:20:13 UTC (rev 661)
@@ -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 @@
 	const char		*vcl_name;
 	const char		*hostname;
 	const char		*portname;
-	unsigned		ip;
 
 	struct addrinfo		*addr;
 	struct addrinfo		*last_addr;
@@ -397,7 +395,6 @@
 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 *);

Modified: trunk/varnish-cache/bin/varnishd/cache_vcl.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vcl.c	2006-08-05 12:19:33 UTC (rev 660)
+++ trunk/varnish-cache/bin/varnishd/cache_vcl.c	2006-08-05 12:20:13 UTC (rev 661)
@@ -92,7 +92,7 @@
 	return (NULL);
 }
 
-int
+static int
 VCL_Load(const char *fn, const char *name, struct cli *cli)
 {
 	struct vcls *vcl;
@@ -191,6 +191,11 @@
 	(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]);




More information about the varnish-commit mailing list