=== modified file 'scripts/www/build-cfg-help.pl' --- scripts/www/build-cfg-help.pl 2010-09-30 01:12:15 +0000 +++ scripts/www/build-cfg-help.pl 2010-10-15 10:33:54 +0000 @@ -305,6 +305,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}); } @@ -350,6 +351,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-10-15 10:24:57 +0000 +++ src/cache_cf.cc 2010-10-16 13:20:16 +0000 @@ -144,6 +144,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); @@ -890,6 +891,23 @@ #endif } +/** Parse a line containing an obsolete directive. + * To upgrade it where possible 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) +{ + // 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 + } 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. + } +} + /* 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-10-06 03:50:45 +0000 +++ src/cf.data.depend 2010-10-15 10:33:54 +0000 @@ -42,6 +42,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-10-15 10:24:57 +0000 +++ src/cf.data.pre 2010-10-16 13:17:54 +0000 @@ -96,6 +96,77 @@ across all Squid processes. COMMENT_END +# Options Removed in 3.2 +NAME: ignore_expect_100 +TYPE: obsolete +DOC_START + Remove this line. Since squid-3.2 the 'Expect: 100-continue' HTTP/1.1 + feature is handled by Squid. +DOC_END + +NAME: ftp_list_width +TYPE: obsolete +DOC_START + Remove this line. Since squid-3.2 configure FTP page display details + using the CSS controls in errorpages.css instead. +DOC_END + +NAME: url_rewrite_concurrency +TYPE: obsolete +DOC_START + Since squid-3.2 set the 'concurrency=' option of url_rewrite_children instead. +DOC_END + +# Options Removed in 3.1 +NAME: dns_testnames +TYPE: obsolete +DOC_START + Remove this line Since squid-3.1 DNS is not tested on startup. +DOC_END + +NAME: extension_methods +TYPE: obsolete +DOC_START + Remove this line. Since squid-3.1 all valid methods for HTTP are accepted. +DOC_END + +# 2.7 Options Removed/Replaced in 3.1 +NAME: incoming_rate +TYPE: obsolete +DOC_NONE + +NAME: server_http11 +TYPE: obsolete +DOC_START + Remove this line. Since squid-3.1 this is always performed. +DOC_END + +NAME: upgrade_http0.9 +TYPE: obsolete +DOC_START + Remove this line. Since squid-3.1 ICY streaming protocol is handled natively. +DOC_END + +NAME: zph_local zph_mode zph_option zph_parent zph_sibling +TYPE: obsolete +DOC_START + Since squid-3.1 use the qos_flows directive instead. +DOC_END + +# Options Removed in 3.0 +NAME: header_access +TYPE: obsolete +DOC_START + Since squid-3.0 replace with request_header_access or reply_header_access + depending on whether you wish to match client requests or server replies. +DOC_END + +NAME: httpd_accel_no_pmtu_disc +TYPE: obsolete +DOC_START + Since squid-3.0 use the 'disable-pmtu-discovery' flag on http_port instead. +DOC_END + COMMENT_START OPTIONS FOR AUTHENTICATION ----------------------------------------------------------------------------- === modified file 'src/cf_gen.cc' --- src/cf_gen.cc 2010-09-30 01:12:15 +0000 +++ src/cf_gen.cc 2010-10-16 12:41:21 +0000 @@ -347,6 +347,13 @@ 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; +// } + } else if (!strncmp(buff, "IFDEF:", 6)) { if ((ptr = strtok(buff + 6, WS)) == NULL) { printf("Error on line %d\n", linenum); @@ -556,6 +563,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; @@ -601,7 +611,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; @@ -636,7 +648,14 @@ { fprintf(fp, "\tif (!strcmp(token, \"%s\")) {\n", name); - if (strcmp(entry->loc, "none") == 0) { + if (strcmp(entry->type,"obsolete") == 0) { + fprintf(fp, "\t\tdebugs(0, DBG_CRITICAL, \"ERROR: Directive '%s' is obsolete.\");\n", name); + for (Line *line = entry->doc; line != NULL; line = line->next) { + // offset line to strip initial whitespace tab byte + fprintf(fp, "\t\tdebugs(0, opt_parse_cfg_only?0:1, \"%s : %s\");\n", name, &line->data[1]); + } + fprintf(fp, "\t\tparse_obsolete(token);\n"); + } else if (!entry->loc || strcmp(entry->loc, "none") == 0) { fprintf(fp, "\t\tparse_%s();\n", entry->type @@ -666,12 +685,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) { @@ -718,9 +735,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) @@ -753,9 +769,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) @@ -816,6 +830,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); === modified file 'src/globals.h' --- src/globals.h 2010-07-07 15:48:09 +0000 +++ src/globals.h 2010-10-16 03:13:55 +0000 @@ -170,6 +170,7 @@ extern const char *external_acl_message; /* NULL */ extern int opt_send_signal; /* -1 */ extern int opt_no_daemon; /* 0 */ + extern int opt_parse_cfg_only; /* 0 */ /// current Squid process number (e.g., 4). /// Zero for SMP-unaware code and in no-SMP mode. === modified file 'src/main.cc' --- src/main.cc 2010-10-07 13:07:12 +0000 +++ src/main.cc 2010-10-16 03:14:16 +0000 @@ -121,7 +121,6 @@ /** for error reporting from xmalloc and friends */ SQUIDCEXTERN void (*failure_notify) (const char *); -static int opt_parse_cfg_only = 0; static char *opt_syslog_facility = NULL; static int icpPortNumOverride = 1; /* Want to detect "-u 0" */ static int configured_once = 0;