]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/comm/Loops.h
64a083180d58d2636a6abbb4a2b931d5369a1309
2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
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.
9 #ifndef _SQUID_SRC_COMM_LOOPS_H
10 #define _SQUID_SRC_COMM_LOOPS_H
12 #include "comm/Flag.h"
13 #include "comm/forward.h"
16 /* Comm layer select loops API.
18 * These API functions must be implemented by all FD IO loops used by Squid.
19 * Defines are provided short-term for legacy code. These will disappear soon.
25 /// Initialize the module on Squid startup
26 void SelectLoopInit(void);
28 /// reset/undo/unregister the watch for an FD which was set by Comm::SetSelect()
32 SetSelect(fd
, COMM_SELECT_READ
|COMM_SELECT_WRITE
, nullptr, nullptr, 0);
35 /** Perform a select() or equivalent call.
36 * This is used by the main select loop engine to check for FD with IO available.
38 Comm::Flag
DoSelect(int);
40 void QuickPollRequired(void);
43 * Max number of UDP messages to receive per call to the UDP receive poller.
44 * This is a per-port limit for ICP/HTCP ports.
45 * DNS has a separate limit.
48 #define INCOMING_UDP_MAX 1
50 #define INCOMING_UDP_MAX 15
54 * Max number of DNS messages to receive per call to DNS read handler
57 #define INCOMING_DNS_MAX 1
59 #define INCOMING_DNS_MAX 15
63 * Max number of new TCP connections to accept per call to the TCP listener poller.
64 * This is a per-port limit for HTTP/HTTPS ports.
67 #define INCOMING_TCP_MAX 1
69 #define INCOMING_TCP_MAX 10
71 #define INCOMING_TOTAL_MAX (INCOMING_TCP_MAX+INCOMING_UDP_MAX+INCOMING_DNS_MAX)
75 #endif /* _SQUID_SRC_COMM_LOOPS_H */