Commit e171090e authored by Martin Blix Grydeland's avatar Martin Blix Grydeland Committed by Pål Hermunn Johansen

Add a SLT_BackendStart log tag, and log address and port on backend req

This log record is a counterpart to the SLT_ReqStart for backends, and
shows the socket endpoint we are talking to at the start of backend
requests. Today this information is only logged on opening a backend
connection (SLT_BackendOpen), and is thus not available on the backend
log transaction when on a reused backend connection.

We need this information to complete the backend view varnishncsa
extension.
parent d47a144a
......@@ -80,6 +80,8 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr,
ssize_t i;
struct http_conn *htc;
int do_chunked = 0;
char abuf[VTCP_ADDRBUFSIZE];
char pbuf[VTCP_PORTBUFSIZE];
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
......@@ -95,6 +97,9 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr,
do_chunked = 1;
}
VTCP_hisname(htc->fd, abuf, sizeof abuf, pbuf, sizeof pbuf);
VSLb(bo->vsl, SLT_BackendStart, "%s %s", abuf, pbuf);
(void)VTCP_blocking(htc->fd); /* XXX: we should timeout instead */
V1L_Reserve(wrk, wrk->aws, &htc->fd, bo->vsl, bo->t_prev);
*ctr += HTTP1_Write(wrk, hp, HTTP1_Req);
......
......@@ -522,5 +522,16 @@ SLTM(Witness, 0, "Lock order witness records",
"Diagnostic recording of locking order.\n"
)
SLTM(BackendStart, 0, "Backend request start",
"Start of backend processing. Logs the backend IP address and port"
" number.\n\n"
"The format is::\n\n"
"\t%s %s\n"
"\t| |\n"
"\t| +- Backend Port number\n"
"\t+---- Backend IP4/6 address\n"
"\n"
)
#undef NODEF_NOTICE
/*lint -restore */
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