/*
- * $Id: HttpRequest.cc,v 1.31 2002/10/13 20:34:57 robertc Exp $
+ * $Id: HttpRequest.cc,v 1.32 2002/10/25 07:36:31 robertc Exp $
*
* DEBUG: section 73 HTTP Request
* AUTHOR: Duane Wessels
return 0;
return 1;
}
+
+/* request_flags */
+bool
+request_flags::resetTCP() const
+{
+ return reset_tcp != 0;
+}
+
+void
+request_flags::setResetTCP()
+{
+ debug (73, 9) ("request_flags::setResetTCP\n");
+ reset_tcp = 1;
+}
+
+void
+request_flags::clearResetTCP()
+{
+ debug(73, 9) ("request_flags::clearResetTCP\n");
+ reset_tcp = 0;
+}
/*
- * $Id: asn.cc,v 1.85 2002/10/14 10:44:30 adrian Exp $
+ * $Id: asn.cc,v 1.86 2002/10/25 07:36:32 robertc Exp $
*
* DEBUG: section 53 AS Number handling
* AUTHOR: Duane Wessels, Kostas Anagnostakis
assert(NULL != req);
asState->request = requestLink(req);
if ((e = storeGetPublic(asres, METHOD_GET)) == NULL) {
- e = storeCreateEntry(asres, asres, null_request_flags, METHOD_GET);
+ e = storeCreateEntry(asres, asres, request_flags(), METHOD_GET);
asState->sc = storeClientListAdd(e, asState);
fwdStart(-1, e, asState->request);
} else {
/*
- * $Id: client_side_reply.cc,v 1.19 2002/10/15 13:12:00 robertc Exp $
+ * $Id: client_side_reply.cc,v 1.20 2002/10/25 07:36:32 robertc Exp $
*
* DEBUG: section 88 Client-side Reply Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
context->http->al.http.code = errstate->httpStatus;
context->http->entry =
- clientCreateStoreEntry(context, method, null_request_flags);
+ clientCreateStoreEntry(context, method, request_flags());
if (auth_user_request) {
errstate->auth_user_request = auth_user_request;
authenticateAuthUserRequestLock(errstate->auth_user_request);
void
startError(clientReplyContext * context, clientHttpRequest * http, ErrorState * err)
{
- http->entry = clientCreateStoreEntry(context, http->request->method, null_request_flags);
+ http->entry = clientCreateStoreEntry(context, http->request->method, request_flags());
triggerStoreReadWithClientParameters(context, http);
errorAppendEntry(http->entry, err);
}
clientRemoveStoreReference(context, &context->sc, &http->entry);
http->entry = e =
clientCreateStoreEntry(context, http->request->method,
- null_request_flags);
+ request_flags());
/*
* Copy timestamp from the original entry so the 304
* reply has a meaningful Age: header.
clientBuildError(ERR_ACCESS_DENIED, HTTP_FORBIDDEN, NULL,
&http->conn->peer.sin_addr, http->request);
http->entry =
- clientCreateStoreEntry(context, r->method, null_request_flags);
+ clientCreateStoreEntry(context, r->method, request_flags());
errorAppendEntry(http->entry, err);
triggerStoreReadWithClientParameters(context, http);
return;
*/
http->entry =
clientCreateStoreEntry(this, http->request->method,
- null_request_flags);
+ request_flags());
triggerStoreReadWithClientParameters(this, http);
httpReplyReset(r = http->entry->mem_obj->reply);
httpBuildVersion(&version, 1, 0);
assert(context->http->request->max_forwards == 0);
context->http->entry =
clientCreateStoreEntry(context, context->http->request->method,
- null_request_flags);
+ request_flags());
tempBuffer.offset = next->readBuffer.offset + context->headers_sz;
tempBuffer.length = next->readBuffer.length;
tempBuffer.data = next->readBuffer.data;
fd, storeUrl(entry), (long int) http->out.offset);
/* update size of the request */
context->reqsize = size;
- if (http->request->flags.reset_tcp) {
+ if (http->request->flags.resetTCP()) {
/* yuck. FIXME: move to client_side.c */
if (fd != -1)
comm_reset_close(fd);
/*
- * $Id: errorpage.cc,v 1.179 2002/10/21 14:00:02 adrian Exp $
+ * $Id: errorpage.cc,v 1.180 2002/10/25 07:36:32 robertc Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
if (err->page_id == TCP_RESET) {
if (err->request) {
debug(4, 2) ("RSTing this reply\n");
- err->request->flags.reset_tcp = 1;
+ err->request->flags.setResetTCP();
}
}
storeLockObject(entry);
/*
- * $Id: globals.h,v 1.113 2002/10/21 14:00:02 adrian Exp $
+ * $Id: globals.h,v 1.114 2002/10/25 07:36:32 robertc Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
#if HTTP_VIOLATIONS
extern int refresh_nocache_hack; /* 0 */
#endif
-extern request_flags null_request_flags;
extern int store_open_disk_fd; /* 0 */
extern const char *SwapDirType[];
extern authscheme_entry_t *authscheme_list; /* NULL */
/*
- * $Id: mime.cc,v 1.106 2002/10/14 11:51:07 adrian Exp $
+ * $Id: mime.cc,v 1.107 2002/10/25 07:36:32 robertc Exp $
*
* DEBUG: section 25 MIME Parsing
* AUTHOR: Harvest Derived
file_close(fd);
return;
}
- flags = null_request_flags;
flags.cachable = 1;
StoreEntry *e = storeCreateEntry(url,
url,
/*
- * $Id: neighbors.cc,v 1.307 2002/10/15 08:03:29 robertc Exp $
+ * $Id: neighbors.cc,v 1.308 2002/10/25 07:36:32 robertc Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
assert(p->type == PEER_MULTICAST);
p->mcast.flags.count_event_pending = 0;
snprintf(url, MAX_URL, "http://%s/", inet_ntoa(p->in_addr.sin_addr));
- fake = storeCreateEntry(url, url, null_request_flags, METHOD_GET);
+ fake = storeCreateEntry(url, url, request_flags(), METHOD_GET);
psstate = cbdataAlloc(ps_state);
psstate->request = requestLink(urlParse(METHOD_GET, url));
psstate->entry = fake;
/*
- * $Id: net_db.cc,v 1.165 2002/10/25 04:06:39 robertc Exp $
+ * $Id: net_db.cc,v 1.166 2002/10/25 07:36:32 robertc Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
assert(NULL != ex->r);
httpBuildVersion(&ex->r->http_ver, 1, 0);
ex->connstate = STATE_HEADER;
- ex->e = storeCreateEntry(uri, uri, null_request_flags, METHOD_GET);
+ ex->e = storeCreateEntry(uri, uri, request_flags(), METHOD_GET);
ex->buf_sz = NETDB_REQBUF_SZ;
assert(NULL != ex->e);
ex->sc = storeClientListAdd(ex->e, ex);
/*
- * $Id: store_digest.cc,v 1.53 2002/10/15 08:03:30 robertc Exp $
+ * $Id: store_digest.cc,v 1.54 2002/10/25 07:36:32 robertc Exp $
*
* DEBUG: section 71 Store Digest Manager
* AUTHOR: Alex Rousskov
debug(71, 2) ("storeDigestRewrite: start rewrite #%d\n", sd_state.rewrite_count + 1);
/* make new store entry */
url = internalLocalUri("/squid-internal-periodic/", StoreDigestFileName);
- flags = null_request_flags;
flags.cachable = 1;
e = storeCreateEntry(url, url, flags, METHOD_GET);
assert(e);
/*
- * $Id: structs.h,v 1.436 2002/10/21 14:00:03 adrian Exp $
+ * $Id: structs.h,v 1.437 2002/10/25 07:37:00 robertc Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
void *fsdata;
};
-struct _request_flags {
+/* To hard to pull this into another file just yet.
+ * SO, we stop globals.c seeing it
+ */
+#ifdef __cplusplus
+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),accelerated(0),internal(0),internalclient(0),body_sent(0)
+ {
+#if HTTP_VIOLATIONS
+ nocache_hack = 1;
+#endif
+ }
unsigned int range:1;
unsigned int nocache:1;
unsigned int ims:1;
unsigned int internal:1;
unsigned int internalclient:1;
unsigned int body_sent:1;
+ bool resetTCP() const;
+ void setResetTCP();
+ void clearResetTCP();
+private:
unsigned int reset_tcp:1;
};
time_t lastmod; /* Used on refreshes */
const char *vary_headers; /* Used when varying entities are detected. Changes how the store key is calculated */
};
-
+#endif
struct _cachemgr_passwd {
char *passwd;
wordlist *actions;
/*
- * $Id: typedefs.h,v 1.141 2002/10/21 14:00:03 adrian Exp $
+ * $Id: typedefs.h,v 1.142 2002/10/25 07:36:32 robertc Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
typedef struct _MemObject MemObject;
typedef struct _StoreEntry StoreEntry;
typedef struct _SwapDir SwapDir;
-typedef struct _request_flags request_flags;
typedef struct _helper_flags helper_flags;
typedef struct _helper_stateful_flags helper_stateful_flags;
typedef struct _http_state_flags http_state_flags;
/*
- * $Id: url.cc,v 1.138 2002/10/13 20:35:06 robertc Exp $
+ * $Id: url.cc,v 1.139 2002/10/25 07:36:32 robertc Exp $
*
* DEBUG: section 23 URL Parsing
* AUTHOR: Duane Wessels
{
debug(23, 5) ("urlInitialize: Initializing...\n");
assert(sizeof(ProtocolStr) == (PROTO_MAX + 1) * sizeof(char *));
- memset(&null_request_flags, '\0', sizeof(null_request_flags));
/*
* These test that our matchDomainName() function works the
* way we expect it to.
/*
- * $Id: urn.cc,v 1.78 2002/10/14 11:59:33 adrian Exp $
+ * $Id: urn.cc,v 1.79 2002/10/25 07:36:32 robertc Exp $
*
* DEBUG: section 52 URN Parsing
* AUTHOR: Kostas Anagnostakis
{
urlres_e = newEntry;
if (urlres_e->isNull()) {
- urlres_e = storeCreateEntry(urlres, urlres, null_request_flags, METHOD_GET);
+ urlres_e = storeCreateEntry(urlres, urlres, request_flags(), METHOD_GET);
sc = storeClientListAdd(urlres_e, this);
fwdStart(-1, urlres_e, urlres_r);
} else {