]> git.ipfire.org Git - thirdparty/squid.git/blame - src/http/StateFlags.h
Bug 5352: Do not get stuck when RESPMOD is slower than read(2) (#1777)
[thirdparty/squid.git] / src / http / StateFlags.h
CommitLineData
bad9c5e4 1/*
b8ae064d 2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
bad9c5e4
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
9#ifndef SQUID_SRC_HTTP_STATEFLAGS_H
10#define SQUID_SRC_HTTP_STATEFLAGS_H
11
12namespace Http
13{
14
15class StateFlags
16{
17public:
18 unsigned int front_end_https = 0; ///< send "Front-End-Https: On" header (off/on/auto=2)
1f482f82
AR
19
20 /// whether the Squid-sent request offers to keep the connection persistent
21 bool keepalive = false;
22
23 /// whether Squid should not keep the connection persistent despite offering
24 /// to do so previously (and setting the keepalive flag)
25 bool forceClose = false;
26
bad9c5e4 27 bool only_if_cached = false;
1c2b4465
CT
28
29 /// Whether we are processing an HTTP 1xx control message.
30 bool handling1xx = false;
31
32 /// Whether we received an HTTP 101 (Switching Protocols) control message.
33 /// Implies true handling1xx, but the serverSwitchedProtocols state is
34 /// permanent/final while handling of other control messages usually stops.
35 bool serverSwitchedProtocols = false;
36
bad9c5e4 37 bool headers_parsed = false;
f5e17947
CT
38
39 /// Whether the next TCP hop is a cache_peer, including originserver
40 bool peering = false;
41
42 /// Whether this request is being forwarded inside a CONNECT tunnel
43 /// through a [non-originserver] cache_peer; implies peering and toOrigin
44 bool tunneling = false;
45
46 /// Whether the next HTTP hop is an origin server, including an
47 /// originserver cache_peer. The three possible cases are:
48 /// -# a direct TCP/HTTP connection to an origin server,
49 /// -# a direct TCP/HTTP connection to an originserver cache_peer, and
50 /// -# a CONNECT tunnel through a [non-originserver] cache_peer [to an origin server]
51 /// Thus, toOrigin is false only when the HTTP request is sent over
52 /// a direct TCP/HTTP connection to a non-originserver cache_peer.
53 bool toOrigin = false;
54
55 /// Whether the next TCP/HTTP hop is an originserver cache_peer.
56 bool toOriginPeer() const { return toOrigin && peering && !tunneling; }
57
bad9c5e4
AJ
58 bool keepalive_broken = false;
59 bool abuse_detected = false;
60 bool request_sent = false;
bad9c5e4
AJ
61 bool chunked = false; ///< reading a chunked response; TODO: rename
62 bool chunked_request = false; ///< writing a chunked request
63 bool sentLastChunk = false; ///< do not try to write last-chunk again
64};
65
66} // namespace Http
67
68#endif /* SQUID_SRC_HTTP_STATEFLAGS_H */
69