]> err.no Git - varnish/commitdiff
Try to optimize the poll acceptor by moving active entries to the
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 8 Oct 2007 19:15:41 +0000 (19:15 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 8 Oct 2007 19:15:41 +0000 (19:15 +0000)
front of the linked list where they will be found faster later on.

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

varnish-cache/bin/varnishd/cache_acceptor_poll.c

index 8a2587c88169b221214fb84b0ddf2a7cd809ef8a..7cb298032917e515442ea45c6a713ba21bf0491e 100644 (file)
@@ -28,9 +28,6 @@
  *
  * $Id$
  *
- * XXX: We need to pass sessions back into the event engine when they are
- * reused.  Not sure what the most efficient way is for that.  For now
- * write the session pointer to a pipe which the event engine monitors.
  */
 
 #if defined(HAVE_POLL)
@@ -132,9 +129,11 @@ vca_main(void *arg)
                        if (pollfd[fd].revents) {
                                v--;
                                i = HTC_Rx(sp->htc);
-                               if (i == 0)
-                                       continue;
                                VTAILQ_REMOVE(&sesshead, sp, list);
+                               if (i == 0) {
+                                       VTAILQ_INSERT_HEAD(&sesshead, sp, list);
+                                       continue;
+                               }
                                vca_unpoll(fd);
                                vca_handover(sp, i);
                                continue;