=== modified file 'scripts/www/build-cfg-help.pl'
--- scripts/www/build-cfg-help.pl 2009-01-21 03:47:47 +0000
+++ scripts/www/build-cfg-help.pl 2010-09-21 06:59:22 +0000
@@ -302,6 +302,7 @@
# and now, build the option pages
my (@names) = keys %option;
foreach $name (@names) {
+ next if $option{$name}->{'type'} eq "obsolete";
generate_page("${top}/${pagetemplate}", $option{$name});
}
@@ -347,6 +348,7 @@
foreach $name (sort keys %all_names) {
my ($data) = $all_names{$name};
+ next if $data->{'type'} eq "obsolete";
print $fh '
' . htmlescape($name) . "\n";
}
=== modified file 'src/cache_cf.cc'
--- src/cache_cf.cc 2010-08-25 03:08:37 +0000
+++ src/cache_cf.cc 2010-09-21 09:41:44 +0000
@@ -139,6 +139,7 @@
static void default_all(void);
static void defaults_if_none(void);
static int parse_line(char *);
+static void parse_obsolete(const char *);
static void parseBytesLine(size_t * bptr, const char *units);
static size_t parseBytesUnits(const char *unit);
static void free_all(void);
@@ -879,6 +880,32 @@
#endif
}
+/** Parse a line containing an obsolete directive.
+ * To upgrade it where possible and emit an obsoletion warning
+ * instead of just "Bungled config" for directives which cannot be
+ * marked as simply aliases of the some name.
+ * For example if the parameter order and content has changed.
+ * Or if the directive has been completely removed.
+ */
+void
+parse_obsolete(const char *name)
+{
+ debugs(0, DBG_CRITICAL, "ERROR: Directive '" << name << "' is obsolete.");
+
+ // Directives which have been radically changed rather than removed
+ if (!strcmp(name, "url_rewrite_concurrency")) {
+ // TODO: we secretly do know where to place this item. parse it and display full url_rewrite_children
+ debugs(0, DBG_IMPORTANT, "UPGRADE: Replace '" << name << "' with url_rewrite_children concurrency= option.");
+ } else if (!strcmp(name, "header_access")) {
+ // TODO: pull header name out of line. Figure out if its a req or rep header. suggest relevant ones.
+ debugs(0, DBG_IMPORTANT, "UPGRADE: Maybe replace '" << name << "' with request_header_access.");
+ debugs(0, DBG_IMPORTANT, "UPGRADE: Maybe replace '" << name << "' with reply_header_access.");
+ } else if (!strcmp(name, "httpd_accel_no_pmtu_disc")) {
+ debugs(0, DBG_IMPORTANT, "UPGRADE: Replace '" << name << "' with 'disable-pmtu-discovery' flag on http_port.");
+ } else
+ debugs(0, DBG_IMPORTANT, "UPGRADE: Remove '" << name << "'.");
+}
+
/* Parse a time specification from the config file. Store the
* result in 'tptr', after converting it to 'units' */
static void
=== modified file 'src/cf.data.depend'
--- src/cf.data.depend 2010-04-05 10:29:50 +0000
+++ src/cf.data.depend 2010-09-21 06:50:41 +0000
@@ -39,6 +39,7 @@
kb_size_t
logformat
memcachemode
+obsolete
onoff
peer
peer_access cache_peer acl
=== modified file 'src/cf.data.pre'
--- src/cf.data.pre 2010-09-16 21:43:19 +0000
+++ src/cf.data.pre 2010-09-21 10:01:20 +0000
@@ -96,6 +96,23 @@
across all Squid processes.
COMMENT_END
+# Options Removed in 3.2
+NAME: url_rewrite_concurrency ftp_list_width ignore_expect_100
+TYPE: obsolete
+
+# Options Removed in 3.1
+NAME: dns_testnames extension_methods
+TYPE: obsolete
+
+# 2.7 Options Removed/Replaced in 3.1
+NAME: incoming_rate server_http11 upgrade_http0.9 zph_local zph_mode zph_option zph_parent zph_sibling
+TYPE: obsolete
+
+# Options Removed in 3.0
+NAME: httpd_accel_no_pmtu_disc header_access
+TYPE: obsolete
+
+
COMMENT_START
OPTIONS FOR AUTHENTICATION
-----------------------------------------------------------------------------
=== modified file 'src/cf_gen.cc'
--- src/cf_gen.cc 2010-07-23 05:04:43 +0000
+++ src/cf_gen.cc 2010-09-21 07:47:35 +0000
@@ -347,6 +347,14 @@
checkDepend(curr->name, ptr, types, entries);
curr->type = xstrdup(ptr);
+
+ if (strcmp(ptr, "obsolete") == 0) {
+ /* add to list of entries */
+ curr->next = entries;
+ entries = curr;
+ state = sSTART;
+ }
+
} else if (!strncmp(buff, "IFDEF:", 6)) {
if ((ptr = strtok(buff + 6, WS)) == NULL) {
printf("Error on line %d\n", linenum);
@@ -556,6 +564,9 @@
if (!strcmp(entry->name, "comment"))
continue;
+ if (!strcmp(entry->type, "obsolete"))
+ continue;
+
if (entry->loc == NULL) {
fprintf(stderr, "NO LOCATION FOR %s\n", entry->name);
rc |= 1;
@@ -603,7 +614,9 @@
for (entry = head; entry != NULL; entry = entry->next) {
assert(entry->name);
- assert(entry->loc);
+
+ if (!entry->loc)
+ continue;
if (entry->default_if_none == NULL)
continue;
@@ -638,7 +651,9 @@
{
fprintf(fp, "\tif (!strcmp(token, \"%s\")) {\n", name);
- if (strcmp(entry->loc, "none") == 0) {
+ if (strcmp(entry->type,"obsolete") == 0) {
+ fprintf(fp, "\t\tparse_obsolete(token);\n");
+ } else if (!entry->loc || strcmp(entry->loc, "none") == 0) {
fprintf(fp,
"\t\tparse_%s();\n",
entry->type
@@ -668,12 +683,10 @@
EntryAlias *alias = entry->alias;
- assert (entry->loc);
-
bool more;
do {
- gen_parse_alias (name, alias,entry, fp);
+ gen_parse_alias(name, alias, entry, fp);
more = false;
if (alias) {
@@ -720,9 +733,8 @@
);
for (entry = head; entry != NULL; entry = entry->next) {
- assert(entry->loc);
- if (strcmp(entry->loc, "none") == 0)
+ if (!entry->loc || strcmp(entry->loc, "none") == 0)
continue;
if (strcmp(entry->name, "comment") == 0)
@@ -755,9 +767,7 @@
);
for (entry = head; entry != NULL; entry = entry->next) {
- assert(entry->loc);
-
- if (strcmp(entry->loc, "none") == 0)
+ if (!entry->loc || strcmp(entry->loc, "none") == 0)
continue;
if (strcmp(entry->name, "comment") == 0)
@@ -818,6 +828,8 @@
if (!strcmp(entry->name, "comment"))
(void) 0;
+ else if (!strcmp(entry->name, "obsolete"))
+ (void) 0;
else if (verbose_output) {
fprintf(fp, "# TAG: %s", entry->name);