From: Francesco Chemolli Date: Fri, 14 May 2010 09:47:03 +0000 (+0200) Subject: Renamed HTTP_VIOLATIONS define to standard USE_HTTP_VIOLATIONS X-Git-Tag: take1~402^2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=626096bef38ec2d91d2684e6902f802c56395b95;p=thirdparty%2Fsquid.git Renamed HTTP_VIOLATIONS define to standard USE_HTTP_VIOLATIONS --- diff --git a/configure.in b/configure.in index 220f85128b..e5ff0e86a8 100644 --- a/configure.in +++ b/configure.in @@ -1267,7 +1267,7 @@ AC_ARG_ENABLE(http-violations, 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]) diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 2f8a1c1f1d..888bf9c5ea 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -142,7 +142,7 @@ static size_t parseBytesUnits(const char *unit); 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[]); @@ -550,7 +550,7 @@ configDoConfigure(void) if (Config.errorDirectory) requirePathnameExists("Error Directory", Config.errorDirectory); -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS { const refresh_t *R; @@ -636,7 +636,7 @@ configDoConfigure(void) } #endif -#if !HTTP_VIOLATIONS +#if !USE_HTTP_VIOLATIONS Config.onoff.via = 1; #else @@ -1278,7 +1278,7 @@ parse_delay_pool_access(DelayConfig * cfg) #endif -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS static void dump_http_header_access(StoreEntry * entry, const char *name, header_mangler header[]) { @@ -2254,7 +2254,7 @@ dump_refreshpattern(StoreEntry * entry, const char *name, refresh_t * head) 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"); @@ -2300,7 +2300,7 @@ parse_refreshpattern(refresh_t ** head) 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; @@ -2355,7 +2355,7 @@ parse_refreshpattern(refresh_t ** head) 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; @@ -2408,7 +2408,7 @@ parse_refreshpattern(refresh_t ** head) if (refresh_ims) t->flags.refresh_ims = 1; -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS if (override_expire) t->flags.override_expire = 1; @@ -2461,7 +2461,7 @@ free_refreshpattern(refresh_t ** head) safe_free(t); } -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS refresh_nocache_hack = 0; #endif @@ -3082,7 +3082,7 @@ parse_http_port_option(http_port_list * s, char *token) } 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(); diff --git a/src/cf.data.pre b/src/cf.data.pre index 32b93edba5..f0828108b7 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -3587,7 +3587,7 @@ DOC_START DOC_END NAME: negative_ttl -IFDEF: HTTP_VIOLATIONS +IFDEF: USE_HTTP_VIOLATIONS COMMENT: time-units TYPE: time_t LOC: Config.negativeTtl @@ -3780,7 +3780,7 @@ DOC_START DOC_END NAME: broken_posts -IFDEF: HTTP_VIOLATIONS +IFDEF: USE_HTTP_VIOLATIONS TYPE: acl_access DEFAULT: none LOC: Config.accessList.brokenPosts @@ -3820,7 +3820,7 @@ DOC_START DOC_END NAME: via -IFDEF: HTTP_VIOLATIONS +IFDEF: USE_HTTP_VIOLATIONS COMMENT: on|off TYPE: onoff DEFAULT: on @@ -3887,7 +3887,7 @@ DOC_START DOC_END NAME: request_header_access -IFDEF: HTTP_VIOLATIONS +IFDEF: USE_HTTP_VIOLATIONS TYPE: http_header_access[] LOC: Config.request_header_access DEFAULT: none @@ -3960,7 +3960,7 @@ DOC_START DOC_END NAME: reply_header_access -IFDEF: HTTP_VIOLATIONS +IFDEF: USE_HTTP_VIOLATIONS TYPE: http_header_access[] LOC: Config.reply_header_access DEFAULT: none @@ -4036,7 +4036,7 @@ DOC_START DOC_END NAME: header_replace -IFDEF: HTTP_VIOLATIONS +IFDEF: USE_HTTP_VIOLATIONS TYPE: http_header_replace[] LOC: Config.request_header_access DEFAULT: none @@ -4075,7 +4075,7 @@ DOC_END NAME: ignore_expect_100 COMMENT: on|off -IFDEF: HTTP_VIOLATIONS +IFDEF: USE_HTTP_VIOLATIONS TYPE: onoff LOC: Config.onoff.ignore_expect_100 DEFAULT: off @@ -6739,7 +6739,7 @@ DOC_START DOC_END NAME: reload_into_ims -IFDEF: HTTP_VIOLATIONS +IFDEF: USE_HTTP_VIOLATIONS COMMENT: on|off TYPE: onoff DEFAULT: off diff --git a/src/cf_gen_defines b/src/cf_gen_defines index fc6a9d4382..c8ca74772c 100644 --- a/src/cf_gen_defines +++ b/src/cf_gen_defines @@ -9,7 +9,7 @@ BEGIN { 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" diff --git a/src/client_side.cc b/src/client_side.cc index 6059e22008..e6927eeff5 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -2501,7 +2501,7 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c 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) diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 6962571c13..1608569f15 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -509,7 +509,7 @@ clientReplyContext::cacheHit(StoreIOBuffer result) } if (e->checkNegativeHit() -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS && !r->flags.nocache_hack #endif ) { @@ -1502,7 +1502,7 @@ clientReplyContext::identifyFoundObject(StoreEntry *newEntry) } -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS else if (r->flags.nocache_hack) { @@ -1518,7 +1518,7 @@ clientReplyContext::identifyFoundObject(StoreEntry *newEntry) } -#endif /* HTTP_VIOLATIONS */ +#endif /* USE_HTTP_VIOLATIONS */ #if USE_CACHE_DIGESTS lookup_type = http->storeEntry() ? "HIT" : "MISS"; diff --git a/src/client_side_request.cc b/src/client_side_request.cc index b2a3d27a85..a3f9b4a40c 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -874,7 +874,7 @@ clientInterpretRequestHeaders(ClientHttpRequest * http) } if (no_cache) { -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS if (Config.onoff.reload_into_ims) request->flags.nocache_hack = 1; diff --git a/src/errorpage.cc b/src/errorpage.cc index 9df2866897..1e2d5228b6 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -995,7 +995,7 @@ ErrorState::BuildContent() 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] == '_') diff --git a/src/globals.h b/src/globals.h index 7eea3cb10d..482695071f 100644 --- a/src/globals.h +++ b/src/globals.h @@ -132,7 +132,7 @@ extern "C" { 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 diff --git a/src/http.cc b/src/http.cc index d10bea993f..9379b49b3d 100644 --- a/src/http.cc +++ b/src/http.cc @@ -350,13 +350,13 @@ HttpStateData::cacheableReply() 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) \ @@ -882,7 +882,7 @@ HttpStateData::haveParsedReplyHeaders() case -1: -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS if (Config.negativeTtl > 0) entry->cacheNegatively(); else @@ -2084,7 +2084,7 @@ HttpStateData::doneSendingRequestBody() { 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()) { @@ -2103,7 +2103,7 @@ HttpStateData::doneSendingRequestBody() return; } debugs(11, 5, "doneSendingRequestBody: No brokenPosts list"); -#endif /* HTTP_VIOLATIONS */ +#endif /* USE_HTTP_VIOLATIONS */ CommIoCbParams io(NULL); io.fd=fd; diff --git a/src/refresh.cc b/src/refresh.cc index 7891c34ee8..5f54672515 100644 --- a/src/refresh.cc +++ b/src/refresh.cc @@ -272,7 +272,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta) 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 ) { @@ -290,7 +290,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta) return STALE_FORCED_RELOAD; } -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS if (!request->flags.nocache_hack) { (void) 0; @@ -311,7 +311,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta) #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 { @@ -368,7 +368,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta) * 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"); @@ -383,7 +383,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta) 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"); diff --git a/src/store.cc b/src/store.cc index 5fcea64c76..ab8d7fd275 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1452,7 +1452,7 @@ void StoreEntry::negativeCache() { if (expires == 0) -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS expires = squid_curtime + Config.negativeTtl; #else expires = squid_curtime; diff --git a/src/structs.h b/src/structs.h index 4217ff81d3..12f160fa69 100644 --- a/src/structs.h +++ b/src/structs.h @@ -153,7 +153,7 @@ struct SquidConfig { int64_t readAheadGap; RemovalPolicySettings *replPolicy; RemovalPolicySettings *memPolicy; -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS time_t negativeTtl; #endif time_t negativeDnsTtl; @@ -390,7 +390,7 @@ struct SquidConfig { 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; @@ -457,7 +457,7 @@ struct SquidConfig { acl_access *snmp; #endif -#if HTTP_VIOLATIONS +#if USE_HTTP_VIOLATIONS acl_access *brokenPosts; #endif acl_access *redirector; @@ -1000,7 +1000,7 @@ struct _iostats { 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 @@ -1021,7 +1021,7 @@ unsigned int proxying: 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; @@ -1082,7 +1082,7 @@ struct _refresh_t { 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;