]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1143: Squid returns random error messages on request for http://./
authorhno <>
Fri, 10 Dec 2004 07:54:04 +0000 (07:54 +0000)
committerhno <>
Fri, 10 Dec 2004 07:54:04 +0000 (07:54 +0000)
src/fqdncache.cc
src/ipcache.cc

index 7d9e8a5a50a0c27c7d8186d32d074735bccddafe..8ca63ec3b0ae06d97c687d338315ecdabe92bfce 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.159 2004/04/10 13:10:17 hno Exp $
+ * $Id: fqdncache.cc,v 1.160 2004/12/10 00:54:04 hno Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -441,6 +441,7 @@ fqdncache_nbgethostbyaddr(struct in_addr addr, FQDNH * handler, void *handlerDat
     if (name == NULL || name[0] == '\0')
     {
         debug(35, 4) ("fqdncache_nbgethostbyaddr: Invalid name!\n");
+        dns_error_message = "Invalid hostname";
         handler(NULL, handlerData);
         return;
     }
@@ -553,10 +554,14 @@ fqdncache_gethostbyaddr(struct in_addr addr, int flags)
     {
         FqdncacheStats.hits++;
         f->lastref = squid_curtime;
+        dns_error_message = f->error_message;
         return f->names[0];
     }
 
+    dns_error_message = NULL;
+
     /* check if it's already a FQDN address in text form. */
+
     if (!safe_inet_addr(name, &ip))
         return name;
 
index c6635f6f7d4038dd498912349799a8e856357d88..a610a6af25de9d6f1bd57b10c4240190a74d21ed 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipcache.cc,v 1.246 2004/10/18 12:20:10 hno Exp $
+ * $Id: ipcache.cc,v 1.247 2004/12/10 00:54:04 hno Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -490,11 +490,13 @@ ipcache_nbgethostbyname(const char *name, IPH * handler, void *handlerData)
 
     if (name == NULL || name[0] == '\0') {
         debug(14, 4) ("ipcache_nbgethostbyname: Invalid name!\n");
+        dns_error_message = "Invalid hostname";
         handler(NULL, handlerData);
         return;
     }
 
     if ((addrs = ipcacheCheckNumeric(name))) {
+        dns_error_message = NULL;
         handler(addrs, handlerData);
         return;
     }
@@ -599,9 +601,12 @@ ipcache_gethostbyname(const char *name, int flags)
     } else {
         IpcacheStats.hits++;
         i->lastref = squid_curtime;
+        dns_error_message = i->error_message;
         return &i->addrs;
     }
 
+    dns_error_message = NULL;
+
     if ((addrs = ipcacheCheckNumeric(name)))
         return addrs;