Mailing List Archive

r2527 - trunk/varnish-cache/bin/varnishd
Author: des
Date: 2008-02-21 21:55:08 +0100 (Thu, 21 Feb 2008)
New Revision: 2527

Modified:
trunk/varnish-cache/bin/varnishd/cache_panic.c
Log:
Dump some information about the VCL configuration if we have one.


Modified: trunk/varnish-cache/bin/varnishd/cache_panic.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_panic.c 2008-02-21 20:50:16 UTC (rev 2526)
+++ trunk/varnish-cache/bin/varnishd/cache_panic.c 2008-02-21 20:55:08 UTC (rev 2527)
@@ -37,6 +37,7 @@
#include <stdlib.h>

#include "cache.h"
+#include "vcl.h"

#ifndef WITHOUT_ASSERTS

@@ -71,6 +72,20 @@
};
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 @@
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 @@
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);