SQUID_YESNO([$enableval],
[unrecognized argument to --disable-http-violations: $enableval])
])
-SQUID_DEFINE_BOOL(HTTP_VIOLATIONS, ${enable_http_violations:=yes},
+SQUID_DEFINE_BOOL(USE_HTTP_VIOLATIONS, ${enable_http_violations:=yes},
[Define to enable code which volates the HTTP standard specification])
AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations])
static void free_all(void);
void requirePathnameExists(const char *name, const char *path);
static OBJH dump_config;
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
static void dump_http_header_access(StoreEntry * entry, const char *name, header_mangler header[]);
static void parse_http_header_access(header_mangler header[]);
static void free_http_header_access(header_mangler header[]);
if (Config.errorDirectory)
requirePathnameExists("Error Directory", Config.errorDirectory);
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
{
const refresh_t *R;
}
#endif
-#if !HTTP_VIOLATIONS
+#if !USE_HTTP_VIOLATIONS
Config.onoff.via = 1;
#else
#endif
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
static void
dump_http_header_access(StoreEntry * entry, const char *name, header_mangler header[])
{
if (head->flags.refresh_ims)
storeAppendPrintf(entry, " refresh-ims");
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
if (head->flags.override_expire)
storeAppendPrintf(entry, " override-expire");
double pct = 0.0;
time_t max = 0;
int refresh_ims = 0;
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
int override_expire = 0;
int override_lastmod = 0;
while ((token = strtok(NULL, w_space)) != NULL) {
if (!strcmp(token, "refresh-ims")) {
refresh_ims = 1;
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
} else if (!strcmp(token, "override-expire"))
override_expire = 1;
if (refresh_ims)
t->flags.refresh_ims = 1;
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
if (override_expire)
t->flags.override_expire = 1;
safe_free(t);
}
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
refresh_nocache_hack = 0;
#endif
}
s->allow_direct = 1;
} else if (strcmp(token, "ignore-cc") == 0) {
-#if !HTTP_VIOLATIONS
+#if !USE_HTTP_VIOLATIONS
if (!s->accel) {
debugs(3, DBG_CRITICAL, "FATAL: http(s)_port: ignore-cc option requires Scceleration mode flag.");
self_destruct();
DOC_END
NAME: negative_ttl
-IFDEF: HTTP_VIOLATIONS
+IFDEF: USE_HTTP_VIOLATIONS
COMMENT: time-units
TYPE: time_t
LOC: Config.negativeTtl
DOC_END
NAME: broken_posts
-IFDEF: HTTP_VIOLATIONS
+IFDEF: USE_HTTP_VIOLATIONS
TYPE: acl_access
DEFAULT: none
LOC: Config.accessList.brokenPosts
DOC_END
NAME: via
-IFDEF: HTTP_VIOLATIONS
+IFDEF: USE_HTTP_VIOLATIONS
COMMENT: on|off
TYPE: onoff
DEFAULT: on
DOC_END
NAME: request_header_access
-IFDEF: HTTP_VIOLATIONS
+IFDEF: USE_HTTP_VIOLATIONS
TYPE: http_header_access[]
LOC: Config.request_header_access
DEFAULT: none
DOC_END
NAME: reply_header_access
-IFDEF: HTTP_VIOLATIONS
+IFDEF: USE_HTTP_VIOLATIONS
TYPE: http_header_access[]
LOC: Config.reply_header_access
DEFAULT: none
DOC_END
NAME: header_replace
-IFDEF: HTTP_VIOLATIONS
+IFDEF: USE_HTTP_VIOLATIONS
TYPE: http_header_replace[]
LOC: Config.request_header_access
DEFAULT: none
NAME: ignore_expect_100
COMMENT: on|off
-IFDEF: HTTP_VIOLATIONS
+IFDEF: USE_HTTP_VIOLATIONS
TYPE: onoff
LOC: Config.onoff.ignore_expect_100
DEFAULT: off
DOC_END
NAME: reload_into_ims
-IFDEF: HTTP_VIOLATIONS
+IFDEF: USE_HTTP_VIOLATIONS
COMMENT: on|off
TYPE: onoff
DEFAULT: off
define["FOLLOW_X_FORWARDED_FOR"]="--enable-follow-x-forwarded-for"
define["FOLLOW_X_FORWARDED_FOR&&DELAY_POOLS"]="--enable-follow-x-forwarded-for and --enable-delay-pools"
define["FOLLOW_X_FORWARDED_FOR&&ICAP_CLIENT"]="--enable-follow-x-forwarded-for and --enable-icap-client"
- define["HTTP_VIOLATIONS"]="--enable-http-violations"
+ define["USE_HTTP_VIOLATIONS"]="--enable-http-violations"
define["ICAP_CLIENT"]="--enable-icap-client"
define["SQUID_SNMP"]="--enable-snmp"
define["USE_ADAPTATION"]="--enable-ecap or --enable-icap-client"
if (request->header.has(HDR_EXPECT)) {
int ignore = 0;
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
if (Config.onoff.ignore_expect_100) {
String expect = request->header.getList(HDR_EXPECT);
if (expect.caseCmp("100-continue") == 0)
}
if (e->checkNegativeHit()
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
&& !r->flags.nocache_hack
#endif
) {
}
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
else if (r->flags.nocache_hack) {
}
-#endif /* HTTP_VIOLATIONS */
+#endif /* USE_HTTP_VIOLATIONS */
#if USE_CACHE_DIGESTS
lookup_type = http->storeEntry() ? "HIT" : "MISS";
}
if (no_cache) {
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
if (Config.onoff.reload_into_ims)
request->flags.nocache_hack = 1;
bool invalid_byte = false;
while (pos < hdr.size() && hdr[pos] != ';' && hdr[pos] != ',' && !xisspace(hdr[pos]) && dt < (dir+256) ) {
if (!invalid_byte) {
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
// if accepting violations we may as well accept some broken browsers
// which may send us the right code, wrong ISO formatting.
if (hdr[pos] == '_')
extern const char *StoreDigestMimeStr; /* "application/cache-digest" */
extern const char *MultipartMsgBoundaryStr; /* "Unique-Squid-Separator" */
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
extern int refresh_nocache_hack; /* 0 */
#endif
HttpHeader const *hdr = &rep->header;
const int cc_mask = (rep->cache_control) ? rep->cache_control->mask : 0;
const char *v;
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
const refresh_t *R = NULL;
/* This strange looking define first looks up the refresh pattern
* and then checks if the specified flag is set. The main purpose
- * of this is to simplify the refresh pattern lookup and HTTP_VIOLATIONS
+ * of this is to simplify the refresh pattern lookup and USE_HTTP_VIOLATIONS
* condition
*/
#define REFRESH_OVERRIDE(flag) \
case -1:
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
if (Config.negativeTtl > 0)
entry->cacheNegatively();
else
{
debugs(11,5, HERE << "doneSendingRequestBody: FD " << fd);
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
if (Config.accessList.brokenPosts) {
ACLFilledChecklist ch(Config.accessList.brokenPosts, request, NULL);
if (!ch.fastCheck()) {
return;
}
debugs(11, 5, "doneSendingRequestBody: No brokenPosts list");
-#endif /* HTTP_VIOLATIONS */
+#endif /* USE_HTTP_VIOLATIONS */
CommIoCbParams io(NULL);
io.fd=fd;
debugs(22, 3, "\tentry->timestamp:\t" << mkrfc1123(entry->timestamp));
if (EBIT_TEST(entry->flags, ENTRY_REVALIDATE) && staleness > -1
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
&& !R->flags.ignore_must_revalidate
#endif
) {
return STALE_FORCED_RELOAD;
}
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
if (!request->flags.nocache_hack) {
(void) 0;
#endif
if (NULL != cc) {
if (cc->max_age > -1) {
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
if (R->flags.ignore_reload && cc->max_age == 0) {} else
#endif
{
* the override options kicks in.
*/
if (sf.expires) {
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
if (R->flags.override_expire && age < R->min) {
debugs(22, 3, "refreshCheck: NO: age < min && override-expire");
return STALE_MAX_RULE;
if (sf.lmfactor) {
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
if (R->flags.override_lastmod && age < R->min) {
debugs(22, 3, "refreshCheck: NO: age < min && override-lastmod");
StoreEntry::negativeCache()
{
if (expires == 0)
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
expires = squid_curtime + Config.negativeTtl;
#else
expires = squid_curtime;
int64_t readAheadGap;
RemovalPolicySettings *replPolicy;
RemovalPolicySettings *memPolicy;
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
time_t negativeTtl;
#endif
time_t negativeDnsTtl;
int test_reachability;
int half_closed_clients;
int refresh_all_ims;
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
int reload_into_ims;
int ignore_expect_100;
acl_access *snmp;
#endif
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
acl_access *brokenPosts;
#endif
acl_access *redirector;
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),ignore_cc(0),intercepted(0),spoof_client_ip(0),internal(0),internalclient(0),must_keepalive(0),destinationIPLookedUp_(0) {
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
nocache_hack = 0;
#endif
#if FOLLOW_X_FORWARDED_FOR
unsigned int refresh:1;
unsigned int redirected:1;
unsigned int need_validation:1;
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
unsigned int nocache_hack:1; /* for changing/ignoring no-cache requests */
#endif
unsigned int accelerated:1;
struct {
unsigned int icase:1;
unsigned int refresh_ims:1;
-#if HTTP_VIOLATIONS
+#if USE_HTTP_VIOLATIONS
unsigned int override_expire:1;
unsigned int override_lastmod:1;
unsigned int reload_into_ims:1;