]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
fast select() timeouts for ASYNC_IO
authorwessels <>
Sat, 9 May 1998 04:20:45 +0000 (04:20 +0000)
committerwessels <>
Sat, 9 May 1998 04:20:45 +0000 (04:20 +0000)
src/comm.cc

index 7aa82932ad386e9c6ec3c327d10251555a7cf716..0d99b2cf8ce2b2b32c4ce6b3079128f106680d2d 100644 (file)
@@ -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)