/*
- * $Id: comm_select_win32.cc,v 1.4 2007/04/30 16:56:09 wessels Exp $
+ * $Id: comm_select_win32.cc,v 1.4.6.1 2008/02/17 11:01:02 serassio Exp $
*
* DEBUG: section 5 Socket Functions
*
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)
{
fd_set readfds;
fd_set pendingfds;
fd_set writefds;
-#if DELAY_POOLS
-
- fd_set slowfds;
-#endif
PF *hdl = NULL;
int fd;
double start;
getCurrentTime();
start = current_dtime;
-#if DELAY_POOLS
-
- FD_ZERO(&slowfds);
-#endif
if (commCheckICPIncoming)
comm_select_icp_incoming();
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);
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++;
if (commCheckHTTPIncoming)
comm_select_http_incoming();
-
-
}
}
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);