From c45b880105c5abda7a68962183401bd4ba115e50 Mon Sep 17 00:00:00 2001 From: des Date: Thu, 21 Feb 2008 20:55:08 +0000 Subject: [PATCH] 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 --- varnish-cache/bin/varnishd/cache_panic.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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); -- 2.39.5