]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add ${service_name} macro to squid.conf processing
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 27 Jan 2014 03:06:15 +0000 (20:06 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 27 Jan 2014 03:06:15 +0000 (20:06 -0700)
This allows squid.conf directives to be configured per-service by
expanding into the -n service_name parameter. The default is "squid".

src/cache_cf.cc
src/cf.data.pre

index 667b7b3b82abce9fa9a3b1ea3e06aa40f05953b7..7b1f453a458c83609d6436fdeba5f65a5794f6f6 100644 (file)
@@ -379,6 +379,7 @@ SubstituteMacro(char*& line, int& len, const char* macroName, const char* substS
 static void
 ProcessMacros(char*& line, int& len)
 {
+    SubstituteMacro(line, len, "${service_name}", service_name);
     SubstituteMacro(line, len, "${process_name}", TheKidName);
     SubstituteMacro(line, len, "${process_number}", xitoa(KidIdentifier));
 }
index d6daf26557a5c0a753e0888e17278411de22060d..47eaf70db85255c1dd462f37138ef519462f62bf 100644 (file)
@@ -114,7 +114,11 @@ COMMENT_START
 
        ${process_number} expands to the current Squid process
        identifier, which is an integer number (e.g., 1, 2, 3) unique
-       across all Squid processes.
+       across all Squid processes of the current service instance.
+
+       ${service_name} expands into the current Squid service instance
+       name identifier which is provided by -n on the command line.
+
 COMMENT_END
 
 # options still not yet ported from 2.7 to 3.x