From: Amos Jeffries Date: Mon, 27 Jan 2014 03:06:15 +0000 (-0700) Subject: Add ${service_name} macro to squid.conf processing X-Git-Tag: SQUID_3_5_0_1~398 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6fe8c876bbd77132b1497770a01909f3fede641d;p=thirdparty%2Fsquid.git Add ${service_name} macro to squid.conf processing This allows squid.conf directives to be configured per-service by expanding into the -n service_name parameter. The default is "squid". --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 667b7b3b82..7b1f453a45 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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)); } diff --git a/src/cf.data.pre b/src/cf.data.pre index d6daf26557..47eaf70db8 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -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