/*
- * $Id: comm.cc,v 1.421 2006/08/12 01:43:11 robertc Exp $
+ * $Id: comm.cc,v 1.422 2006/09/02 10:39:53 adrian Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
int
CommSelectEngine::checkEvents(int timeout) {
+ static time_t last_timeout = 0;
+
+ /* No, this shouldn't be here. But it shouldn't be in each comm handler. -adrian */
+ if (squid_curtime > last_timeout) {
+ last_timeout = squid_curtime;
+ checkTimeouts();
+ }
+
switch (comm_select(timeout)) {
case COMM_OK:
/*
- * $Id: comm_epoll.cc,v 1.11 2006/05/29 21:44:18 robertc Exp $
+ * $Id: comm_epoll.cc,v 1.12 2006/09/02 10:39:53 adrian Exp $
*
* DEBUG: section 5 Socket functions
*
PF *hdl;
struct epoll_event *cevents;
- static time_t last_timeout = 0;
-
- if (squid_curtime > last_timeout) {
- last_timeout = squid_curtime;
- checkTimeouts();
- }
PROF_start(comm_check_incoming);
/*
- * $Id: comm_poll.cc,v 1.18 2006/08/12 01:43:11 robertc Exp $
+ * $Id: comm_poll.cc,v 1.19 2006/09/02 10:39:53 adrian Exp $
*
* DEBUG: section 5 Socket Functions
*
int num;
int callicp = 0, callhttp = 0;
int calldns = 0;
- static time_t last_timeout = 0;
double timeout = current_dtime + (msec / 1000.0);
do {
debug(5, num ? 5 : 8) ("comm_poll: %d+%ld FDs ready\n", num, npending);
statHistCount(&statCounter.select_fds_hist, num);
- /* Check timeout handlers ONCE each second. */
-
- if (squid_curtime > last_timeout) {
- last_timeout = squid_curtime;
- checkTimeouts();
- }
if (num == 0 && npending == 0)
continue;
/*
- * $Id: comm_select.cc,v 1.76 2006/05/29 00:15:02 robertc Exp $
+ * $Id: comm_select.cc,v 1.77 2006/09/02 10:39:53 adrian Exp $
*
* DEBUG: section 5 Socket Functions
*
fd_mask *fdsp;
fd_mask *pfdsp;
fd_mask tmask;
- static time_t last_timeout = 0;
struct timeval poll_time;
double timeout = current_dtime + (msec / 1000.0);
statHistCount(&statCounter.select_fds_hist, num);
- /* Check lifetime and timeout handlers ONCE each second.
- * Replaces brain-dead check every time through the loop! */
- if (squid_curtime > last_timeout) {
- last_timeout = squid_curtime;
- checkTimeouts();
- }
-
if (num == 0 && pending == 0)
continue;
/*
- * $Id: comm_select_win32.cc,v 1.1 2006/06/13 20:52:05 serassio Exp $
+ * $Id: comm_select_win32.cc,v 1.2 2006/09/02 10:39:53 adrian Exp $
*
* DEBUG: section 5 Socket Functions
*
int i;
#endif
-
- static time_t last_timeout = 0;
-
struct timeval poll_time;
double timeout = current_dtime + (msec / 1000.0);
fde *F;
statHistCount(&statCounter.select_fds_hist, num);
- /* Check lifetime and timeout handlers ONCE each second.
- * Replaces brain-dead check every time through the loop! */
- if (squid_curtime > last_timeout) {
- last_timeout = squid_curtime;
- checkTimeouts();
- }
-
if (num == 0 && pending == 0)
continue;