Commit 2c128ca1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Move the panic-dump of VCL's to cache_vcl.c so cache_panic.c doesn't

need to know what's inside.
parent 2006bd9d
......@@ -1066,6 +1066,7 @@ void VRY_Finish(struct req *req, enum vry_finish_flag);
/* cache_vcl.c */
void VCL_Init(void);
void VCL_Panic(struct vsb *, const struct VCL_conf *);
void VCL_Refresh(struct VCL_conf **vcc);
void VCL_Ref(struct VCL_conf *vcc);
void VCL_Rel(struct VCL_conf **vcc);
......
......@@ -45,7 +45,6 @@
#include "cache_backend.h"
#include "storage/storage.h"
#include "vcl.h"
#include "vcli_priv.h"
/*
......@@ -254,22 +253,6 @@ pan_objcore(const char *typ, const struct objcore *oc)
VSB_printf(pan_vsp, " }\n");
}
/*--------------------------------------------------------------------*/
static void
pan_vcl(const struct VCL_conf *vcl)
{
int i;
VSB_printf(pan_vsp, " vcl = {\n");
VSB_printf(pan_vsp, " srcname = {\n");
for (i = 0; i < vcl->nsrc; ++i)
VSB_printf(pan_vsp, " \"%s\",\n", vcl->srcname[i]);
VSB_printf(pan_vsp, " },\n");
VSB_printf(pan_vsp, " },\n");
}
/*--------------------------------------------------------------------*/
static void
......@@ -406,8 +389,7 @@ pan_req(const struct req *req)
if (req->resp->ws != NULL)
pan_http("resp", req->resp, 2);
if (VALID_OBJ(req->vcl, VCL_CONF_MAGIC))
pan_vcl(req->vcl);
VCL_Panic(pan_vsp, req->vcl);
if (req->objcore != NULL) {
pan_objcore("REQ", req->objcore);
......
......@@ -66,6 +66,24 @@ static struct vcl *vcl_active; /* protected by vcl_mtx */
/*--------------------------------------------------------------------*/
void
VCL_Panic(struct vsb *vsb, const struct VCL_conf *vcl)
{
int i;
AN(vsb);
if (vcl == NULL)
return;
VSB_printf(vsb, " vcl = {\n");
VSB_printf(vsb, " srcname = {\n");
for (i = 0; i < vcl->nsrc; ++i)
VSB_printf(vsb, " \"%s\",\n", vcl->srcname[i]);
VSB_printf(vsb, " },\n");
VSB_printf(vsb, " },\n");
}
/*--------------------------------------------------------------------*/
const char *
VCL_Return_Name(unsigned r)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment