static void pan_req(const struct req *req) { const char *stp; VSB_printf(pan_vsp, "req = %p {\n", req); VSB_printf(pan_vsp, " sp = %p, vxid = %u,", req->sp, VXID(req->vsl->wid)); switch (req->req_step) { #define REQ_STEP(l, u, arg) case R_STP_##u: stp = "R_STP_" #u; break; #include "tbl/steps.h" #undef REQ_STEP default: stp = NULL; } if (stp != NULL) VSB_printf(pan_vsp, " step = %s,\n", stp); else VSB_printf(pan_vsp, " step = 0x%x,\n", req->req_step); VSB_printf(pan_vsp, " req_body = %s,\n", reqbody_status_2str(req->req_body_status)); if (req->err_code) VSB_printf(pan_vsp, " err_code = %d, err_reason = %s,\n", req->err_code, req->err_reason ? req->err_reason : "(null)"); VSB_printf(pan_vsp, " restarts = %d, esi_level = %d\n", req->restarts, req->esi_level); if (req->sp != NULL) pan_sess(req->sp); if (req->wrk != NULL) pan_wrk(req->wrk); pan_ws(req->ws, 2); pan_http("req", req->http, 2); if (req->resp->ws != NULL) pan_http("resp", req->resp, 2); if (VALID_OBJ(req->vcl, VCL_CONF_MAGIC)) pan_vcl(req->vcl); if (VALID_OBJ(req->obj, OBJECT_MAGIC)) { if (req->obj->objcore->busyobj != NULL) pan_busyobj(req->obj->objcore->busyobj); pan_object("REQ", req->obj); } VSB_printf(pan_vsp, "},\n"); }
static void pan_sess(const struct sess *sp) { const char *stp, *hand; VSB_printf(pan_vsp, "sp = %p {\n", sp); VSB_printf(pan_vsp, " fd = %d, id = %u, xid = %u,\n", sp->fd, sp->vsl_id & VSL_IDENTMASK, sp->req->xid); VSB_printf(pan_vsp, " client = %s %s,\n", sp->addr ? sp->addr : "?.?.?.?", sp->port ? sp->port : "?"); switch (sp->step) { #define STEP(l, u, arg) case STP_##u: stp = "STP_" #u; break; #include "tbl/steps.h" #undef STEP default: stp = NULL; } hand = VCL_Return_Name(sp->req->handling); if (stp != NULL) VSB_printf(pan_vsp, " step = %s,\n", stp); else VSB_printf(pan_vsp, " step = 0x%x,\n", sp->step); if (hand != NULL) VSB_printf(pan_vsp, " handling = %s,\n", hand); else VSB_printf(pan_vsp, " handling = 0x%x,\n", sp->req->handling); if (sp->req->err_code) VSB_printf(pan_vsp, " err_code = %d, err_reason = %s,\n", sp->req->err_code, sp->req->err_reason ? sp->req->err_reason : "(null)"); VSB_printf(pan_vsp, " restarts = %d, esi_level = %d\n", sp->req->restarts, sp->req->esi_level); if (sp->wrk->busyobj != NULL) pan_busyobj(sp->wrk->busyobj); pan_ws(sp->req->ws, 2); pan_http("req", sp->req->http, 2); if (sp->req->resp->ws != NULL) pan_http("resp", sp->req->resp, 4); if (sp->wrk != NULL) pan_wrk(sp->wrk); if (VALID_OBJ(sp->req->vcl, VCL_CONF_MAGIC)) pan_vcl(sp->req->vcl); if (VALID_OBJ(sp->req->obj, OBJECT_MAGIC)) pan_object(sp->req->obj); VSB_printf(pan_vsp, "},\n"); }
static void pan_busyobj(const struct busyobj *bo) { struct vfp_entry *vfe; VSB_printf(pan_vsp, " busyobj = %p {\n", bo); pan_ws(bo->ws, 4); VSB_printf(pan_vsp, " refcnt = %u\n", bo->refcount); VSB_printf(pan_vsp, " retries = %d\n", bo->retries); VSB_printf(pan_vsp, " failed = %d\n", bo->vfc->failed); VSB_printf(pan_vsp, " state = %d\n", (int)bo->state); #define BO_FLAG(l, r, w, d) if(bo->l) VSB_printf(pan_vsp, " is_" #l "\n"); #include "tbl/bo_flags.h" #undef BO_FLAG VSB_printf(pan_vsp, " bodystatus = %d (%s),\n", bo->htc.body_status, body_status_2str(bo->htc.body_status)); if (!VTAILQ_EMPTY(&bo->vfc->vfp)) { VSB_printf(pan_vsp, " filters ="); VTAILQ_FOREACH(vfe, &bo->vfc->vfp, list) VSB_printf(pan_vsp, " %s=%d", vfe->vfp->name, (int)vfe->closed); VSB_printf(pan_vsp, "\n"); } VSB_printf(pan_vsp, " },\n"); if (VALID_OBJ(bo->vbc, BACKEND_MAGIC)) pan_vbc(bo->vbc); if (bo->bereq->ws != NULL) pan_http("bereq", bo->bereq, 4); if (bo->beresp->ws != NULL) pan_http("beresp", bo->beresp, 4); pan_ws(bo->ws_o, 4); if (bo->fetch_objcore) pan_objcore("FETCH", bo->fetch_objcore); if (bo->fetch_obj) pan_object("FETCH", bo->fetch_obj); if (bo->ims_obj) pan_object("IMS", bo->ims_obj); VSB_printf(pan_vsp, " }\n"); }
static void pan_sess(const struct sess *sp) { const char *stp, *hand; VSB_printf(vsp, "sp = %p {\n", sp); VSB_printf(vsp, " fd = %d, id = %d, xid = %u,\n", sp->fd, sp->vsl_id & VSL_IDENTMASK, sp->xid); VSB_printf(vsp, " client = %s %s,\n", sp->addr ? sp->addr : "?.?.?.?", sp->port ? sp->port : "?"); switch (sp->step) { #define STEP(l, u) case STP_##u: stp = "STP_" #u; break; #include "tbl/steps.h" #undef STEP default: stp = NULL; } hand = VCC_Return_Name(sp->handling); if (stp != NULL) VSB_printf(vsp, " step = %s,\n", stp); else VSB_printf(vsp, " step = 0x%x,\n", sp->step); if (hand != NULL) VSB_printf(vsp, " handling = %s,\n", hand); else VSB_printf(vsp, " handling = 0x%x,\n", sp->handling); if (sp->err_code) VSB_printf(vsp, " err_code = %d, err_reason = %s,\n", sp->err_code, sp->err_reason ? sp->err_reason : "(null)"); VSB_printf(vsp, " restarts = %d, esi_level = %d\n", sp->restarts, sp->esi_level); VSB_printf(vsp, " flags = "); if (sp->wrk->do_stream) VSB_printf(vsp, " do_stream"); if (sp->wrk->do_gzip) VSB_printf(vsp, " do_gzip"); if (sp->wrk->do_gunzip) VSB_printf(vsp, " do_gunzip"); if (sp->wrk->do_esi) VSB_printf(vsp, " do_esi"); if (sp->wrk->do_close) VSB_printf(vsp, " do_close"); if (sp->wrk->is_gzip) VSB_printf(vsp, " is_gzip"); if (sp->wrk->is_gunzip) VSB_printf(vsp, " is_gunzip"); VSB_printf(vsp, "\n"); VSB_printf(vsp, " bodystatus = %d\n", sp->wrk->body_status); pan_ws(sp->ws, 2); pan_http("req", sp->http, 2); if (sp->wrk != NULL) pan_wrk(sp->wrk); if (VALID_OBJ(sp->vcl, VCL_CONF_MAGIC)) pan_vcl(sp->vcl); if (VALID_OBJ(sp->wrk->vbc, BACKEND_MAGIC)) pan_vbc(sp->wrk->vbc); if (VALID_OBJ(sp->obj, OBJECT_MAGIC)) pan_object(sp->obj); VSB_printf(vsp, "},\n"); }