]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Thu, 7 Sep 2000 10:27:30 +0000 (10:27 +0000)
committerwessels <>
Thu, 7 Sep 2000 10:27:30 +0000 (10:27 +0000)
 - 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.

src/url.cc

index bbb4801259439494a14e327aefaadcc486e61af7..92433a427c3653ea3561d8df17d9f677aefbf926 100644 (file)
@@ -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) {