]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Adding fqdnFromAddr() to be used for hostnames in error messages
authorwessels <>
Sat, 27 Jul 1996 01:29:54 +0000 (01:29 +0000)
committerwessels <>
Sat, 27 Jul 1996 01:29:54 +0000 (01:29 +0000)
src/comm.cc
src/fqdncache.cc

index 7ded7e0b2ad611e18f0d0bfd3088a13e6d93fa1a..25bdb2480f468692e7fa6103581d8c88055ef516 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: comm.cc,v 1.47 1996/07/25 07:10:30 wessels Exp $
+ * $Id: comm.cc,v 1.48 1996/07/26 19:29:54 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -404,7 +404,7 @@ int comm_connect_addr(sock, address)
                errno = x;
        default:
            debug(5, 1, "connect: %s:%d: %s.\n",
-               inet_ntoa(address->sin_addr),
+               fqdnFromAddr(address->sin_addr),
                ntohs(address->sin_port),
                xstrerror());
            return COMM_ERROR;
index 7eb992283d10721f0e5eab42ed275c23fff9adc0..87674f0369865a7e040d9e868f5e5bc11097d336 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.4 1996/07/25 07:10:33 wessels Exp $
+ * $Id: fqdncache.cc,v 1.5 1996/07/26 19:29:55 wessels Exp $
  *
  * DEBUG: section 34    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -1025,3 +1025,12 @@ void fqdncacheReleaseInvalid(name)
        return;
     fqdncache_release(f);
 }
+
+char *fqdnFromAddr(addr)
+     struct in_addr addr;
+{
+    char *n;
+    if ((n = fqdncache_gethostbyaddr(addr, 0)))
+       return n;
+    return inet_ntoa(addr);
+}