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 /* DEBUG: section 73 HTTP Request */
11 #ifndef SQUID_REQUESTFLAGS_H_
12 #define SQUID_REQUESTFLAGS_H_
14 /** request-related flags
16 * Contains both flags marking a request's current state,
17 * and flags requesting some processing to be done at a later stage.
18 * TODO: better distinguish the two cases.
23 /** true if the response to this request may not be READ from cache */
25 /** request is if-modified-since */
27 /** request is authenticated */
29 /** do not use keytabs for peer Kerberos authentication */
30 bool auth_no_keytab
= false;
31 /** he response to the request may be stored in the cache */
32 bool cachable
= false;
33 /** the request can be forwarded through the hierarchy */
34 bool hierarchical
= false;
35 /** a loop was detected on this request */
36 bool loopDetected
= false;
37 /** the connection can be kept alive */
38 bool proxyKeepalive
= false;
39 /** content has expired, need to refresh it */
41 /** request was redirected by redirectors */
42 bool redirected
= false;
43 /** the requested object needs to be validated. See client_side_reply.cc
44 * for further information.
46 bool needValidation
= false;
47 /** whether we should fail if validation fails */
48 bool failOnValidationError
= false;
49 /** reply is stale if it is a hit */
50 bool staleIfHit
= false;
51 /** request to override no-cache directives
53 * always use noCacheHack() for reading.
54 * \note only meaningful if USE_HTTP_VIOLATIONS is defined at build time
56 bool nocacheHack
= false;
57 /** this request is accelerated (reverse-proxy) */
58 bool accelerated
= false;
59 /** if set, ignore Cache-Control headers */
60 bool ignoreCc
= false;
61 /** set for intercepted requests */
62 bool intercepted
= false;
63 /** set if the Host: header passed verification */
64 bool hostVerified
= false;
65 /// Set for requests handled by a "tproxy" port.
66 bool interceptTproxy
= false;
67 /// The client IP address should be spoofed when connecting to the web server.
68 /// This applies to TPROXY traffic that has not had spoofing disabled through
69 /// the spoof_client_ip squid.conf ACL.
70 bool spoofClientIp
= false;
71 /** set if the request is internal (\see ClientHttpRequest::flags.internal)*/
72 bool internal
= false;
73 /** if set, request to try very hard to keep the connection alive */
74 bool mustKeepalive
= false;
75 /** set if the request wants connection oriented auth */
76 bool connectionAuth
= false;
77 /** set if connection oriented auth can not be supported */
78 bool connectionAuthDisabled
= false;
79 // XXX This is set in clientCheckPinning but never tested
80 /** Request wants connection oriented auth */
81 bool connectionProxyAuth
= false;
82 /** set if the request was sent on a pinned connection */
84 /** Authentication was already sent upstream (e.g. due tcp-level auth) */
85 bool authSent
= false;
86 /** Deny direct forwarding unless overridden by always_direct
87 * Used in accelerator mode */
88 bool noDirect
= false;
89 /** Reply with chunked transfer encoding */
90 bool chunkedReply
= false;
91 /** set if stream error has occurred */
92 bool streamError
= false;
93 /** internal ssl-bump request to get server cert */
95 /** set if X-Forwarded-For checking is complete
97 * do not read directly; use doneFollowXff for reading
99 bool done_follow_x_forwarded_for
= false;
100 /** set for ssl-bumped requests */
101 bool sslBumped
= false;
102 /// carries a representation of an FTP command [received on ftp_port]
103 bool ftpNative
= false;
104 bool destinationIpLookedUp
= false;
105 /** request to reset the TCP stream */
106 bool resetTcp
= false;
107 /** set if the request is ranged */
108 bool isRanged
= false;
110 /// whether to forward via TunnelStateData (instead of FwdState)
111 bool forceTunnel
= false;
113 /** clone the flags, resetting to default those which are not safe in
114 * a related (e.g. ICAP-adapted) request.
116 RequestFlags
cloneAdaptationImmune() const;
118 // if FOLLOW_X_FORWARDED_FOR is not set, we always return "done".
119 bool doneFollowXff() const {
120 return done_follow_x_forwarded_for
|| !FOLLOW_X_FORWARDED_FOR
;
123 // if USE_HTTP_VIOLATIONS is not set, never allow this
124 bool noCacheHack() const {
125 return USE_HTTP_VIOLATIONS
&& nocacheHack
;
129 #endif /* SQUID_REQUESTFLAGS_H_ */