From: Christos Tsantilas Date: Wed, 7 Sep 2011 12:42:29 +0000 (+0300) Subject: %I shows hostname on SSL error page X-Git-Tag: take08~4^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=72e4bea18f6be9e61f6bcbc7a64d0ed2901274a8;p=thirdparty%2Fsquid.git %I shows hostname on SSL error page 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 --- diff --git a/src/errorpage.cc b/src/errorpage.cc index 2574743ce3..da21e207c8 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -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;