range = header.getRange();
}
-/* request_flags */
-bool
-request_flags::resetTCP() const
-{
- return reset_tcp != 0;
-}
-
-void
-request_flags::setResetTCP()
-{
- debugs(73, 9, "request_flags::setResetTCP");
- reset_tcp = 1;
-}
-
-void
-request_flags::clearResetTCP()
-{
- debugs(73, 9, "request_flags::clearResetTCP");
- reset_tcp = 0;
-}
-
#if ICAP_CLIENT
Adaptation::Icap::History::Pointer
HttpRequest::icapHistory() const
return (range && range->specs.count > 1);
}
-void
-request_flags::destinationIPLookupCompleted()
-{
- destinationIPLookedUp_ = true;
-}
-
-bool
-request_flags::destinationIPLookedUp() const
-{
- return destinationIPLookedUp_;
-}
-
-request_flags
-request_flags::cloneAdaptationImmune() const
-{
- // At the time of writing, all flags where either safe to copy after
- // adaptation or were not set at the time of the adaptation. If there
- // are flags that are different, they should be cleared in the clone.
- return *this;
-}
-
bool
HttpRequest::bodyNibbled() const
{
#include "HierarchyLogEntry.h"
#include "HttpMsg.h"
#include "HttpRequestMethod.h"
+#include "RequestFlags.h"
#if USE_AUTH
#include "auth/UserRequest.h"
char *canonical;
- request_flags flags;
+ RequestFlags flags;
HttpHdrRange *range;
HttpParser.h \
HttpReply.cc \
HttpReply.h \
+ RequestFlags.h \
+ RequestFlags.cc \
HttpRequest.cc \
HttpRequest.h \
HttpRequestMethod.cc \
HttpStatusLine.h \
Mem.h \
mem.cc \
- RegexList.h \
- RegexList.cc \
+ RegexList.h \
+ RegexList.cc \
MemBuf.cc \
MemBuf.h \
mime_header.h \
debug.cc \
HttpParser.cc \
HttpParser.h \
+ RequestFlags.h \
+ RequestFlags.cc \
HttpRequest.cc \
HttpRequestMethod.cc \
Mem.h \
YesNoNone.cc \
RefreshPattern.h \
CacheMgrPasswd.h \
- CacheMgrPasswd.cc \
+ CacheMgrPasswd.cc \
cache_cf.cc \
CacheDigest.h \
CacheDigest.cc \
refresh.h \
refresh.cc \
RemovalPolicy.cc \
+ RequestFlags.h \
+ RequestFlags.cc \
StatCounters.h \
StatCounters.cc \
StatHist.h \
YesNoNone.cc \
RefreshPattern.h \
CacheMgrPasswd.h \
- CacheMgrPasswd.cc \
+ CacheMgrPasswd.cc \
cache_cf.cc \
cache_manager.cc \
carp.h \
HttpParser.cc \
HttpParser.h \
HttpReply.cc \
+ RequestFlags.h \
+ RequestFlags.cc \
HttpRequest.cc \
HttpRequestMethod.cc \
HttpStatusLine.cc \
YesNoNone.cc \
RefreshPattern.h \
CacheMgrPasswd.h \
- CacheMgrPasswd.cc \
+ CacheMgrPasswd.cc \
cache_cf.cc \
carp.h \
carp.cc \
HttpParser.cc \
HttpParser.h \
HttpReply.cc \
+ RequestFlags.h \
+ RequestFlags.cc \
HttpRequest.cc \
HttpRequestMethod.cc \
HttpStatusLine.cc \
YesNoNone.cc \
RefreshPattern.h \
CacheMgrPasswd.h \
- CacheMgrPasswd.cc \
+ CacheMgrPasswd.cc \
cache_cf.cc \
cache_manager.cc \
CacheDigest.h \
HttpParser.cc \
HttpParser.h \
HttpReply.cc \
+ RequestFlags.h \
+ RequestFlags.cc \
HttpRequest.cc \
HttpRequestMethod.cc \
HttpStatusLine.cc \
$(ACL_REGISTRATION_SOURCES) \
HttpParser.cc \
HttpParser.h \
+ RequestFlags.h \
+ RequestFlags.cc \
HttpRequest.cc \
HttpRequestMethod.cc \
Mem.h \
YesNoNone.cc \
RefreshPattern.h \
CacheMgrPasswd.h \
- CacheMgrPasswd.cc \
+ CacheMgrPasswd.cc \
cache_cf.cc \
debug.cc \
CacheDigest.h \
HttpHeader.cc \
HttpMsg.cc \
HttpRequestMethod.cc \
+ RequestFlags.cc \
+ RequestFlags.h \
int.h \
int.cc \
SquidList.h \
HttpStatusLine.cc \
int.h \
int.cc \
+ RequestFlags.h \
+ RequestFlags.cc \
SquidList.h \
SquidList.cc \
MemObject.cc \
Packer.cc \
Parsing.cc \
RemovalPolicy.cc \
+ RequestFlags.cc \
+ RequestFlags.h \
StatCounters.h \
StatCounters.cc \
StatHist.h \
YesNoNone.cc \
RefreshPattern.h \
CacheMgrPasswd.h \
- CacheMgrPasswd.cc \
+ CacheMgrPasswd.cc \
cache_cf.cc \
cache_manager.cc \
CacheDigest.h \
HttpParser.cc \
HttpParser.h \
HttpReply.cc \
+ RequestFlags.h \
+ RequestFlags.cc \
HttpRequest.cc \
HttpRequestMethod.cc \
HttpStatusLine.cc \
StoreMetaVary.cc \
StoreSwapLogData.cc \
String.cc \
- StrList.h \
- StrList.cc \
+ StrList.h \
+ StrList.cc \
SwapDir.cc \
MemStore.cc \
tests/stub_debug.cc \
--- /dev/null
+/*
+ * DEBUG: section 73 HTTP Request
+ * AUTHOR: Duane Wessels
+ *
+ * SQUID Web Proxy Cache http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ * Squid is the result of efforts by numerous individuals from
+ * the Internet community; see the CONTRIBUTORS file for full
+ * details. Many organizations have provided support for Squid's
+ * development; see the SPONSORS file for full details. Squid is
+ * Copyrighted (C) 2001 by the Regents of the University of
+ * California; see the COPYRIGHT file for full details. Squid
+ * incorporates software developed and/or copyrighted by other
+ * sources; see the CREDITS file for full details.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+#include "squid.h"
+#include "Debug.h"
+#include "RequestFlags.h"
+
+// TODO: move to .cci
+/* RequestFlags */
+bool
+RequestFlags::resetTCP() const
+{
+ return resetTCP_;
+}
+
+void
+RequestFlags::setResetTCP()
+{
+ debugs(73, 9, "request_flags::setResetTCP");
+ resetTCP_ = true;
+}
+
+void
+RequestFlags::clearResetTCP()
+{
+ debugs(73, 9, "request_flags::clearResetTCP");
+ resetTCP_ = false;
+}
+
+void
+RequestFlags::destinationIPLookupCompleted()
+{
+ destinationIPLookedUp_ = true;
+}
+
+bool
+RequestFlags::destinationIPLookedUp() const
+{
+ return destinationIPLookedUp_;
+}
+
+bool
+RequestFlags::isRanged() const
+{
+ return isRanged_;
+}
+
+void
+RequestFlags::setRanged()
+{
+ isRanged_ = true;
+}
+
+void
+RequestFlags::clearRanged()
+{
+ isRanged_ = false;
+}
+
+
+RequestFlags
+RequestFlags::cloneAdaptationImmune() const
+{
+ // At the time of writing, all flags where either safe to copy after
+ // adaptation or were not set at the time of the adaptation. If there
+ // are flags that are different, they should be cleared in the clone.
+ return *this;
+}
--- /dev/null
+#ifndef SQUID_REQUESTFLAGS_H_
+#define SQUID_REQUESTFLAGS_H_
+/*
+ * DEBUG: section 73 HTTP Request
+ * AUTHOR: Duane Wessels
+ *
+ * SQUID Web Proxy Cache http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ * Squid is the result of efforts by numerous individuals from
+ * the Internet community; see the CONTRIBUTORS file for full
+ * details. Many organizations have provided support for Squid's
+ * development; see the SPONSORS file for full details. Squid is
+ * Copyrighted (C) 2001 by the Regents of the University of
+ * California; see the COPYRIGHT file for full details. Squid
+ * incorporates software developed and/or copyrighted by other
+ * sources; see the CREDITS file for full details.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+class RequestFlags {
+public:
+ RequestFlags():
+ nocache(0), ims(0), auth(0), cachable(0),
+ hierarchical(0), loopdetect(0), proxy_keepalive(0), proxying(0),
+ refresh(0), redirected(0), need_validation(0),
+ fail_on_validation_err(0), stale_if_hit(0), accelerated(0),
+ ignore_cc(0), intercepted(0), hostVerified(0), spoof_client_ip(0),
+ internal(0), internalclient(0), must_keepalive(0), pinned(0),
+ canRePin(0), chunked_reply(0), stream_error(0), sslPeek(0),
+ sslBumped(0), destinationIPLookedUp_(false), resetTCP_(false),
+ isRanged_(false) {
+#if USE_HTTP_VIOLATIONS
+ nocache_hack = 0;
+#endif
+#if FOLLOW_X_FORWARDED_FOR
+ done_follow_x_forwarded_for = 0;
+#endif /* FOLLOW_X_FORWARDED_FOR */
+ }
+
+ unsigned int nocache :1; ///< whether the response to this request may be READ from cache
+ unsigned int ims :1;
+ unsigned int auth :1;
+ unsigned int cachable :1; ///< whether the response to thie request may be stored in the cache
+ unsigned int hierarchical :1;
+ unsigned int loopdetect :1;
+ unsigned int proxy_keepalive :1;
+ unsigned int proxying :1; /* this should be killed, also in httpstateflags */
+ unsigned int refresh :1;
+ unsigned int redirected :1;
+ unsigned int need_validation :1;
+ unsigned int fail_on_validation_err :1; ///< whether we should fail if validation fails
+ unsigned int stale_if_hit :1; ///< reply is stale if it is a hit
+#if USE_HTTP_VIOLATIONS
+ /* for changing/ignoring no-cache requests */
+ /* TODO: remove the conditional definition, move ifdef to setter */
+ unsigned int nocache_hack :1;
+#endif
+ unsigned int accelerated :1;
+ unsigned int ignore_cc :1;
+ unsigned int intercepted :1; ///< intercepted request
+ unsigned int hostVerified :1; ///< whether the Host: header passed verification
+ unsigned int spoof_client_ip :1; /**< spoof client ip if possible */
+ unsigned int internal :1;
+ unsigned int internalclient :1;
+ unsigned int must_keepalive :1;
+ unsigned int connection_auth :1; /** Request wants connection oriented auth */
+ unsigned int connection_auth_disabled :1; /** Connection oriented auth can not be supported */
+ unsigned int connection_proxy_auth :1; /** Request wants connection oriented auth */
+ unsigned int pinned :1; /* Request sent on a pinned connection */
+ unsigned int canRePin :1; ///< OK to reopen a failed pinned connection
+ unsigned int auth_sent :1; /* Authentication forwarded */
+ unsigned int no_direct :1; /* Deny direct forwarding unless overriden by always_direct. Used in accelerator mode */
+ unsigned int chunked_reply :1; /**< Reply with chunked transfer encoding */
+ unsigned int stream_error :1; /**< Whether stream error has occured */
+ unsigned int sslPeek :1; ///< internal ssl-bump request to get server cert
+ unsigned int sslBumped :1; /**< ssl-bumped request*/
+
+#if FOLLOW_X_FORWARDED_FOR
+ /* TODO: move from conditional definition to conditional setting */
+ unsigned int done_follow_x_forwarded_for :1;
+#endif /* FOLLOW_X_FORWARDED_FOR */
+
+ // When adding new flags, please update cloneAdaptationImmune() as needed.
+ bool resetTCP() const;
+ void setResetTCP();
+ void clearResetTCP();
+ void destinationIPLookupCompleted();
+ bool destinationIPLookedUp() const;
+ // returns a partial copy of the flags that includes only those flags
+ // that are safe for a related (e.g., ICAP-adapted) request to inherit
+ RequestFlags cloneAdaptationImmune() const;
+
+ bool isRanged() const;
+ void setRanged();
+ void clearRanged();
+private:
+
+ bool destinationIPLookedUp_:1;
+ bool resetTCP_:1; ///< request to reset the TCP stream
+ bool isRanged_ :1;
+};
+
+#endif /* SQUID_REQUESTFLAGS_H_ */
#include "Range.h"
#include "RefCount.h"
#include "RemovalPolicy.h"
+#include "RequestFlags.h"
#include "StoreIOBuffer.h"
#include "StoreStats.h"
SQUIDCEXTERN StoreEntry *storeGetPublicByRequestMethod(HttpRequest * request, const HttpRequestMethod& method);
/// \ingroup StoreAPI
-SQUIDCEXTERN StoreEntry *storeCreateEntry(const char *, const char *, request_flags, const HttpRequestMethod&);
+class RequestFlags;
+extern StoreEntry *storeCreateEntry(const char *, const char *, const RequestFlags &, const HttpRequestMethod&);
/// \ingroup StoreAPI
SQUIDCEXTERN void storeInit(void);
*/
#include "squid.h"
-#include "mgr/Registration.h"
-#include "radix.h"
-#include "HttpRequest.h"
-#include "StoreClient.h"
-#include "Store.h"
#include "acl/Acl.h"
#include "acl/Asn.h"
#include "acl/Checklist.h"
-#include "acl/SourceAsn.h"
#include "acl/DestinationAsn.h"
#include "acl/DestinationIp.h"
+#include "acl/SourceAsn.h"
#include "cache_cf.h"
+#include "forward.h"
#include "HttpReply.h"
+#include "HttpRequest.h"
#include "ipcache.h"
-#include "forward.h"
+#include "mgr/Registration.h"
+#include "radix.h"
+#include "RequestFlags.h"
#include "SquidConfig.h"
+#include "Store.h"
+#include "StoreClient.h"
#include "StoreClient.h"
#include "wordlist.h"
asState->request = HTTPMSGLOCK(req);
if ((e = storeGetPublic(asres, METHOD_GET)) == NULL) {
- e = storeCreateEntry(asres, asres, request_flags(), METHOD_GET);
+ e = storeCreateEntry(asres, asres, RequestFlags(), METHOD_GET);
asState->sc = storeClientListAdd(e, asState);
FwdState::fwdStart(Comm::ConnectionPointer(), e, asState->request);
} else {
#include "mime_header.h"
#include "neighbors.h"
#include "refresh.h"
+#include "RequestFlags.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "Store.h"
http->al->http.code = errstate->httpStatus;
- createStoreEntry(method, request_flags());
+ createStoreEntry(method, RequestFlags());
assert(errstate->callback_data == NULL);
errorAppendEntry(http->storeEntry(), errstate);
/* Now the caller reads to get this */
void
clientReplyContext::startError(ErrorState * err)
{
- createStoreEntry(http->request->method, request_flags());
+ createStoreEntry(http->request->method, RequestFlags());
triggerInitialStoreRead();
errorAppendEntry(http->storeEntry(), err);
}
if (r->flags.loopdetect) {
http->al->http.code = HTTP_FORBIDDEN;
err = clientBuildError(ERR_ACCESS_DENIED, HTTP_FORBIDDEN, NULL, http->getConn()->clientConnection->remote, http->request);
- createStoreEntry(r->method, request_flags());
+ createStoreEntry(r->method, RequestFlags());
errorAppendEntry(http->storeEntry(), err);
triggerInitialStoreRead();
return;
/* FIXME: This doesn't need to go through the store. Simply
* push down the client chain
*/
- createStoreEntry(http->request->method, request_flags());
+ createStoreEntry(http->request->method, RequestFlags());
triggerInitialStoreRead();
{
clientStreamNode *nextNode = (clientStreamNode *)node->node.next->data;
StoreIOBuffer localTempBuffer;
- createStoreEntry(http->request->method, request_flags());
+ createStoreEntry(http->request->method, RequestFlags());
localTempBuffer.offset = nextNode->readBuffer.offset + headers_sz;
localTempBuffer.length = nextNode->readBuffer.length;
localTempBuffer.data = nextNode->readBuffer.data;
HttpReply *const temprep = e->getReply()->make304();
http->logType = LOG_TCP_IMS_HIT;
removeClientStoreReference(&sc, http);
- createStoreEntry(http->request->method, request_flags());
+ createStoreEntry(http->request->method, RequestFlags());
e = http->storeEntry();
// Copy timestamp from the original entry so the 304
// reply has a meaningful Age: header.
/* Using this breaks the client layering just a little!
*/
void
-clientReplyContext::createStoreEntry(const HttpRequestMethod& m, request_flags reqFlags)
+clientReplyContext::createStoreEntry(const HttpRequestMethod& m, RequestFlags reqFlags)
{
assert(http != NULL);
/*
#ifndef SQUID_CLIENTSIDEREPLY_H
#define SQUID_CLIENTSIDEREPLY_H
-#include "RefCount.h"
-#include "HttpHeader.h"
+#include "client_side_request.h"
#include "clientStream.h"
+#include "HttpHeader.h"
+#include "RefCount.h"
+#include "RequestFlags.h"
#include "StoreClient.h"
-#include "client_side_request.h"
class ErrorState;
#include "ip/forward.h"
#endif
/// creates a store entry for the reply and appends err to it
void setReplyToError(const HttpRequestMethod& method, ErrorState *err);
- void createStoreEntry(const HttpRequestMethod& m, request_flags flags);
+ void createStoreEntry(const HttpRequestMethod& m, RequestFlags flags);
void removeStoreReference(store_client ** scp, StoreEntry ** ep);
void removeClientStoreReference(store_client **scp, ClientHttpRequest *http);
void startError(ErrorState * err);
request->range = req_hdr->getRange();
if (request->range) {
- request->flags.range = 1;
+ request->flags.setRanged();
clientStreamNode *node = (clientStreamNode *)http->client_stream.tail->data;
/* XXX: This is suboptimal. We should give the stream the range set,
* and thereby let the top of the stream set the offset when the
/* pretend it's not a range request */
delete request->range;
request->range = NULL;
- request->flags.range = 0;
+ request->flags.clearRanged();
}
/* append Via */
assert(NULL != ex->r);
ex->r->http_ver = HttpVersion(1,1);
ex->connstate = STATE_HEADER;
- ex->e = storeCreateEntry(uri, uri, request_flags(), METHOD_GET);
+ ex->e = storeCreateEntry(uri, uri, RequestFlags(), METHOD_GET);
ex->buf_sz = NETDB_REQBUF_SZ;
assert(NULL != ex->e);
ex->sc = storeClientListAdd(ex->e, ex);
#include "HttpRequestMethod.h"
#include "ipc/forward.h"
#include "mgr/QueryParams.h"
+#include "RequestFlags.h"
namespace Mgr
{
/* details of the client HTTP request that caused the action */
String httpUri; ///< HTTP request URI
_method_t httpMethod; ///< HTTP request method
- request_flags httpFlags; ///< HTTP request flags
+ RequestFlags httpFlags; ///< HTTP request flags
String httpOrigin; ///< HTTP Origin: header (if any)
/* action parameters extracted from the client HTTP request */
#include "MemBuf.h"
#include "mime.h"
#include "MemObject.h"
+#include "RequestFlags.h"
#include "SquidConfig.h"
#include "Store.h"
#include "StoreClient.h"
int n;
- request_flags flags;
+ RequestFlags flags;
struct stat sb;
#include "neighbors.h"
#include "PeerDigest.h"
#include "PeerSelectState.h"
+#include "RequestFlags.h"
#include "SquidConfig.h"
#include "SquidMath.h"
#include "SquidTime.h"
snprintf(url, MAX_URL, "http://");
p->in_addr.ToURL(url+7, MAX_URL -8 );
strcat(url, "/");
- fake = storeCreateEntry(url, url, request_flags(), METHOD_GET);
+ fake = storeCreateEntry(url, url, RequestFlags(), METHOD_GET);
HttpRequest *req = HttpRequest::CreateFromUrl(url);
psstate = new ps_state;
psstate->request = HTTPMSGLOCK(req);
#include "mgr/StoreIoAction.h"
#include "profiler/Profiler.h"
#include "repl_modules.h"
+#include "RequestFlags.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "Stack.h"
}
StoreEntry *
-storeCreateEntry(const char *url, const char *log_url, request_flags flags, const HttpRequestMethod& method)
+storeCreateEntry(const char *url, const char *log_url, const RequestFlags &flags, const HttpRequestMethod& method)
{
StoreEntry *e = NULL;
MemObject *mem = NULL;
{
const String reqETags = request.header.getList(HDR_IF_NONE_MATCH);
// weak comparison is allowed only for HEAD or full-body GET requests
- const bool allowWeakMatch = !request.flags.range &&
+ const bool allowWeakMatch = !request.flags.isRanged() &&
(request.method == METHOD_GET || request.method == METHOD_HEAD);
return hasOneOfEtags(reqETags, allowWeakMatch);
}
static void
storeDigestRewriteStart(void *datanotused)
{
- request_flags flags;
+ RequestFlags flags;
char *url;
StoreEntry *e;
Http, Ftp, Gopher;
};
-struct request_flags {
- request_flags(): range(0),nocache(0),ims(0),auth(0),cachable(0),hierarchical(0),loopdetect(0),proxy_keepalive(0),proxying(0),refresh(0),redirected(0),need_validation(0),fail_on_validation_err(0),stale_if_hit(0),accelerated(0),ignore_cc(0),intercepted(0),hostVerified(0),spoof_client_ip(0),internal(0),internalclient(0),must_keepalive(0),pinned(0),canRePin(0),chunked_reply(0),stream_error(0),sslPeek(0),sslBumped(0),destinationIPLookedUp_(0) {
-#if USE_HTTP_VIOLATIONS
- nocache_hack = 0;
-#endif
-#if FOLLOW_X_FORWARDED_FOR
- done_follow_x_forwarded_for = 0;
-#endif /* FOLLOW_X_FORWARDED_FOR */
- }
-
- unsigned int range:1;
- unsigned int nocache:1; ///< whether the response to this request may be READ from cache
- unsigned int ims:1;
- unsigned int auth:1;
- unsigned int cachable:1; ///< whether the response to thie request may be stored in the cache
- unsigned int hierarchical:1;
- unsigned int loopdetect:1;
- unsigned int proxy_keepalive:1;
-unsigned int proxying:
- 1; /* this should be killed, also in httpstateflags */
- unsigned int refresh:1;
- unsigned int redirected:1;
- unsigned int need_validation:1;
- unsigned int fail_on_validation_err:1; ///< whether we should fail if validation fails
- unsigned int stale_if_hit:1; ///< reply is stale if it is a hit
-#if USE_HTTP_VIOLATIONS
- unsigned int nocache_hack:1; /* for changing/ignoring no-cache requests */
-#endif
- unsigned int accelerated:1;
- unsigned int ignore_cc:1;
- unsigned int intercepted:1; ///< intercepted request
- unsigned int hostVerified:1; ///< whether the Host: header passed verification
- unsigned int spoof_client_ip:1; /**< spoof client ip if possible */
- unsigned int internal:1;
- unsigned int internalclient:1;
- unsigned int must_keepalive:1;
- unsigned int connection_auth:1; /** Request wants connection oriented auth */
- unsigned int connection_auth_disabled:1; /** Connection oriented auth can not be supported */
- unsigned int connection_proxy_auth:1; /** Request wants connection oriented auth */
- unsigned int pinned:1; /* Request sent on a pinned connection */
- unsigned int canRePin:1; ///< OK to reopen a failed pinned connection
- unsigned int auth_sent:1; /* Authentication forwarded */
- unsigned int no_direct:1; /* Deny direct forwarding unless overriden by always_direct. Used in accelerator mode */
- unsigned int chunked_reply:1; /**< Reply with chunked transfer encoding */
- unsigned int stream_error:1; /**< Whether stream error has occured */
- unsigned int sslPeek:1; ///< internal ssl-bump request to get server cert
- unsigned int sslBumped:1; /**< ssl-bumped request*/
-
- // When adding new flags, please update cloneAdaptationImmune() as needed.
-
- bool resetTCP() const;
- void setResetTCP();
- void clearResetTCP();
- void destinationIPLookupCompleted();
- bool destinationIPLookedUp() const;
-
- // returns a partial copy of the flags that includes only those flags
- // that are safe for a related (e.g., ICAP-adapted) request to inherit
- request_flags cloneAdaptationImmune() const;
-
-#if FOLLOW_X_FORWARDED_FOR
- unsigned int done_follow_x_forwarded_for;
-#endif /* FOLLOW_X_FORWARDED_FOR */
-private:
-
- unsigned int reset_tcp:1;
- unsigned int destinationIPLookedUp_:1;
-};
-
#if USE_SSL
struct _sslproxy_cert_sign {
int alg;
#include "squid.h"
+#include "RequestFlags.h"
#define STUB_API "store.cc"
#include "tests/STUB.h"
SQUIDCEXTERN StoreEntry *storeGetPublic(const char *uri, const HttpRequestMethod& method) STUB_RETVAL(NULL)
SQUIDCEXTERN StoreEntry *storeGetPublicByRequest(HttpRequest * request) STUB_RETVAL(NULL)
SQUIDCEXTERN StoreEntry *storeGetPublicByRequestMethod(HttpRequest * request, const HttpRequestMethod& method) STUB_RETVAL(NULL)
-SQUIDCEXTERN StoreEntry *storeCreateEntry(const char *, const char *, request_flags, const HttpRequestMethod&) STUB_RETVAL(NULL)
+extern StoreEntry *storeCreateEntry(const char *, const char *, const RequestFlags &, const HttpRequestMethod&) STUB_RETVAL(NULL)
SQUIDCEXTERN void storeInit(void) STUB
SQUIDCEXTERN void storeConfigure(void) STUB
SQUIDCEXTERN void storeFreeMemory(void) STUB
#include "MemObject.h"
#include "HttpHeader.h"
#include "HttpReply.h"
+#include "RequestFlags.h"
#include "StoreFileSystem.h"
#include "testStoreSupport.h"
#include "SquidConfig.h"
/* add an entry */
{
/* Create "vary" base object */
- request_flags flags;
+ RequestFlags flags;
flags.cachable = 1;
StoreEntry *pe = storeCreateEntry("dummy url", "dummy log url", flags, METHOD_GET);
HttpReply *rep = (HttpReply *) pe->getReply(); // bypass const
#include "MemObject.h"
#include "HttpHeader.h"
#include "HttpReply.h"
+#include "RequestFlags.h"
#include "SquidConfig.h"
#include "StoreFileSystem.h"
#include "testStoreSupport.h"
/* add an entry */
{
/* Create "vary" base object */
- request_flags flags;
+ RequestFlags flags;
flags.cachable = 1;
StoreEntry *pe = storeCreateEntry("dummy url", "dummy log url", flags, METHOD_GET);
/* We are allowed to do this typecast */
#include "HttpReply.h"
#include "Mem.h"
#include "MemObject.h"
+#include "RequestFlags.h"
#include "SquidConfig.h"
#include "Store.h"
#include "StoreFileSystem.h"
StoreEntry *
testRock::createEntry(const int i)
{
- request_flags flags;
+ RequestFlags flags;
flags.cachable = 1;
char url[64];
snprintf(url, sizeof(url), "dummy url %i", i);
#include "HttpReply.h"
#include "Mem.h"
#include "MemObject.h"
+#include "RequestFlags.h"
#include "SquidConfig.h"
#include "Store.h"
#include "SwapDir.h"
/* add an entry */
{
/* Create "vary" base object */
- request_flags flags;
+ RequestFlags flags;
flags.cachable = 1;
StoreEntry *pe = storeCreateEntry("dummy url", "dummy log url", flags, METHOD_GET);
HttpReply *rep = (HttpReply *) pe->getReply(); // bypass const
#include "icmp/net_db.h"
#include "MemBuf.h"
#include "mime_header.h"
+#include "RequestFlags.h"
#include "SquidTime.h"
#include "Store.h"
#include "StoreClient.h"
urlres_e = newEntry;
if (urlres_e->isNull()) {
- urlres_e = storeCreateEntry(urlres, urlres, request_flags(), METHOD_GET);
+ urlres_e = storeCreateEntry(urlres, urlres, RequestFlags(), METHOD_GET);
sc = storeClientListAdd(urlres_e, this);
FwdState::fwdStart(Comm::ConnectionPointer(), urlres_e, urlres_r);
} else {