From: phk Date: Fri, 18 Aug 2006 18:00:25 +0000 (+0000) Subject: Turn the "invcl" array into a flag array so we can put more stuff there. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74abe33764f239a690d95a35259b8862c0da9bbe;p=varnish Turn the "invcl" array into a flag array so we can put more stuff there. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@828 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishlog/varnishlog.c b/varnish-cache/bin/varnishlog/varnishlog.c index 6afae549..a079b0dd 100644 --- a/varnish-cache/bin/varnishlog/varnishlog.c +++ b/varnish-cache/bin/varnishlog/varnishlog.c @@ -23,7 +23,8 @@ static int bflag, cflag; /* 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 @@ h_order(void *priv, unsigned tag, unsigned fd, unsigned len, unsigned spec, cons } 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 @@ h_order(void *priv, unsigned tag, unsigned fd, unsigned len, unsigned spec, cons 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],