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