]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
url_rewrite_extras and store_id_extras patch fixes
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 13 Mar 2014 10:56:38 +0000 (12:56 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 13 Mar 2014 10:56:38 +0000 (12:56 +0200)
Fixes to patch "Add url_rewrite_extras and store_id_extras for redirector and store_id helpers",r13308:
  - Fix cf_gen.cc:gen_conf(..) function to not escape quotes before write to
    conf file
  - The Format::Format name is used to inform the user about parsing problems.
    Fix the names of related objects for the new redirecor_extras and
    store_id_extras directives.
  - cf.data.pre: The NAME tag take as argument only the name of directive. Fix
    the new redirecor_extras and store_id_extras related tags.

src/cf.data.pre
src/cf_gen.cc
src/redirect.cc

index 2a8ef198a88c211bd0635c2a0ec2e31b74f9810c..194ee1696a2e9c7301e97d89dbd10a1ed7e12c85 100644 (file)
@@ -4755,7 +4755,7 @@ DOC_START
        be allowed to request.
 DOC_END
 
-NAME: url_rewrite_extras format
+NAME: url_rewrite_extras
 TYPE: TokenOrQuotedString
 LOC: Config.redirector_extras
 DEFAULT: "%>a/%>A %un %>rm myip=%la myport=%lp"
@@ -4820,7 +4820,7 @@ DOC_START
        By default, a StoreID helper is not used.
 DOC_END
 
-NAME: store_id_extras format
+NAME: store_id_extras
 TYPE: TokenOrQuotedString
 LOC: Config.storeId_extras
 DEFAULT: "%>a/%>A %un %>rm myip=%la myport=%lp"
index cdb3c38b4f7047ff4a25d6c7bc999bd1ee01a86c..50a49ba33c0832f68df9ebb1f4550cd7cc58f20b 100644 (file)
@@ -823,13 +823,13 @@ gen_conf(const EntryList &head, std::ostream &fout, bool verbose_output)
             if (entry->defaults.preset.size() && entry->defaults.preset.front().compare("none") != 0) {
                 // Display DEFAULT: line(s)
                 for (LineList::const_iterator l = entry->defaults.preset.begin(); l != entry->defaults.preset.end(); ++l) {
-                    snprintf(buf, sizeof(buf), "%s %s", entry->name.c_str(), gen_quote_escape(*l));
+                    snprintf(buf, sizeof(buf), "%s %s", entry->name.c_str(), l->c_str());
                     def.push_back(buf);
                 }
             } else if (entry->defaults.if_none.size()) {
                 // Display DEFAULT_IF_NONE: line(s)
                 for (LineList::const_iterator l = entry->defaults.if_none.begin(); l != entry->defaults.if_none.end(); ++l) {
-                    snprintf(buf, sizeof(buf), "%s %s", entry->name.c_str(), gen_quote_escape(*l));
+                    snprintf(buf, sizeof(buf), "%s %s", entry->name.c_str(), l->c_str());
                     def.push_back(buf);
                 }
             }
index 1ebd680d44ba2da68ec0948b7127b520b086c63c..1c7fd18ff3a0fb075b7191683818e244cb0e809b 100644 (file)
@@ -423,12 +423,12 @@ redirectInit(void)
     }
 
     if (Config.redirector_extras) {
-        redirectorExtrasFmt = new ::Format::Format("redirecor_extras");
+        redirectorExtrasFmt = new ::Format::Format("url_rewrite_extras");
         (void)redirectorExtrasFmt->parse(Config.redirector_extras);
     }
 
     if (Config.storeId_extras) {
-        storeIdExtrasFmt = new ::Format::Format("storeId_extras");
+        storeIdExtrasFmt = new ::Format::Format("store_id_extras");
         (void)storeIdExtrasFmt->parse(Config.storeId_extras);
     }