r828 - trunk/varnish-cache/bin/varnishlog

phk at projects.linpro.no phk at projects.linpro.no
Fri Aug 18 20:00:25 CEST 2006


Author: phk
Date: 2006-08-18 20:00:25 +0200 (Fri, 18 Aug 2006)
New Revision: 828

Modified:
   trunk/varnish-cache/bin/varnishlog/varnishlog.c
Log:
Turn the "invcl" array into a flag array so we can put more stuff there.


Modified: trunk/varnish-cache/bin/varnishlog/varnishlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishlog/varnishlog.c	2006-08-18 16:04:42 UTC (rev 827)
+++ trunk/varnish-cache/bin/varnishlog/varnishlog.c	2006-08-18 18:00:25 UTC (rev 828)
@@ -23,7 +23,8 @@
 /* Ordering-----------------------------------------------------------*/
 
 static struct vsb	*ob[65536];
-static unsigned char	invcl[65536];
+static unsigned char	flg[65536];
+#define F_INVCL		(1 << 0)
 
 static void
 clean_order(void)
@@ -58,7 +59,7 @@
 	}
 	switch (tag) {
 	case SLT_VCL_call:
-		invcl[fd] = 1;
+		flg[fd] |= F_INVCL;
 		vsb_printf(ob[fd], "%5d %-12s %c %.*s",
 		    fd, VSL_tags[tag],
 		    ((spec & VSL_S_CLIENT) ? 'c' : \
@@ -67,21 +68,18 @@
 		return (0);
 	case SLT_VCL_trace:
 	case SLT_VCL_return:
-		if (invcl[fd]) {
+		if (flg[fd] & F_INVCL) {
 			vsb_cat(ob[fd], " ");
 			vsb_bcat(ob[fd], ptr, len);
 			return (0);
 		}
 		break;
 	default:
-		if (invcl[fd])
-			vsb_cat(ob[fd], "\n");
-		invcl[fd] = 0;
 		break;
 	}
-	if (invcl[fd]) {
+	if (flg[fd] & F_INVCL) {
 		vsb_cat(ob[fd], "\n");
-		invcl[fd] = 0;
+		flg[fd] &= ~F_INVCL;
 	}
 	vsb_printf(ob[fd], "%5d %-12s %c %.*s\n",
 	    fd, VSL_tags[tag],




More information about the varnish-commit mailing list