From: wessels <> Date: Sat, 9 May 1998 04:20:45 +0000 (+0000) Subject: fast select() timeouts for ASYNC_IO X-Git-Tag: SQUID_3_0_PRE1~3361 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc33131f52c9f63cd3b8152892986fc50a67ea67;p=thirdparty%2Fsquid.git fast select() timeouts for ASYNC_IO --- diff --git a/src/comm.cc b/src/comm.cc index 7aa82932ad..0d99b2cf8c 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,7 +1,7 @@ /* - * $Id: comm.cc,v 1.252 1998/04/24 07:09:31 wessels Exp $ + * $Id: comm.cc,v 1.253 1998/05/08 22:20:45 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1066,8 +1066,13 @@ comm_select(time_t sec) if (nfds == 0) return COMM_SHUTDOWN; for (;;) { - poll_time.tv_sec = sec > 0 ? 1 : 0; +#if USE_ASYNC_IO + poll_time.tv_sec = 0; + poll_time.tv_usec = sec > 0 ? 50000 : 0; /* 50 ms */ +#else + poll_time.tv_sec = sec > 0 ? 1 : 0; /* 1 sec */ poll_time.tv_usec = 0; +#endif num = select(maxfd, &readfds, &writefds, NULL, &poll_time); Counter.select_loops++; if (num >= 0)