]> err.no Git - varnish/commitdiff
Also accept deferred EBADF errors.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 20 Nov 2007 14:32:01 +0000 (14:32 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 20 Nov 2007 14:32:01 +0000 (14:32 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2269 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor_kqueue.c

index 7621c944c934ecb922dc9026999d03d0ff8a8769..128e79489af270f67ae400c89a4aaef47ade5a91 100644 (file)
@@ -148,13 +148,17 @@ vca_kq_sess(struct sess *sp, short arm)
                assert(i <= 0);
                if (i < 0) {
                        /* 
-                        * We do not push kevents into the kernel before passing the session off
-                        * to a worker thread, so by the time we get around to delete the event
-                        * the fd may be closed and we get an ENOENT back once we do flush.
-                        *
-                        * XXX: Can we get EBADF if the client closes during this window ?
+                        * We do not push kevents into the kernel before 
+                        * passing the session off to a worker thread, so
+                        * by the time we get around to delete the event
+                        * the fd may be closed and we get an ENOENT back
+                        * once we do flush.
+                        * We can get EBADF the same way if the client closes
+                        * on us.  In that case, we get no kevent on that
+                        * socket, but the TAILQ still has it, and it will
+                        * be GC'ed there after the timeout.
                         */
-                       assert(errno == ENOENT);
+                       assert(errno == ENOENT || errno == EBADF);
                }
                nki = 0;
        }