Commit 52373d96 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Spit out more information on panic



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4061 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 677faa4e
......@@ -136,21 +136,21 @@ pan_storage(const struct storage *st)
/*--------------------------------------------------------------------*/
static void
pan_http(const struct http *h)
pan_http(const char *id, const struct http *h, int indent)
{
int i;
vsb_printf(vsp, " http = {\n");
pan_ws(h->ws, 6);
if (h->nhd > HTTP_HDR_FIRST) {
vsb_printf(vsp, " hd = {\n");
for (i = HTTP_HDR_FIRST; i < h->nhd; ++i)
vsb_printf(vsp, " \"%.*s\",\n",
(int)(h->hd[i].e - h->hd[i].b),
h->hd[i].b);
vsb_printf(vsp, " },\n");
vsb_printf(vsp, "%*shttp[%s] = {\n", indent, "", id);
vsb_printf(vsp, "%*sws = %p[%s]\n", indent + 2, "",
h->ws, h->ws ? h->ws->id : "");
for (i = 0; i < h->nhd; ++i) {
if (h->hd[i].b == NULL && h->hd[i].e == NULL)
continue;
vsb_printf(vsp, "%*s\"%.*s\",\n", indent + 4, "",
(int)(h->hd[i].e - h->hd[i].b),
h->hd[i].b);
}
vsb_printf(vsp, " },\n");
vsb_printf(vsp, "%*s},\n", indent, "");
}
......@@ -164,7 +164,7 @@ pan_object(const struct object *o)
vsb_printf(vsp, " obj = %p {\n", o);
vsb_printf(vsp, " refcnt = %u, xid = %u,\n", o->refcnt, o->xid);
pan_ws(o->ws_o, 4);
pan_http(o->http);
pan_http("obj", o->http, 4);
vsb_printf(vsp, " len = %u,\n", o->len);
vsb_printf(vsp, " store = {\n");
VTAILQ_FOREACH(st, &o->store, list)
......@@ -195,7 +195,12 @@ static void
pan_wrk(const struct worker *wrk)
{
vsb_printf(vsp, " worker = %p {\n", wrk);
vsb_printf(vsp, " worker = %p {\n", wrk);
pan_ws(wrk->ws, 4);
if (wrk->bereq != NULL)
pan_http("bereq", wrk->bereq, 4);
if (wrk->beresp != NULL)
pan_http("beresp", wrk->beresp, 4);
vsb_printf(vsp, " },\n");
}
......@@ -234,7 +239,11 @@ pan_sess(const struct sess *sp)
" err_code = %d, err_reason = %s,\n", sp->err_code,
sp->err_reason ? sp->err_reason : "(null)");
vsb_printf(vsp, " restarts = %d, esis = %d\n",
sp->restarts, sp->esis);
pan_ws(sp->ws, 2);
pan_http("req", sp->http, 2);
if (sp->wrk != NULL)
pan_wrk(sp->wrk);
......
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