From: wessels <> Date: Thu, 7 Sep 2000 10:27:30 +0000 (+0000) Subject: DW: X-Git-Tag: SQUID_3_0_PRE1~1860 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=38b2f2c64bdb731d4457c8061c07fc302e5bfec7;p=thirdparty%2Fsquid.git DW: - This change collapses multiple dots in hostnames to single dots. For example www....foo....com becomes www.foo.com. This only recently became a problem with internal DNS lookups. gethostbyname() seems to generate a failure for multiple-dotted hostnames, but Squid's internal DNS code does not. --- diff --git a/src/url.cc b/src/url.cc index bbb4801259..92433a427c 100644 --- a/src/url.cc +++ b/src/url.cc @@ -1,6 +1,6 @@ /* - * $Id: url.cc,v 1.127 2000/07/18 06:16:42 wessels Exp $ + * $Id: url.cc,v 1.128 2000/09/07 04:27:30 wessels Exp $ * * DEBUG: section 23 URL Parsing * AUTHOR: Duane Wessels @@ -305,6 +305,9 @@ urlParse(method_t method, char *url) /* remove trailing dots from hostnames */ while ((l = strlen(host)) > 0 && host[--l] == '.') host[l] = '\0'; + /* remove duplicate dots */ + while ((t = strstr(host, ".."))) + xmemmove(t, t + 1, strlen(t)); if (Config.appendDomain && !strchr(host, '.')) strncat(host, Config.appendDomain, SQUIDHOSTNAMELEN); if (port == 0) {