From: hno <> Date: Sun, 10 Jun 2007 18:13:31 +0000 (+0000) Subject: Kill old stale code dealing with deferred reads and delay pools. X-Git-Tag: SQUID_3_0_PRE7~220 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=889579fe1cfe012c7f17b679b985e3dac0c24ec0;p=thirdparty%2Fsquid.git Kill old stale code dealing with deferred reads and delay pools. 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. --- diff --git a/src/comm_poll.cc b/src/comm_poll.cc index 421bc15f90..9ec5290bcb 100644 --- a/src/comm_poll.cc +++ b/src/comm_poll.cc @@ -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); diff --git a/src/comm_select.cc b/src/comm_select.cc index 4017cd2912..64d90092e1 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -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);