/*
- * $Id: comm_poll.cc,v 1.13 2003/07/06 14:16:57 hno Exp $
+ * $Id: comm_poll.cc,v 1.14 2006/01/24 15:32:02 hno Exp $
*
* DEBUG: section 5 Socket Functions
*
static OBJH commIncomingStats;
static int comm_check_incoming_poll_handlers(int nfds, int *fds);
static void comm_poll_dns_incoming(void);
-static void commUpdateReadBits(int fd, PF * handler);
-static void commUpdateWriteBits(int fd, PF * handler);
-
-static fd_set global_readfds;
-static fd_set global_writefds;
-static int nreadfds;
-static int nwritefds;
/*
* Automatic tuning for incoming requests:
if (type & COMM_SELECT_READ) {
F->read_handler = handler;
F->read_data = client_data;
- commUpdateReadBits(fd, handler);
}
if (type & COMM_SELECT_WRITE) {
F->write_handler = handler;
F->write_data = client_data;
- commUpdateWriteBits(fd, handler);
}
if (timeout)
cachemgrRegister("comm_incoming",
"comm_incoming() stats",
commIncomingStats, 0, 1);
- FD_ZERO(&global_readfds);
- FD_ZERO(&global_writefds);
- nreadfds = nwritefds = 0;
}
statHistDump(&f->comm_http_incoming, sentry, statHistIntDumper);
}
-void
-commUpdateReadBits(int fd, PF * handler)
-{
- if (handler && !FD_ISSET(fd, &global_readfds)) {
- FD_SET(fd, &global_readfds);
- nreadfds++;
- } else if (!handler && FD_ISSET(fd, &global_readfds)) {
- FD_CLR(fd, &global_readfds);
- nreadfds--;
- }
-}
-
-void
-commUpdateWriteBits(int fd, PF * handler)
-{
- if (handler && !FD_ISSET(fd, &global_writefds)) {
- FD_SET(fd, &global_writefds);
- nwritefds++;
- } else if (!handler && FD_ISSET(fd, &global_writefds)) {
- FD_CLR(fd, &global_writefds);
- nwritefds--;
- }
-}
-
/* Called by async-io or diskd to speed up the polling */
void
comm_quick_poll_required(void)