From: des Date: Thu, 21 Feb 2008 20:55:08 +0000 (+0000) Subject: Dump some information about the VCL configuration if we have one. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c45b880105c5abda7a68962183401bd4ba115e50;p=varnish Dump some information about the VCL configuration if we have one. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2527 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_panic.c b/varnish-cache/bin/varnishd/cache_panic.c index 22dc6c8e..0b890c28 100644 --- a/varnish-cache/bin/varnishd/cache_panic.c +++ b/varnish-cache/bin/varnishd/cache_panic.c @@ -37,6 +37,7 @@ #include #include "cache.h" +#include "vcl.h" #ifndef WITHOUT_ASSERTS @@ -71,6 +72,20 @@ static const char *steps[] = { }; static int nsteps = sizeof steps / sizeof *steps; +/* dump a struct VCL_conf */ +static void +dump_vcl(const struct VCL_conf *vcl) +{ + int i; + + fp(" vcl = {\n"); + fp(" srcname = {\n"); + for (i = 0; i < vcl->nsrc; ++i) + fp(" \"%s\",\n", vcl->srcname[i]); + fp(" },\n"); + fp(" },\n"); +} + /* dump a struct storage */ static void dump_storage(const struct storage *st) @@ -160,6 +175,7 @@ dump_sess(const struct sess *sp) const struct backend *be = sp->backend; #endif const struct object *obj = sp->obj; + const struct VCL_conf *vcl = sp->vcl; fp("sp = %p {\n", sp); fp(" fd = %d, id = %d, xid = %u,\n", sp->fd, sp->id, sp->xid); @@ -174,6 +190,9 @@ dump_sess(const struct sess *sp) fp(" err_code = %d, err_reason = %s,\n", sp->err_code, sp->err_reason ? sp->err_reason : "(null)"); + if (VALID_OBJ(vcl, VCL_CONF_MAGIC)) + dump_vcl(vcl); + #if 0 if (VALID_OBJ(be, BACKEND_MAGIC)) dump_backend(be);