1 #ifndef SQUID_REQUESTFLAGS_H_
2 #define SQUID_REQUESTFLAGS_H_
4 * DEBUG: section 73 HTTP Request
5 * AUTHOR: Duane Wessels
7 * SQUID Web Proxy Cache http://www.squid-cache.org/
8 * ----------------------------------------------------------
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.
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.
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.
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.
35 /** request-related flags
37 * The bit-field contains both flags marking a request's current state,
38 * and flags requesting some processing to be done at a later stage.
39 * TODO: better distinguish the two cases.
45 memset(this,0,sizeof(RequestFlags
));
48 /** true if the response to this request may not be READ from cache */
50 /** request is if-modified-since */
52 /** request is authenticated */
54 /** he response to the request may be stored in the cache */
56 /** the request can be forwarded through the hierarchy */
58 /** a loop was detected on this request */
60 /** the connection can be kept alive */
61 bool proxyKeepalive
:1;
62 /* this should be killed, also in httpstateflags */
64 /** content has expired, need to refresh it */
66 /** request was redirected by redirectors */
68 /** the requested object needs to be validated. See client_side_reply.cc
69 * for further information.
71 bool needValidation
:1;
72 /** whether we should fail if validation fails */
73 bool failOnValidationError
:1;
74 /** reply is stale if it is a hit */
76 /** request to override no-cache directives
78 * always use noCacheHack() for reading.
79 * \note only meaningful if USE_HTTP_VIOLATIONS is defined at build time
82 /** this request is accelerated (reverse-proxy) */
84 /** if set, ignore Cache-Control headers */
86 /** set for intercepted requests */
88 /** set if the Host: header passed verification */
90 /// Set for requests handled by a "tproxy" port.
91 bool interceptTproxy
:1;
92 /// The client IP address should be spoofed when connecting to the web server.
93 /// This applies to TPROXY traffic that has not had spoofing disabled through
94 /// the spoof_client_ip squid.conf ACL.
95 bool spoofClientIp
:1;
96 /** set if the request is internal (\see ClientHttpRequest::flags.internal)*/
98 /** set for internally-generated requests */
99 //XXX this is set in in clientBeginRequest, but never tested.
100 bool internalClient
:1;
101 /** if set, request to try very hard to keep the connection alive */
102 bool mustKeepalive
:1;
103 /** set if the rquest wants connection oriented auth */
104 bool connectionAuth
:1;
105 /** set if connection oriented auth can not be supported */
106 bool connectionAuthDisabled
:1;
107 /** Request wants connection oriented auth */
108 // XXX This is set in clientCheckPinning but never tested
109 bool connectionProxyAuth
:1;
110 /** set if the request was sent on a pinned connection */
112 /** Authentication was already sent upstream (e.g. due tcp-level auth) */
114 /** Deny direct forwarding unless overriden by always_direct
115 * Used in accelerator mode */
117 /** Reply with chunked transfer encoding */
118 bool chunkedReply
:1;
119 /** set if stream error has occured */
121 /** internal ssl-bump request to get server cert */
123 /** set if X-Forwarded-For checking is complete
125 * do not read directly; use doneFollowXff for reading
127 bool done_follow_x_forwarded_for
:1;
128 /** set for ssl-bumped requests */
130 bool destinationIpLookedUp
:1;
131 /** request to reset the TCP stream */
133 /** set if the request is ranged */
136 /** clone the flags, resetting to default those which are not safe in
137 * a related (e.g. ICAP-adapted) request.
139 RequestFlags
cloneAdaptationImmune() const;
141 // if FOLLOW_X_FORWARDED_FOR is not set, we always return "done".
142 bool doneFollowXff() const {
143 return done_follow_x_forwarded_for
|| !FOLLOW_X_FORWARDED_FOR
;
146 // if USE_HTTP_VIOLATIONS is not set, never allow this
147 bool noCacheHack() const {
148 return USE_HTTP_VIOLATIONS
&& nocacheHack
;
152 #endif /* SQUID_REQUESTFLAGS_H_ */