From: Amos Jeffries Date: Wed, 20 Apr 2011 06:07:08 +0000 (+1200) Subject: Add errpages option %b for proxy listening port X-Git-Tag: take07~16^2~57 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=88d1e459293cf476300bba80d1fe6da05c862647;p=thirdparty%2Fsquid.git Add errpages option %b for proxy listening port Use getMyPort() to insert the forward-proxy listening port into error pages and deny_info redirect URLs. This fixes the current port hard-coding assumption in ERR_AGENT_CONFIGURE. The %b option is added for this purpose as a temporary measure until the codes are merged with the more flexible log formatting set. This currently depends on squid.conf having a particular http_port ordering with the forward-proxy port listed first. --- diff --git a/errors/templates/ERR_AGENT_CONFIGURE b/errors/templates/ERR_AGENT_CONFIGURE index f25410b834..29df4947fd 100644 --- a/errors/templates/ERR_AGENT_CONFIGURE +++ b/errors/templates/ERR_AGENT_CONFIGURE @@ -27,7 +27,7 @@ body For Firefox browsers go to: @@ -35,7 +35,7 @@ For Firefox browsers go to: For Internet Explorer browsers go to: @@ -43,7 +43,7 @@ For Internet Explorer browsers go to: For Opera browsers go to: diff --git a/src/errorpage.cc b/src/errorpage.cc index 280b16219f..8c8308b802 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -670,6 +670,11 @@ ErrorState::Convert(char token, bool building_deny_info_url, bool allowRecursion #endif p = "-"; break; + + case 'b': + mb.Printf("%d", getMyPort()); + break; + case 'B': if (building_deny_info_url) break; p = request ? ftpUrlWith2f(request) : "[no URL]";