2 * Copyright (C) 1996-2015 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 * The bit-field 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.
24 memset(this,0,sizeof(RequestFlags
));
27 /** true if the response to this request may not be READ from cache */
29 /** request is if-modified-since */
31 /** request is authenticated */
33 /** he response to the request may be stored in the cache */
35 /** the request can be forwarded through the hierarchy */
37 /** a loop was detected on this request */
39 /** the connection can be kept alive */
40 bool proxyKeepalive
:1;
41 /* this should be killed, also in httpstateflags */
43 /** content has expired, need to refresh it */
45 /** request was redirected by redirectors */
47 /** the requested object needs to be validated. See client_side_reply.cc
48 * for further information.
50 bool needValidation
:1;
51 /** whether we should fail if validation fails */
52 bool failOnValidationError
:1;
53 /** reply is stale if it is a hit */
55 /** request to override no-cache directives
57 * always use noCacheHack() for reading.
58 * \note only meaningful if USE_HTTP_VIOLATIONS is defined at build time
61 /** this request is accelerated (reverse-proxy) */
63 /** if set, ignore Cache-Control headers */
65 /** set for intercepted requests */
67 /** set if the Host: header passed verification */
69 /// Set for requests handled by a "tproxy" port.
70 bool interceptTproxy
:1;
71 /// The client IP address should be spoofed when connecting to the web server.
72 /// This applies to TPROXY traffic that has not had spoofing disabled through
73 /// the spoof_client_ip squid.conf ACL.
74 bool spoofClientIp
:1;
75 /** set if the request is internal (\see ClientHttpRequest::flags.internal)*/
77 /** set for internally-generated requests */
78 //XXX this is set in in clientBeginRequest, but never tested.
79 bool internalClient
:1;
80 /** if set, request to try very hard to keep the connection alive */
81 bool mustKeepalive
:1;
82 /** set if the rquest wants connection oriented auth */
83 bool connectionAuth
:1;
84 /** set if connection oriented auth can not be supported */
85 bool connectionAuthDisabled
:1;
86 /** Request wants connection oriented auth */
87 // XXX This is set in clientCheckPinning but never tested
88 bool connectionProxyAuth
:1;
89 /** set if the request was sent on a pinned connection */
91 /** Authentication was already sent upstream (e.g. due tcp-level auth) */
93 /** Deny direct forwarding unless overriden by always_direct
94 * Used in accelerator mode */
96 /** Reply with chunked transfer encoding */
98 /** set if stream error has occured */
100 /** internal ssl-bump request to get server cert */
102 /** set if X-Forwarded-For checking is complete
104 * do not read directly; use doneFollowXff for reading
106 bool done_follow_x_forwarded_for
:1;
107 /** set for ssl-bumped requests */
109 /// carries a representation of an FTP command [received on ftp_port]
111 bool destinationIpLookedUp
:1;
112 /** request to reset the TCP stream */
114 /** set if the request is ranged */
117 /** clone the flags, resetting to default those which are not safe in
118 * a related (e.g. ICAP-adapted) request.
120 RequestFlags
cloneAdaptationImmune() const;
122 // if FOLLOW_X_FORWARDED_FOR is not set, we always return "done".
123 bool doneFollowXff() const {
124 return done_follow_x_forwarded_for
|| !FOLLOW_X_FORWARDED_FOR
;
127 // if USE_HTTP_VIOLATIONS is not set, never allow this
128 bool noCacheHack() const {
129 return USE_HTTP_VIOLATIONS
&& nocacheHack
;
133 #endif /* SQUID_REQUESTFLAGS_H_ */