]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
exit upon timeout
authorwessels <>
Thu, 17 Sep 1998 00:01:32 +0000 (00:01 +0000)
committerwessels <>
Thu, 17 Sep 1998 00:01:32 +0000 (00:01 +0000)
test-suite/tcp-banger3.c

index 5d00758eb51f58e541bcece3a5431e549a86d0d9..e34da01fbc13319d25f2925bebe20c12ae00b1e9 100644 (file)
@@ -322,15 +322,20 @@ parent_main_loop(void)
     char *url;
     fd_set R2;
     int x;
+    struct timeval to;
     FD_ZERO(&R1);
     for (;;) {
        while ((t = get_idle_thing()) && (url = parent_read_url()))
            dispatch(t, url);
        R2 = R1;
-       x = select(maxfd + 1, &R2, NULL, NULL, NULL);
+       to.tv_sec = 60;
+       to.tv_usec = 0;
+       x = select(maxfd + 1, &R2, NULL, NULL, &to);
        if (x < 0) {
            perror("select");
            continue;
+       } else if (x == 0) {
+           return;
        }
        for (t = things; t; t = t->next) {
            if (t->state != 1)