r3480 - in trunk/varnish-cache: bin/varnishd lib/libvcl

phk at projects.linpro.no phk at projects.linpro.no
Sun Dec 21 11:55:53 CET 2008


Author: phk
Date: 2008-12-21 11:55:53 +0100 (Sun, 21 Dec 2008)
New Revision: 3480

Modified:
   trunk/varnish-cache/bin/varnishd/cache_vcl.c
   trunk/varnish-cache/lib/libvcl/vcc_compile.c
Log:
Make VCC_Return_Name() return lower case, and use it also for the SMH
logging.


Modified: trunk/varnish-cache/bin/varnishd/cache_vcl.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vcl.c	2008-12-21 10:47:09 UTC (rev 3479)
+++ trunk/varnish-cache/bin/varnishd/cache_vcl.c	2008-12-21 10:55:53 UTC (rev 3480)
@@ -46,6 +46,7 @@
 #include "shmlog.h"
 #include "vcl.h"
 #include "cache.h"
+#include "libvcl.h"
 
 struct vcls {
 	unsigned		magic;
@@ -299,21 +300,6 @@
 
 /*--------------------------------------------------------------------*/
 
-static const char *
-vcl_handlingname(unsigned u)
-{
-
-	switch (u) {
-#define VCL_RET_MAC(a, b, c,d)	case VCL_RET_##b: return(#a);
-#define VCL_RET_MAC_E(a, b, c,d)	case VCL_RET_##b: return(#a);
-#include "vcl_returns.h"
-#undef VCL_RET_MAC
-#undef VCL_RET_MAC_E
-	default:
-		return (NULL);
-	}
-}
-
 #define VCL_RET_MAC(l,u,b,n)
 
 #define VCL_MET_MAC(func, upper, bitmap)				\
@@ -325,7 +311,7 @@
 	sp->cur_method = VCL_MET_ ## upper;				\
 	WSP(sp, SLT_VCL_call, "%s", #func);				\
 	sp->vcl->func##_func(sp);					\
-	WSP(sp, SLT_VCL_return, "%s", vcl_handlingname(sp->handling));	\
+	WSP(sp, SLT_VCL_return, "%s", VCC_Return_Name(sp->handling));	\
 	sp->cur_method = 0;						\
 	assert(sp->handling & bitmap);					\
 	assert(!(sp->handling & ~bitmap));				\

Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.c	2008-12-21 10:47:09 UTC (rev 3479)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.c	2008-12-21 10:55:53 UTC (rev 3480)
@@ -670,8 +670,8 @@
 
 	switch (method) {
 	case 0:	return ("<none>");
-#define VCL_RET_MAC(l, u, b, i) case b: return(#u);
-#define VCL_RET_MAC_E(l, u, b, i) case b: return(#u);
+#define VCL_RET_MAC(l, u, b, i) case b: return(#l);
+#define VCL_RET_MAC_E(l, u, b, i) case b: return(#l);
 #include "vcl_returns.h"
 #undef VCL_RET_MAC_E
 #undef VCL_RET_MAC



More information about the varnish-commit mailing list