MAX-328, Add session identifier to trace log entries. Session id is given to session in session_alloc and stored to thread's local storage variable when thread picks a new event from epoll_wait.

This commit is contained in:
VilhoRaatikka
2014-11-17 23:27:14 +02:00
parent 70eef7aaa8
commit a30fc0c787
6 changed files with 92 additions and 15 deletions

View File

@ -90,6 +90,21 @@ static int dcb_null_close(DCB *dcb);
static int dcb_null_auth(DCB *dcb, SERVER *server, SESSION *session, GWBUF *buf);
static int dcb_isvalid_nolock(DCB *dcb);
size_t dcb_get_session_id(
DCB* dcb)
{
size_t rval;
if (dcb != NULL && dcb->session != NULL)
{
rval = dcb->session->ses_id;
}
else
{
rval = 0;
}
return rval;
}
/**
* Return the pointer to the lsit of zombie DCB's
*