r2513 - trunk/varnish-cache/bin/varnishd

des at projects.linpro.no des at projects.linpro.no
Mon Feb 18 18:04:30 CET 2008


Author: des
Date: 2008-02-18 18:04:30 +0100 (Mon, 18 Feb 2008)
New Revision: 2513

Modified:
   trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c
Log:
Move the assertions around; it is apparently possible to get a null event
on a session that no longer has the fd that the event was registered on.


Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c	2008-02-18 12:00:19 UTC (rev 2512)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c	2008-02-18 17:04:30 UTC (rev 2513)
@@ -219,14 +219,14 @@
 		VSL(SLT_Debug, sp->id, "sp %p kev data %lu flags 0x%x%s",
 		    sp, (unsigned long)kp->data, kp->flags,
 		    (kp->flags & EV_EOF) ? " EOF" : "");
-	spassert(sp->id == kp->ident);
-	spassert(sp->fd == sp->id || sp->fd == -1);
 	if (sp->fd == -1 || kp->fflags == 0) {
 		if (params->diag_bitmap & 0x4)
 			VSL(SLT_Debug, sp->id, "KQ: got event 0x%04x on fd %d",
-			    kp->fflags, sp->fd);
+			    kp->fflags, kp->ident);
 		return;
 	}
+	spassert(sp->id == kp->ident);
+	spassert(sp->fd == sp->id);
 	if (kp->data > 0) {
 		i = HTC_Rx(sp->htc);
 		if (i == 0)




More information about the varnish-commit mailing list