r4061 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sat May 9 18:19:12 CEST 2009


Author: phk
Date: 2009-05-09 18:19:12 +0200 (Sat, 09 May 2009)
New Revision: 4061

Modified:
   trunk/varnish-cache/bin/varnishd/cache_panic.c
Log:
Spit out more information on panic



Modified: trunk/varnish-cache/bin/varnishd/cache_panic.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_panic.c	2009-05-09 15:54:08 UTC (rev 4060)
+++ trunk/varnish-cache/bin/varnishd/cache_panic.c	2009-05-09 16:19:12 UTC (rev 4061)
@@ -136,21 +136,21 @@
 /*--------------------------------------------------------------------*/
 
 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 @@
 	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 @@
 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 @@
 		    "  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);



More information about the varnish-commit mailing list