]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Kill old stale code dealing with deferred reads and delay pools.
authorhno <>
Sun, 10 Jun 2007 18:13:31 +0000 (18:13 +0000)
committerhno <>
Sun, 10 Jun 2007 18:13:31 +0000 (18:13 +0000)
Squid-3 already have a deferred read infrastructure dealing with
buffering and delay pools, taking filedescriptors in/out from the
active set when needed. The comm loops don't need to emulate this.

src/comm_poll.cc
src/comm_select.cc

index 421bc15f90b41c70f346c01e07bd513017068d44..9ec5290bcbbf11d25749f3e3c2b4df3bdcc505a2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_poll.cc,v 1.22 2007/06/10 11:02:23 hno Exp $
+ * $Id: comm_poll.cc,v 1.23 2007/06/10 12:13:31 hno Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -179,36 +179,6 @@ fdIsHttp(int fd)
     return 0;
 }
 
-#if DELAY_POOLS
-static int slowfdcnt = 0;
-static int slowfdarr[SQUID_MAXFD];
-
-static void
-commAddSlowFd(int fd)
-{
-    assert(slowfdcnt < SQUID_MAXFD);
-    slowfdarr[slowfdcnt++] = fd;
-}
-
-static int
-commGetSlowFd(void)
-{
-    int whichfd, retfd;
-
-    if (!slowfdcnt)
-        return -1;
-
-    whichfd = squid_random() % slowfdcnt;
-
-    retfd = slowfdarr[whichfd];
-
-    slowfdarr[whichfd] = slowfdarr[--slowfdcnt];
-
-    return retfd;
-}
-
-#endif
-
 static int
 comm_check_incoming_poll_handlers(int nfds, int *fds)
 {
@@ -354,10 +324,6 @@ comm_select(int msec)
 {
 
     struct pollfd pfds[SQUID_MAXFD];
-#if DELAY_POOLS
-
-    fd_set slowfds;
-#endif
 
     PF *hdl = NULL;
     int fd;
@@ -373,10 +339,6 @@ comm_select(int msec)
         double start;
         getCurrentTime();
         start = current_dtime;
-#if DELAY_POOLS
-
-        FD_ZERO(&slowfds);
-#endif
 
         if (commCheckICPIncoming)
             comm_poll_icp_incoming();
@@ -513,14 +475,6 @@ comm_select(int msec)
 
                 if (NULL == (hdl = F->read_handler))
                     (void) 0;
-
-#if DELAY_POOLS
-
-                else if (FD_ISSET(fd, &slowfds))
-                    commAddSlowFd(fd);
-
-#endif
-
                 else {
                     PROF_start(comm_read_handler);
                     F->read_handler = NULL;
@@ -600,30 +554,6 @@ comm_select(int msec)
         if (callhttp)
             comm_poll_http_incoming();
 
-#if DELAY_POOLS
-
-        while ((fd = commGetSlowFd()) != -1) {
-            fde *F = &fd_table[fd];
-            debugs(5, 6, "comm_select: slow FD " << fd << " selected for reading");
-
-            if ((hdl = F->read_handler)) {
-                F->read_handler = NULL;
-               F->flags.read_pending = 0;
-                hdl(fd, F->read_data);
-                statCounter.select_fds++;
-
-                if (commCheckICPIncoming)
-                    comm_poll_icp_incoming();
-
-                if (commCheckDNSIncoming)
-                    comm_poll_dns_incoming();
-
-                if (commCheckHTTPIncoming)
-                    comm_poll_http_incoming();
-            }
-        }
-
-#endif
         getCurrentTime();
 
         statCounter.select_time += (current_dtime - start);
index 4017cd29121e249b2cf33c44c0dace455c9dd251..64d90092e1a888f50589724a6a774942688ad792 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_select.cc,v 1.80 2007/06/10 11:02:23 hno Exp $
+ * $Id: comm_select.cc,v 1.81 2007/06/10 12:13:31 hno Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -191,36 +191,6 @@ fdIsHttp(int fd)
     return 0;
 }
 
-#if DELAY_POOLS
-static int slowfdcnt = 0;
-static int slowfdarr[SQUID_MAXFD];
-
-static void
-commAddSlowFd(int fd)
-{
-    assert(slowfdcnt < SQUID_MAXFD);
-    slowfdarr[slowfdcnt++] = fd;
-}
-
-static int
-commGetSlowFd(void)
-{
-    int whichfd, retfd;
-
-    if (!slowfdcnt)
-        return -1;
-
-    whichfd = squid_random() % slowfdcnt;
-
-    retfd = slowfdarr[whichfd];
-
-    slowfdarr[whichfd] = slowfdarr[--slowfdcnt];
-
-    return retfd;
-}
-
-#endif
-
 static int
 comm_check_incoming_select_handlers(int nfds, int *fds)
 {
@@ -362,10 +332,6 @@ comm_select(int msec)
     fd_set readfds;
     fd_set pendingfds;
     fd_set writefds;
-#if DELAY_POOLS
-
-    fd_set slowfds;
-#endif
 
     PF *hdl = NULL;
     int fd;
@@ -394,10 +360,6 @@ comm_select(int msec)
         double start;
         getCurrentTime();
         start = current_dtime;
-#if DELAY_POOLS
-
-        FD_ZERO(&slowfds);
-#endif
 
         if (commCheckICPIncoming)
             comm_select_icp_incoming();
@@ -558,14 +520,6 @@ comm_select(int msec)
 
                 if (NULL == (hdl = F->read_handler))
                     (void) 0;
-
-#if DELAY_POOLS
-
-                else if (FD_ISSET(fd, &slowfds))
-                    commAddSlowFd(fd);
-
-#endif
-
                 else {
                     F->read_handler = NULL;
                    F->flags.read_pending = 0;
@@ -656,31 +610,6 @@ comm_select(int msec)
         if (callhttp)
             comm_select_http_incoming();
 
-#if DELAY_POOLS
-
-        while ((fd = commGetSlowFd()) != -1) {
-            F = &fd_table[fd];
-            debugs(5, 6, "comm_select: slow FD " << fd << " selected for reading");
-
-            if ((hdl = F->read_handler)) {
-                F->read_handler = NULL;
-               F->flags.read_pending = 0;
-                commUpdateReadBits(fd, NULL);
-                hdl(fd, F->read_data);
-                statCounter.select_fds++;
-
-                if (commCheckICPIncoming)
-                    comm_select_icp_incoming();
-
-                if (commCheckDNSIncoming)
-                    comm_select_dns_incoming();
-
-                if (commCheckHTTPIncoming)
-                    comm_select_http_incoming();
-            }
-        }
-
-#endif
         getCurrentTime();
 
         statCounter.select_time += (current_dtime - start);