Commit 3d5911a0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Give panic access to the sessions transport protocol via the

session number.
parent 604d0fba
......@@ -638,7 +638,7 @@ XPORT_Init(void)
const struct transport *
XPORT_Find(const char *name)
{
struct transport *xp;
const struct transport *xp;
ASSERT_MGT();
......@@ -647,3 +647,14 @@ XPORT_Find(const char *name)
return (xp);
return (NULL);
}
const struct transport *
XPORT_ByNumber(uint16_t no)
{
const struct transport *xp;
VTAILQ_FOREACH(xp, &transports, list)
if (xp->number == no)
return (xp);
return (NULL);
}
......@@ -445,13 +445,16 @@ pan_sess(struct vsb *vsb, const struct sess *sp)
const char *stp;
const char *ci;
const char *cp;
const struct transport *xp;
VSB_printf(vsb, "sp = %p {\n", sp);
if (pan_already(vsb, sp))
return;
VSB_indent(vsb, 2);
VSB_printf(vsb, "fd = %d, vxid = %u\n",
sp->fd, VXID(sp->vxid));
xp = XPORT_ByNumber(sp->sattr[SA_TRANSPORT]);
VSB_printf(vsb, "fd = %d, vxid = %u, transport = %s\n",
sp->fd, VXID(sp->vxid),
xp == NULL ? "<none>" : xp->name);
ci = SES_Get_String_Attr(sp, SA_CLIENT_IP);
cp = SES_Get_String_Attr(sp, SA_CLIENT_PORT);
VSB_printf(vsb, "client = %s %s,\n", ci, cp);
......
......@@ -59,3 +59,5 @@ struct transport {
extern struct transport PROXY_transport;
extern struct transport HTTP1_transport;
const struct transport *XPORT_ByNumber(uint16_t no);
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