]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
Merge branch 'master' into timers
authorWilly Tarreau <w@1wt.eu>
Sun, 13 May 2007 12:51:41 +0000 (14:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 13 May 2007 12:52:43 +0000 (14:52 +0200)
1  2 
src/ev_sepoll.c

diff --cc src/ev_sepoll.c
index d2fcc7c7c26a58771ec61f5b4e988184a1993b42,de92c5d95bc9635574a9eba3e2457942c28d5328..516c0f592ada1fcc36d869d9ab7326aa87a663a4
@@@ -235,34 -240,10 +240,10 @@@ REGPRM1 static void __fd_clo(int fd
  /*
   * speculative epoll() poller
   */
 -REGPRM2 static void _do_poll(struct poller *p, int wait_time)
 +REGPRM2 static void _do_poll(struct poller *p, struct timeval *exp)
  {
        static unsigned int last_skipped;
-       int status;
+       int status, eo;
        int fd, opcode;
        int count;
        int spec_idx;
                        tv_now(&now);
                        return;
                }
+       }
+       last_skipped = 0;
+       if (nbspec || status) {
+               /* Maybe we have processed some events that we must report, or
+                * maybe we still have events in the spec list, so we must not
+                * wait in epoll() otherwise we will delay their delivery by
+                * the next timeout.
+                */
                wait_time = 0;
        }
-       last_skipped = 0;
 +      else {
 +              if (tv_isset(exp))
 +                      wait_time = tv_ms_remain(&now, exp);
 +              else
 +                      wait_time = -1;
 +      }
  
-       /* now let's wait for events */
+       /* now let's wait for real events */
        status = epoll_wait(epoll_fd, epoll_events, maxfd, wait_time);
        tv_now(&now);
  
        for (count = 0; count < status; count++) {