]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add errpages option %b for proxy listening port
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 20 Apr 2011 06:07:08 +0000 (18:07 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 20 Apr 2011 06:07:08 +0000 (18:07 +1200)
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.

errors/templates/ERR_AGENT_CONFIGURE
src/errorpage.cc

index f25410b834044b57712ffa525089eecd67ef9fe1..29df4947fdf738be4f1e702607ebb7767a29dcdd 100644 (file)
@@ -27,7 +27,7 @@ body
 For Firefox browsers go to:
 <ul>
 <li>Tools -&gt; Options -&gt; Advanced -&gt; Network -&gt; Connection Settings</li>
-<li>In the HTTP proxy box type the proxy name %h and port 3128.</li>
+<li>In the HTTP proxy box type the proxy name %h and port %b.</li>
 </ul>
 </div>
 
@@ -35,7 +35,7 @@ For Firefox browsers go to:
 For Internet Explorer browsers go to:
 <ul>
 <li>Tools -&gt; Internet Options -&gt; Connection -&gt; LAN Settings -&gt;Proxy</li>
-<li>In the HTTP proxy box type the proxy name %h and port 3128.</li>
+<li>In the HTTP proxy box type the proxy name %h and port %b.</li>
 </ul>
 </div>
 
@@ -43,7 +43,7 @@ For Internet Explorer browsers go to:
 For Opera browsers go to:
 <ul>
 <li>Tools -&gt; Preferences -&gt; Advanced -&gt; Network -&gt; Proxy Servers</li>
-<li>In the HTTP proxy box type the proxy name %h and port 3128.</li>
+<li>In the HTTP proxy box type the proxy name %h and port %b.</li>
 </ul>
 </div>
 
index 280b16219feb2c9715cc8f5cd6cee697d10f3a15..8c8308b80217ad84a91b6b84d9e76cfe50fed1e4 100644 (file)
@@ -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]";