r5225 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Tue Sep 21 18:58:30 CEST 2010


Author: phk
Date: 2010-09-21 18:58:30 +0200 (Tue, 21 Sep 2010)
New Revision: 5225

Modified:
   trunk/varnish-cache/bin/varnishd/cache_session.c
Log:
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



Modified: trunk/varnish-cache/bin/varnishd/cache_session.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_session.c	2010-09-20 20:01:59 UTC (rev 5224)
+++ trunk/varnish-cache/bin/varnishd/cache_session.c	2010-09-21 16:58:30 UTC (rev 5225)
@@ -250,6 +250,7 @@
 {
 	struct acct *b = &sp->acct_ses;
 	struct sessmem *sm;
+	static char noaddr[] = "-";
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	sm = sp->mem;
@@ -260,6 +261,10 @@
 	VSC_main->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,




More information about the varnish-commit mailing list