]> err.no Git - varnish/commitdiff
Move the assertions around; it is apparently possible to get a null event
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Feb 2008 17:04:30 +0000 (17:04 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Feb 2008 17:04:30 +0000 (17:04 +0000)
on a session that no longer has the fd that the event was registered on.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2513 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor_kqueue.c

index 11a8795d62e2b42f576242d6f90e6cd229a4247e..2852fc160646ca6cb59dc565009cabd18e56027a 100644 (file)
@@ -219,14 +219,14 @@ vca_kev(const struct kevent *kp)
                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)