]> git.ipfire.org Git - thirdparty/squid.git/blob - src/RequestFlags.h
removed all RequestFlags setters/getters except for doneXff
[thirdparty/squid.git] / src / RequestFlags.h
1 #ifndef SQUID_REQUESTFLAGS_H_
2 #define SQUID_REQUESTFLAGS_H_
3 /*
4 * DEBUG: section 73 HTTP Request
5 * AUTHOR: Duane Wessels
6 *
7 * SQUID Web Proxy Cache http://www.squid-cache.org/
8 * ----------------------------------------------------------
9 *
10 * Squid is the result of efforts by numerous individuals from
11 * the Internet community; see the CONTRIBUTORS file for full
12 * details. Many organizations have provided support for Squid's
13 * development; see the SPONSORS file for full details. Squid is
14 * Copyrighted (C) 2001 by the Regents of the University of
15 * California; see the COPYRIGHT file for full details. Squid
16 * incorporates software developed and/or copyrighted by other
17 * sources; see the CREDITS file for full details.
18 *
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
28 *
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
32 *
33 */
34
35 class RequestFlags
36 {
37 public:
38 RequestFlags() {
39 memset(this,0,sizeof(RequestFlags));
40 }
41
42 bool nocache :1; ///< whether the response to this request may be READ from cache
43 bool ims :1;
44 bool auth :1;
45 bool cachable :1; ///< whether the response to thie request may be stored in the cache
46 bool hierarchical :1;
47 bool loopdetect :1;
48 bool proxy_keepalive :1;
49 bool proxying :1; /* this should be killed, also in httpstateflags */
50 bool refresh :1;
51 bool redirected :1;
52 bool need_validation :1;
53 bool fail_on_validation_err :1; ///< whether we should fail if validation fails
54 bool stale_if_hit :1; ///< reply is stale if it is a hit
55 #if USE_HTTP_VIOLATIONS
56 /* for changing/ignoring no-cache requests */
57 /* TODO: remove the conditional definition, move ifdef to setter */
58 bool nocache_hack :1;
59 #endif
60 bool accelerated :1;
61 bool ignore_cc :1;
62 bool intercepted :1; ///< intercepted request
63 bool hostVerified :1; ///< whether the Host: header passed verification
64 bool spoof_client_ip :1; /**< spoof client ip if possible */
65 bool internal :1;
66 bool internalclient :1;
67 bool must_keepalive :1;
68 bool connection_auth :1; /** Request wants connection oriented auth */
69 bool connection_auth_disabled :1; /** Connection oriented auth can not be supported */
70 bool connection_proxy_auth :1; /** Request wants connection oriented auth */
71 bool pinned :1; /* Request sent on a pinned connection */
72 bool canRePin :1; ///< OK to reopen a failed pinned connection
73 bool auth_sent :1; /* Authentication forwarded */
74 bool no_direct :1; /* Deny direct forwarding unless overriden by always_direct. Used in accelerator mode */
75 bool chunked_reply :1; /**< Reply with chunked transfer encoding */
76 bool stream_error :1; /**< Whether stream error has occured */
77 bool sslPeek :1; ///< internal ssl-bump request to get server cert
78 /* done_follow_x_forwarded_for set by default to the opposite of
79 * compilation option FOLLOW_X_FORWARDED_FOR (so that it returns
80 * always "done" if the build option is disabled.
81 */
82 bool done_follow_x_forwarded_for :1;
83 bool sslBumped_ :1; /**< ssl-bumped request*/
84 bool destinationIPLookedUp_:1;
85 bool resetTCP_:1; ///< request to reset the TCP stream
86 bool isRanged_ :1;
87
88 // When adding new flags, please update cloneAdaptationImmune() as needed.
89 // returns a partial copy of the flags that includes only those flags
90 // that are safe for a related (e.g., ICAP-adapted) request to inherit
91 RequestFlags cloneAdaptationImmune() const;
92
93 // if FOLLOW_X_FORWARDED_FOR is not set, we always return "done".
94 bool doneFollowXff() const {
95 return done_follow_x_forwarded_for || !FOLLOW_X_FORWARDED_FOR;
96 }
97 };
98
99 #endif /* SQUID_REQUESTFLAGS_H_ */