ModSelectWin32.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 /* DEBUG: section 05 Socket Functions */
10 
11 #include "squid.h"
12 
13 #if USE_SELECT_WIN32
14 #include "anyp/PortCfg.h"
15 #include "comm/Connection.h"
16 #include "comm/Loops.h"
17 #include "fde.h"
18 #include "ICP.h"
19 #include "mgr/Registration.h"
20 #include "SquidTime.h"
21 #include "StatCounters.h"
22 #include "StatHist.h"
23 #include "Store.h"
24 
25 #include <cerrno>
26 
27 static int MAX_POLL_TIME = 1000; /* see also Comm::QuickPollRequired() */
28 
29 #ifndef howmany
30 #define howmany(x, y) (((x)+((y)-1))/(y))
31 #endif
32 #ifndef NBBY
33 #define NBBY 8
34 #endif
35 #define FD_MASK_BYTES sizeof(fd_mask)
36 #define FD_MASK_BITS (FD_MASK_BYTES*NBBY)
37 
38 /* STATIC */
39 static int examine_select(fd_set *, fd_set *);
40 static int fdIsTcpListener(int fd);
41 static int fdIsUdpListener(int fd);
42 static int fdIsDns(int fd);
44 static int comm_check_incoming_select_handlers(int nfds, int *fds);
45 static void comm_select_dns_incoming(void);
46 static void commUpdateReadBits(int fd, PF * handler);
47 static void commUpdateWriteBits(int fd, PF * handler);
48 
49 static struct timeval zero_tv;
50 static fd_set global_readfds;
51 static fd_set global_writefds;
52 static int nreadfds;
53 static int nwritefds;
54 
55 /*
56  * Automatic tuning for incoming requests:
57  *
58  * INCOMING sockets are the ICP and HTTP ports. We need to check these
59  * fairly regularly, but how often? When the load increases, we
60  * want to check the incoming sockets more often. If we have a lot
61  * of incoming ICP, then we need to check these sockets more than
62  * if we just have HTTP.
63  *
64  * The variables 'incoming_udp_interval' and 'incoming_tcp_interval'
65  * determine how many normal I/O events to process before checking
66  * incoming sockets again. Note we store the incoming_interval
67  * multipled by a factor of (2^INCOMING_FACTOR) to have some
68  * pseudo-floating point precision.
69  *
70  * The variable 'udp_io_events' and 'tcp_io_events' counts how many normal
71  * I/O events have been processed since the last check on the incoming
72  * sockets. When io_events > incoming_interval, its time to check incoming
73  * sockets.
74  *
75  * Every time we check incoming sockets, we count how many new messages
76  * or connections were processed. This is used to adjust the
77  * incoming_interval for the next iteration. The new incoming_interval
78  * is calculated as the current incoming_interval plus what we would
79  * like to see as an average number of events minus the number of
80  * events just processed.
81  *
82  * incoming_interval = incoming_interval + target_average - number_of_events_processed
83  *
84  * There are separate incoming_interval counters for DNS, UDP and TCP events
85  *
86  * You can see the current values of the incoming_interval's, as well as
87  * a histogram of 'incoming_events' by asking the cache manager
88  * for 'comm_incoming', e.g.:
89  *
90  * % ./client mgr:comm_incoming
91  *
92  * Caveats:
93  *
94  * - We have MAX_INCOMING_INTEGER as a magic upper limit on
95  * incoming_interval for both types of sockets. At the
96  * largest value the cache will effectively be idling.
97  *
98  * - The higher the INCOMING_FACTOR, the slower the algorithm will
99  * respond to load spikes/increases/decreases in demand. A value
100  * between 3 and 8 is recommended.
101  */
102 
103 #define MAX_INCOMING_INTEGER 256
104 #define INCOMING_FACTOR 5
105 #define MAX_INCOMING_INTERVAL (MAX_INCOMING_INTEGER << INCOMING_FACTOR)
106 static int udp_io_events = 0;
107 static int dns_io_events = 0;
108 static int tcp_io_events = 0;
112 #define commCheckUdpIncoming (++udp_io_events > (incoming_udp_interval>> INCOMING_FACTOR))
113 #define commCheckDnsIncoming (++dns_io_events > (incoming_dns_interval>> INCOMING_FACTOR))
114 #define commCheckTcpIncoming (++tcp_io_events > (incoming_tcp_interval>> INCOMING_FACTOR))
115 
116 void
117 Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout)
118 {
119  fde *F = &fd_table[fd];
120  assert(fd >= 0);
121  assert(F->flags.open || (!handler && !client_data && !timeout));
122  debugs(5, 5, HERE << "FD " << fd << ", type=" << type <<
123  ", handler=" << handler << ", client_data=" << client_data <<
124  ", timeout=" << timeout);
125 
126  if (type & COMM_SELECT_READ) {
127  F->read_handler = handler;
128  F->read_data = client_data;
129  commUpdateReadBits(fd, handler);
130  }
131 
132  if (type & COMM_SELECT_WRITE) {
133  F->write_handler = handler;
134  F->write_data = client_data;
135  commUpdateWriteBits(fd, handler);
136  }
137 
138  if (timeout)
139  F->timeout = squid_curtime + timeout;
140 }
141 
142 static int
144 {
145  if (icpIncomingConn != NULL && fd == icpIncomingConn->fd)
146  return 1;
147 
148  if (icpOutgoingConn != NULL && fd == icpOutgoingConn->fd)
149  return 1;
150 
151  return 0;
152 }
153 
154 static int
155 fdIsDns(int fd)
156 {
157  if (fd == DnsSocketA)
158  return 1;
159 
160  if (fd == DnsSocketB)
161  return 1;
162 
163  return 0;
164 }
165 
166 static int
168 {
169  for (AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
170  if (s->listenConn != NULL && s->listenConn->fd == fd)
171  return 1;
172  }
173 
174  return 0;
175 }
176 
177 static int
179 {
180  int i;
181  int fd;
182  int maxfd = 0;
183  PF *hdl = NULL;
184  fd_set read_mask;
185  fd_set write_mask;
186  FD_ZERO(&read_mask);
187  FD_ZERO(&write_mask);
189 
190  for (i = 0; i < nfds; ++i) {
191  fd = fds[i];
192 
193  if (fd_table[fd].read_handler) {
194  FD_SET(fd, &read_mask);
195 
196  if (fd > maxfd)
197  maxfd = fd;
198  }
199 
200  if (fd_table[fd].write_handler) {
201  FD_SET(fd, &write_mask);
202 
203  if (fd > maxfd)
204  maxfd = fd;
205  }
206  }
207 
208  if (maxfd++ == 0)
209  return -1;
210 
211  getCurrentTime();
212 
214 
215  if (select(maxfd, &read_mask, &write_mask, NULL, &zero_tv) < 1)
217 
218  for (i = 0; i < nfds; ++i) {
219  fd = fds[i];
220 
221  if (FD_ISSET(fd, &read_mask)) {
222  if ((hdl = fd_table[fd].read_handler) != NULL) {
223  fd_table[fd].read_handler = NULL;
225  hdl(fd, fd_table[fd].read_data);
226  } else {
227  debugs(5, DBG_IMPORTANT, "comm_select_incoming: FD " << fd << " NULL read handler");
228  }
229  }
230 
231  if (FD_ISSET(fd, &write_mask)) {
232  if ((hdl = fd_table[fd].write_handler) != NULL) {
233  fd_table[fd].write_handler = NULL;
235  hdl(fd, fd_table[fd].write_data);
236  } else {
237  debugs(5, DBG_IMPORTANT, "comm_select_incoming: FD " << fd << " NULL write handler");
238  }
239  }
240  }
241 
243 }
244 
245 static void
247 {
248  int nfds = 0;
249  int fds[2];
250  int nevents;
251  udp_io_events = 0;
252 
254  fds[nfds] = icpIncomingConn->fd;
255  ++nfds;
256  }
257 
259  fds[nfds] = icpOutgoingConn->fd;
260  ++nfds;
261  }
262 
263  if (nfds == 0)
264  return;
265 
266  nevents = comm_check_incoming_select_handlers(nfds, fds);
267 
268  incoming_udp_interval += Config.comm_incoming.udp.average - nevents;
269 
270  if (incoming_udp_interval < 0)
272 
275 
276  if (nevents > INCOMING_UDP_MAX)
277  nevents = INCOMING_UDP_MAX;
278 
280 }
281 
282 static void
284 {
285  int nfds = 0;
286  int fds[MAXTCPLISTENPORTS];
287  int nevents;
288  tcp_io_events = 0;
289 
290  // XXX: only poll sockets that won't be deferred. But how do we identify them?
291 
292  for (AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
293  if (Comm::IsConnOpen(s->listenConn)) {
294  fds[nfds] = s->listenConn->fd;
295  ++nfds;
296  }
297  }
298 
299  nevents = comm_check_incoming_select_handlers(nfds, fds);
300  incoming_tcp_interval += Config.comm_incoming.tcp.average - nevents;
301 
302  if (incoming_tcp_interval < 0)
304 
307 
308  if (nevents > INCOMING_TCP_MAX)
309  nevents = INCOMING_TCP_MAX;
310 
312 }
313 
314 #define DEBUG_FDBITS 0
315 /* Select on all sockets; call handlers for those that are ready. */
317 Comm::DoSelect(int msec)
318 {
319  fd_set readfds;
320  fd_set pendingfds;
321  fd_set writefds;
322 
323  PF *hdl = NULL;
324  int fd;
325  int maxfd;
326  int num;
327  int pending;
328  int calldns = 0, calludp = 0, calltcp = 0;
329  int j;
330 #if DEBUG_FDBITS
331 
332  int i;
333 #endif
334  struct timeval poll_time;
335  double timeout = current_dtime + (msec / 1000.0);
336  fde *F;
337 
338  int no_bits;
339  fd_set errfds;
340  FD_ZERO(&errfds);
341 
342  do {
343  double start;
344  getCurrentTime();
345  start = current_dtime;
346 
349 
352 
355 
356  calldns = calludp = calltcp = 0;
357 
358  maxfd = Biggest_FD + 1;
359 
360  memcpy(&readfds, &global_readfds, sizeof(global_readfds));
361 
362  memcpy(&writefds, &global_writefds, sizeof(global_writefds));
363 
364  memcpy(&errfds, &global_writefds, sizeof(global_writefds));
365 
366  /* remove stalled FDs, and deal with pending descriptors */
367  pending = 0;
368 
369  FD_ZERO(&pendingfds);
370 
371  for (j = 0; j < (int) readfds.fd_count; ++j) {
372  register int readfds_handle = readfds.fd_array[j];
373  no_bits = 1;
374 
375  for ( fd = Biggest_FD; fd; --fd ) {
376  if ( fd_table[fd].win32.handle == readfds_handle ) {
377  if (fd_table[fd].flags.open) {
378  no_bits = 0;
379  break;
380  }
381  }
382  }
383 
384  if (no_bits)
385  continue;
386 
387  if (FD_ISSET(fd, &readfds) && fd_table[fd].flags.read_pending) {
388  FD_SET(fd, &pendingfds);
389  ++pending;
390  }
391  }
392 
393 #if DEBUG_FDBITS
394  for (i = 0; i < maxfd; ++i) {
395  /* Check each open socket for a handler. */
396 
397  if (fd_table[i].read_handler) {
398  assert(FD_ISSET(i, readfds));
399  }
400 
401  if (fd_table[i].write_handler) {
402  assert(FD_ISSET(i, writefds));
403  }
404  }
405 
406 #endif
407  if (nreadfds + nwritefds == 0) {
409  return Comm::SHUTDOWN;
410  }
411 
412  if (msec > MAX_POLL_TIME)
413  msec = MAX_POLL_TIME;
414 
415  if (pending)
416  msec = 0;
417 
418  for (;;) {
419  poll_time.tv_sec = msec / 1000;
420  poll_time.tv_usec = (msec % 1000) * 1000;
422  num = select(maxfd, &readfds, &writefds, &errfds, &poll_time);
423  int xerrno = errno;
425 
426  if (num >= 0 || pending > 0)
427  break;
428 
429  if (ignoreErrno(xerrno))
430  break;
431 
432  debugs(5, DBG_CRITICAL, MYNAME << "WARNING: select failure: " << xstrerr(xerrno));
433 
434  examine_select(&readfds, &writefds);
435 
436  return Comm::COMM_ERROR;
437 
438  /* NOTREACHED */
439  }
440 
441  if (num < 0 && !pending)
442  continue;
443 
444  getCurrentTime();
445 
446  debugs(5, num ? 5 : 8, "comm_select: " << num << "+" << pending << " FDs ready");
447 
449 
450  if (num == 0 && pending == 0)
451  continue;
452 
453  /* Scan return fd masks for ready descriptors */
454  assert(readfds.fd_count <= (unsigned int) Biggest_FD);
455  assert(pendingfds.fd_count <= (unsigned int) Biggest_FD);
456 
457  for (j = 0; j < (int) readfds.fd_count; ++j) {
458  register int readfds_handle = readfds.fd_array[j];
459  register int pendingfds_handle = pendingfds.fd_array[j];
460  register int osfhandle;
461  no_bits = 1;
462 
463  for ( fd = Biggest_FD; fd; --fd ) {
464  osfhandle = fd_table[fd].win32.handle;
465 
466  if (( osfhandle == readfds_handle ) ||
467  ( osfhandle == pendingfds_handle )) {
468  if (fd_table[fd].flags.open) {
469  no_bits = 0;
470  break;
471  }
472  }
473  }
474 
475  if (no_bits)
476  continue;
477 
478 #if DEBUG_FDBITS
479 
480  debugs(5, 9, "FD " << fd << " bit set for reading");
481 
482  assert(FD_ISSET(fd, readfds));
483 
484 #endif
485 
486  if (fdIsUdpListener(fd)) {
487  calludp = 1;
488  continue;
489  }
490 
491  if (fdIsDns(fd)) {
492  calldns = 1;
493  continue;
494  }
495 
496  if (fdIsTcpListener(fd)) {
497  calltcp = 1;
498  continue;
499  }
500 
501  F = &fd_table[fd];
502  debugs(5, 6, "comm_select: FD " << fd << " ready for reading");
503 
504  if ((hdl = F->read_handler)) {
505  F->read_handler = NULL;
506  F->flags.read_pending = 0;
508  hdl(fd, F->read_data);
510 
513 
516 
519  }
520  }
521 
522  assert(errfds.fd_count <= (unsigned int) Biggest_FD);
523 
524  for (j = 0; j < (int) errfds.fd_count; ++j) {
525  register int errfds_handle = errfds.fd_array[j];
526 
527  for ( fd = Biggest_FD; fd; --fd ) {
528  if ( fd_table[fd].win32.handle == errfds_handle )
529  break;
530  }
531 
532  if (fd_table[fd].flags.open) {
533  F = &fd_table[fd];
534 
535  if ((hdl = F->write_handler)) {
536  F->write_handler = NULL;
538  hdl(fd, F->write_data);
540  }
541  }
542  }
543 
544  assert(writefds.fd_count <= (unsigned int) Biggest_FD);
545 
546  for (j = 0; j < (int) writefds.fd_count; ++j) {
547  register int writefds_handle = writefds.fd_array[j];
548  no_bits = 1;
549 
550  for ( fd = Biggest_FD; fd; --fd ) {
551  if ( fd_table[fd].win32.handle == writefds_handle ) {
552  if (fd_table[fd].flags.open) {
553  no_bits = 0;
554  break;
555  }
556  }
557  }
558 
559  if (no_bits)
560  continue;
561 
562 #if DEBUG_FDBITS
563 
564  debugs(5, 9, "FD " << fd << " bit set for writing");
565 
566  assert(FD_ISSET(fd, writefds));
567 
568 #endif
569 
570  if (fdIsUdpListener(fd)) {
571  calludp = 1;
572  continue;
573  }
574 
575  if (fdIsDns(fd)) {
576  calldns = 1;
577  continue;
578  }
579 
580  if (fdIsTcpListener(fd)) {
581  calltcp = 1;
582  continue;
583  }
584 
585  F = &fd_table[fd];
586  debugs(5, 6, "comm_select: FD " << fd << " ready for writing");
587 
588  if ((hdl = F->write_handler)) {
589  F->write_handler = NULL;
591  hdl(fd, F->write_data);
593 
596 
599 
602  }
603  }
604 
605  if (calludp)
607 
608  if (calldns)
610 
611  if (calltcp)
613 
614  getCurrentTime();
615 
617 
618  return Comm::OK;
619  } while (timeout > current_dtime);
620  debugs(5, 8, "comm_select: time out: " << squid_curtime);
621 
622  return Comm::TIMEOUT;
623 }
624 
625 static void
627 {
628  int nfds = 0;
629  int fds[3];
630  int nevents;
631  dns_io_events = 0;
632 
633  if (DnsSocketA < 0 && DnsSocketB < 0)
634  return;
635 
636  if (DnsSocketA >= 0) {
637  fds[nfds] = DnsSocketA;
638  ++nfds;
639  }
640 
641  if (DnsSocketB >= 0) {
642  fds[nfds] = DnsSocketB;
643  ++nfds;
644  }
645 
646  nevents = comm_check_incoming_select_handlers(nfds, fds);
647 
648  if (nevents < 0)
649  return;
650 
651  incoming_dns_interval += Config.comm_incoming.dns.average - nevents;
652 
655 
658 
659  if (nevents > INCOMING_DNS_MAX)
660  nevents = INCOMING_DNS_MAX;
661 
663 }
664 
665 void
667 {
668  zero_tv.tv_sec = 0;
669  zero_tv.tv_usec = 0;
670  FD_ZERO(&global_readfds);
671  FD_ZERO(&global_writefds);
672  nreadfds = nwritefds = 0;
673 
674  Mgr::RegisterAction("comm_select_incoming",
675  "comm_incoming() stats",
676  commIncomingStats, 0, 1);
677 }
678 
679 /*
680  * examine_select - debug routine.
681  *
682  * I spend the day chasing this core dump that occurs when both the client
683  * and the server side of a cache fetch simultaneoulsy abort the
684  * connection. While I haven't really studied the code to figure out how
685  * it happens, the snippet below may prevent the cache from exitting:
686  *
687  * Call this from where the select loop fails.
688  */
689 static int
690 examine_select(fd_set * readfds, fd_set * writefds)
691 {
692  int fd = 0;
693  fd_set read_x;
694  fd_set write_x;
695 
696  struct timeval tv;
698  fde *F = NULL;
699 
700  struct stat sb;
701  debugs(5, DBG_CRITICAL, "examine_select: Examining open file descriptors...");
702 
703  for (fd = 0; fd < Squid_MaxFD; ++fd) {
704  FD_ZERO(&read_x);
705  FD_ZERO(&write_x);
706  tv.tv_sec = tv.tv_usec = 0;
707 
708  if (FD_ISSET(fd, readfds))
709  FD_SET(fd, &read_x);
710  else if (FD_ISSET(fd, writefds))
711  FD_SET(fd, &write_x);
712  else
713  continue;
714 
716  errno = 0;
717 
718  if (!fstat(fd, &sb)) {
719  debugs(5, 5, "FD " << fd << " is valid.");
720  continue;
721  }
722  int xerrno = errno;
723 
724  F = &fd_table[fd];
725  debugs(5, DBG_CRITICAL, "fstat(FD " << fd << "): " << xstrerr(xerrno));
726  debugs(5, DBG_CRITICAL, "WARNING: FD " << fd << " has handlers, but it's invalid.");
727  debugs(5, DBG_CRITICAL, "FD " << fd << " is a " << fdTypeStr[F->type] << " called '" << F->desc << "'");
728  debugs(5, DBG_CRITICAL, "tmout:" << F->timeoutHandler << " read:" << F->read_handler << " write:" << F->write_handler);
729 
730  for (ch = F->closeHandler; ch != NULL; ch = ch->Next())
731  debugs(5, DBG_CRITICAL, " close handler: " << ch);
732 
733  if (F->closeHandler != NULL) {
735  } else if (F->timeoutHandler != NULL) {
736  debugs(5, DBG_CRITICAL, "examine_select: Calling Timeout Handler");
738  }
739 
740  F->closeHandler = NULL;
741  F->timeoutHandler = NULL;
742  F->read_handler = NULL;
743  F->write_handler = NULL;
744  FD_CLR(fd, readfds);
745  FD_CLR(fd, writefds);
746  }
747 
748  return 0;
749 }
750 
751 static void
753 {
754  storeAppendPrintf(sentry, "Current incoming_udp_interval: %d\n",
756  storeAppendPrintf(sentry, "Current incoming_dns_interval: %d\n",
758  storeAppendPrintf(sentry, "Current incoming_tcp_interval: %d\n",
760  storeAppendPrintf(sentry, "\n");
761  storeAppendPrintf(sentry, "Histogram of events per incoming socket type\n");
762  storeAppendPrintf(sentry, "ICP Messages handled per comm_select_udp_incoming() call:\n");
764  storeAppendPrintf(sentry, "DNS Messages handled per comm_select_dns_incoming() call:\n");
766  storeAppendPrintf(sentry, "HTTP Messages handled per comm_select_tcp_incoming() call:\n");
768 }
769 
770 void
772 {
773  if (handler && !FD_ISSET(fd, &global_readfds)) {
774  FD_SET(fd, &global_readfds);
775  ++nreadfds;
776  } else if (!handler && FD_ISSET(fd, &global_readfds)) {
777  FD_CLR(fd, &global_readfds);
778  --nreadfds;
779  }
780 }
781 
782 void
784 {
785  if (handler && !FD_ISSET(fd, &global_writefds)) {
786  FD_SET(fd, &global_writefds);
787  ++nwritefds;
788  } else if (!handler && FD_ISSET(fd, &global_writefds)) {
789  FD_CLR(fd, &global_writefds);
790  --nwritefds;
791  }
792 }
793 
794 /* Called by async-io or diskd to speed up the polling */
795 void
797 {
798  MAX_POLL_TIME = 10;
799 }
800 
801 #endif /* USE_SELECT_WIN32 */
802 
#define INCOMING_FACTOR
void count(double val)
Definition: StatHist.cc:57
#define fd_table
Definition: fde.h:157
#define COMM_SELECT_READ
Definition: defines.h:36
StatCounters statCounter
Definition: StatCounters.cc:12
#define assert(EX)
Definition: assert.h:17
static int dns_io_events
int Squid_MaxFD
struct SquidConfig::@118::@125 tcp
static OBJH commIncomingStats
Definition: ModPoll.cc:58
Comm::ConnectionPointer icpIncomingConn
Definition: icp_v2.cc:102
void SelectLoopInit(void)
Initialize the module on Squid startup.
Definition: ModDevPoll.cc:178
struct fde::_fde_flags flags
static int nreadfds
static void comm_select_tcp_incoming(void)
StatHist comm_tcp_incoming
Definition: StatCounters.h:126
struct SquidConfig::@118::@125 udp
int type
Definition: errorpage.cc:78
#define commCheckUdpIncoming
int i
Definition: membanger.c:49
static int udp_io_events
int maxfd
Definition: tcp-banger2.c:130
Definition: Flag.h:16
static int fdIsUdpListener(int fd)
static int incoming_udp_interval
static fd_set global_writefds
unsigned int type
Definition: fde.h:83
#define DBG_CRITICAL
Definition: Debug.h:45
void OBJH(StoreEntry *)
Definition: forward.h:44
const char * fdTypeStr[]
Definition: fd.cc:40
AnyP::PortCfgPointer HttpPortList
list of Squid http(s)_port configured
Definition: PortCfg.cc:21
static void comm_select_udp_incoming(void)
static int nwritefds
PF * write_handler
Definition: fde.h:128
time_t squid_curtime
Definition: stub_time.cc:17
AsyncCall::Pointer closeHandler
Definition: fde.h:134
static int MAX_POLL_TIME
static void commUpdateReadBits(int fd, PF *handler)
int shutting_down
Definition: testAddress.cc:36
const char * xstrerr(int error)
Definition: xstrerror.cc:83
bool IsConnOpen(const Comm::ConnectionPointer &conn)
Definition: Connection.cc:24
Comm::Flag DoSelect(int)
Do poll and trigger callback functions as appropriate.
Definition: ModDevPoll.cc:313
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:124
struct StatCounters::@136 syscalls
PF * read_handler
Definition: fde.h:126
#define DBG_IMPORTANT
Definition: Debug.h:46
void SetSelect(int, unsigned int, PF *, void *, time_t)
Mark an FD to be watched for its IO status.
Definition: ModDevPoll.cc:225
void RegisterAction(char const *action, char const *desc, OBJH *handler, int pw_req_flag, int atomic)
Definition: Registration.cc:16
double select_time
Definition: StatCounters.h:120
int DnsSocketB
#define INCOMING_UDP_MAX
Definition: Loops.h:50
#define COMM_SELECT_WRITE
Definition: defines.h:37
static int examine_select(fd_set *, fd_set *)
StatHist comm_dns_incoming
Definition: StatCounters.h:125
void * write_data
Definition: fde.h:129
int incoming_sockets_accepted
int Biggest_FD
StatHist select_fds_hist
Definition: StatCounters.h:127
void PF(int, void *)
Definition: forward.h:18
void * read_data
Definition: fde.h:127
Comm::ConnectionPointer icpOutgoingConn
Definition: icp_v2.cc:104
static int fdIsDns(int fd)
unsigned long int select_loops
Definition: StatCounters.h:118
struct SquidConfig::@118 comm_incoming
#define MAXTCPLISTENPORTS
Definition: PortCfg.h:78
int DnsSocketA
static void handler(int signo)
Definition: purge.cc:860
std::ostream & HERE(std::ostream &s)
Definition: Debug.h:153
Flag
Definition: Flag.h:15
bool SIGHDLR int STUB void int
Definition: stub_tools.cc:68
int ignoreErrno(int ierrno)
Definition: comm.cc:1477
time_t getCurrentTime(void)
Get current time.
#define MAX_INCOMING_INTERVAL
#define commCheckDnsIncoming
static int incoming_tcp_interval
#define MYNAME
Definition: Debug.h:166
StatHist comm_udp_incoming
Definition: StatCounters.h:124
bool read_pending
Definition: fde.h:106
#define ScheduleCallHere(call)
Definition: AsyncCall.h:166
static int incoming_dns_interval
static struct timeval zero_tv
#define INCOMING_TCP_MAX
Definition: Loops.h:69
AsyncCall::Pointer timeoutHandler
Definition: fde.h:130
bool open
Definition: fde.h:96
double current_dtime
Definition: stub_time.cc:16
void commCallCloseHandlers(int fd)
Definition: comm.cc:719
static int fdIsTcpListener(int fd)
Definition: fde.h:49
static int comm_check_incoming_select_handlers(int nfds, int *fds)
time_t timeout
Definition: fde.h:131
static void comm_select_dns_incoming(void)
static fd_set global_readfds
static uint32 F(uint32 X, uint32 Y, uint32 Z)
Definition: md4.c:46
void dump(StoreEntry *sentry, StatHistBinDumper *bd) const
Definition: StatHist.cc:173
static void commUpdateWriteBits(int fd, PF *handler)
static int tcp_io_events
char desc[FD_DESC_SZ]
Definition: fde.h:93
StatHistBinDumper statHistIntDumper
Definition: StatHist.h:119
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:875
struct SquidConfig::@118::@125 dns
class SquidConfig Config
Definition: SquidConfig.cc:12
#define NULL
Definition: types.h:166
#define commCheckTcpIncoming
void QuickPollRequired(void)
Definition: ModDevPoll.cc:433
#define INCOMING_DNS_MAX
Definition: Loops.h:59
int nfds
Definition: tcp-banger2.c:129

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors