From: serassio <> Date: Sun, 17 Feb 2008 17:54:28 +0000 (+0000) Subject: Clean up of deferred reads and delay pools was not applied to comm_select_win32.cc X-Git-Tag: SQUID_3_0_STABLE2~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25ff32c14880bf526e2a08e1518c6ef3f30eefaf;p=thirdparty%2Fsquid.git Clean up of deferred reads and delay pools was not applied to comm_select_win32.cc --- diff --git a/src/comm_select_win32.cc b/src/comm_select_win32.cc index e925b874fc..7e0a9a65c8 100644 --- a/src/comm_select_win32.cc +++ b/src/comm_select_win32.cc @@ -1,6 +1,6 @@ /* - * $Id: comm_select_win32.cc,v 1.4 2007/04/30 16:56:09 wessels Exp $ + * $Id: comm_select_win32.cc,v 1.4.4.1 2008/02/17 10:54:28 serassio 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) { @@ -365,10 +335,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(); @@ -500,7 +462,7 @@ comm_select(int msec) getCurrentTime(); - debugs(5, num ? 5 : 8, "comm_select: " << num << "+" << pending << " FDs ready\n"); + debugs(5, num ? 5 : 8, "comm_select: " << num << "+" << pending << " FDs ready"); statHistCount(&statCounter.select_fds_hist, num); @@ -562,16 +524,9 @@ 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; commUpdateReadBits(fd, NULL); hdl(fd, F->read_data); statCounter.select_fds++; @@ -667,8 +622,6 @@ comm_select(int msec) if (commCheckHTTPIncoming) comm_select_http_incoming(); - - } } @@ -681,30 +634,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; - 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);