From: wessels <> Date: Fri, 26 Aug 2005 01:31:22 +0000 (+0000) Subject: Calculate loop_delay immediately before it is used. X-Git-Tag: SQUID_3_0_PRE4~669 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a774fd3ff570028036533fe21646fe24ed182eb4;p=thirdparty%2Fsquid.git Calculate loop_delay immediately before it is used. --- diff --git a/src/main.cc b/src/main.cc index de35d50527..f16f7b5959 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.412 2005/07/20 17:07:25 wessels Exp $ + * $Id: main.cc,v 1.413 2005/08/25 19:31:22 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -1146,10 +1146,6 @@ main(int argc, char **argv) } eventRun(); - int loop_delay = eventNextTime(); - - if (loop_delay < 0) - loop_delay = 0; /* Attempt any pending storedir IO */ Store::Root().callback(); @@ -1160,9 +1156,15 @@ main(int argc, char **argv) * resulting from the first call. These are usually * callbacks and should be dealt with immediately. */ + if (comm_iocallbackpending()) comm_calliocallback(); + int loop_delay = eventNextTime(); + + if (loop_delay < 0) + loop_delay = 0; + switch (comm_select(loop_delay)) { case COMM_OK: