]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
%I shows hostname on SSL error page
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 7 Sep 2011 12:42:29 +0000 (15:42 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 7 Sep 2011 12:42:29 +0000 (15:42 +0300)
The %I must print the server ip address, but currently displays the host name of
the server on squid error pages. This patch fixes %I to print the server ip
address in the server or "[unknown]" otherwise.

This is a Measurement Factory project

src/errorpage.cc

index 2574743ce3e5be24c89b75756b565668a17af7e0..da21e207c8d6d0dddc75ed1cb53545139f7e9939 100644 (file)
@@ -892,8 +892,8 @@ ErrorState::Convert(char token, bool building_deny_info_url, bool allowRecursion
         break;
 
     case 'I':
-        if (request && request->hier.host[0] != '\0') // if non-empty string
-            mb.Printf("%s", request->hier.host);
+        if (request && request->hier.tcpServer != NULL)
+            p = request->hier.tcpServer->remote.NtoA(ntoabuf,MAX_IPSTRLEN);
         else if (!building_deny_info_url)
             p = "[unknown]";
         break;