]> git.ipfire.org Git - thirdparty/squid.git/blob - src/http/StateFlags.h
c6f2fb0d2b986235c810a9a8d425816bca2ccee9
[thirdparty/squid.git] / src / http / StateFlags.h
1 /*
2 * Copyright (C) 1996-2019 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 #ifndef SQUID_SRC_HTTP_STATEFLAGS_H
10 #define SQUID_SRC_HTTP_STATEFLAGS_H
11
12 namespace Http
13 {
14
15 class StateFlags
16 {
17 public:
18 unsigned int front_end_https = 0; ///< send "Front-End-Https: On" header (off/on/auto=2)
19 bool keepalive = false; ///< whether to keep the connection persistent
20 bool only_if_cached = false;
21 bool handling1xx = false; ///< we are ignoring or forwarding 1xx response
22 bool headers_parsed = false;
23
24 /// Whether the next TCP hop is a cache_peer, including originserver
25 bool peering = false;
26
27 /// Whether this request is being forwarded inside a CONNECT tunnel
28 /// through a [non-originserver] cache_peer; implies peering and toOrigin
29 bool tunneling = false;
30
31 /// Whether the next HTTP hop is an origin server, including an
32 /// originserver cache_peer. The three possible cases are:
33 /// -# a direct TCP/HTTP connection to an origin server,
34 /// -# a direct TCP/HTTP connection to an originserver cache_peer, and
35 /// -# a CONNECT tunnel through a [non-originserver] cache_peer [to an origin server]
36 /// Thus, toOrigin is false only when the HTTP request is sent over
37 /// a direct TCP/HTTP connection to a non-originserver cache_peer.
38 bool toOrigin = false;
39
40 /// Whether the next TCP/HTTP hop is an originserver cache_peer.
41 bool toOriginPeer() const { return toOrigin && peering && !tunneling; }
42
43 bool keepalive_broken = false;
44 bool abuse_detected = false;
45 bool request_sent = false;
46 bool do_next_read = false;
47 bool chunked = false; ///< reading a chunked response; TODO: rename
48 bool chunked_request = false; ///< writing a chunked request
49 bool sentLastChunk = false; ///< do not try to write last-chunk again
50 };
51
52 } // namespace Http
53
54 #endif /* SQUID_SRC_HTTP_STATEFLAGS_H */
55