Commit ab2f004a authored by Tollef Fog Heen's avatar Tollef Fog Heen

Merge r5225: Report IP and port as "-" rather than passing NULL pointers

If we fail to enqueue a session because all threadpools are filled
we drop the session before we have rendered the clients address.

Report IP and port as "-" rather than passing NULL pointers, which
is not nice under any, and core dump solaris under some circumstances.

Fixes:  #598



git-svn-id: http://www.varnish-cache.org/svn/branches/2.1@5365 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent aa3371a6
......@@ -251,6 +251,7 @@ SES_Delete(struct sess *sp)
{
struct acct *b = &sp->acct_ses;
struct sessmem *sm;
static char noaddr[] = "-";
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
sm = sp->mem;
......@@ -261,6 +262,10 @@ SES_Delete(struct sess *sp)
VSL_stats->n_sess--; /* XXX: locking ? */
assert(!isnan(b->first));
assert(!isnan(sp->t_end));
if (sp->addr == NULL)
sp->addr = noaddr;
if (sp->port == NULL)
sp->port = noaddr;
VSL(SLT_StatSess, sp->id, "%s %s %.0f %ju %ju %ju %ju %ju %ju %ju",
sp->addr, sp->port, sp->t_end - b->first,
b->sess, b->req, b->pipe, b->pass,
......
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