]> git.ipfire.org Git - thirdparty/squid.git/blob - src/comm/Loops.h
Merged from trunk rev.13445
[thirdparty/squid.git] / src / comm / Loops.h
1 #ifndef _SQUID_SRC_COMM_LOOPS_H
2 #define _SQUID_SRC_COMM_LOOPS_H
3
4 #include "comm/Flag.h"
5
6 // for PF
7 #include "typedefs.h"
8
9 /* Comm layer select loops API.
10 *
11 * These API functions must be implemented by all FD IO loops used by Squid.
12 * Defines are provided short-term for legacy code. These will disappear soon.
13 */
14
15 namespace Comm
16 {
17
18 /// Initialize the module on Squid startup
19 void SelectLoopInit(void);
20
21 /// Mark an FD to be watched for its IO status.
22 void SetSelect(int, unsigned int, PF *, void *, time_t);
23
24 /// reset/undo/unregister the watch for an FD which was set by Comm::SetSelect()
25 void ResetSelect(int);
26
27 /** Perform a select() or equivalent call.
28 * This is used by the main select loop engine to check for FD with IO available.
29 */
30 Comm::Flag DoSelect(int);
31
32 void QuickPollRequired(void);
33
34 /**
35 * Max number of UDP messages to receive per call to the UDP receive poller.
36 * This is a per-port limit for ICP/HTCP ports.
37 * DNS has a separate limit.
38 */
39 #if _SQUID_WINDOWS_
40 #define INCOMING_UDP_MAX 1
41 #else
42 #define INCOMING_UDP_MAX 15
43 #endif
44
45 /**
46 * Max number of DNS messages to receive per call to DNS read handler
47 */
48 #if _SQUID_WINDOWS_
49 #define INCOMING_DNS_MAX 1
50 #else
51 #define INCOMING_DNS_MAX 15
52 #endif
53
54 /**
55 * Max number of new TCP connections to accept per call to the TCP listener poller.
56 * This is a per-port limit for HTTP/HTTPS ports.
57 */
58 #if _SQUID_WINDOWS_
59 #define INCOMING_TCP_MAX 1
60 #else
61 #define INCOMING_TCP_MAX 10
62 #endif
63 #define INCOMING_TOTAL_MAX (INCOMING_TCP_MAX+INCOMING_UDP_MAX+INCOMING_DNS_MAX)
64
65 } // namespace Comm
66
67 #endif /* _SQUID_SRC_COMM_LOOPS_H */