]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Miscenllaneous fixes for CNAME, include, and comm.
authoramosjeffries <>
Sat, 19 Jan 2008 14:11:34 +0000 (14:11 +0000)
committeramosjeffries <>
Sat, 19 Jan 2008 14:11:34 +0000 (14:11 +0000)
- Add more wrapping of CNAME code no longer needed.
- Fixes typo in include directive ported code.
- Fixes incorrect socket family setting on some accepted connections.

lib/rfc1035.c
src/cache_cf.cc
src/comm.cc

index 70d8c2b61c1fc1308615f0d2dc1c9a732d90dce5..1929e43df236fd2e0c6400a4263a388f08e0d206 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: rfc1035.c,v 1.53 2008/01/11 03:49:21 amosjeffries Exp $
+ * $Id: rfc1035.c,v 1.54 2008/01/19 07:11:34 amosjeffries Exp $
  *
  * Low level DNS protocol routines
  * AUTHOR: Duane Wessels
@@ -402,7 +402,9 @@ rfc1035RRUnpack(const char *buf, size_t sz, unsigned int *off, rfc1035_rr * RR)
     }
     RR->rdlength = rdlength;
     switch (RR->type) {
+#if DNS_CNAME
     case RFC1035_TYPE_CNAME:
+#endif
     case RFC1035_TYPE_PTR:
        RR->rdata = (char*)xmalloc(RFC1035_MAXHOSTNAMESZ);
        rdata_off = *off;
index 12198db1eed3f4ac3b07282737c6e346b68ac457..300005bb4713cb5e94bb89b076a5a4651ebc170f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.536 2008/01/18 12:37:08 amosjeffries Exp $
+ * $Id: cache_cf.cc,v 1.537 2008/01/19 07:11:34 amosjeffries Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -213,7 +213,7 @@ parseManyConfigFiles(char* files, int depth)
     char* file = strtok_r(files, w_space, &saveptr);
     while (file != NULL) {
         error_count += parseOneConfigFile(file, depth);
-        file = strtok_r(files, w_space, &saveptr);
+        file = strtok_r(NULL, w_space, &saveptr);
     }
     return error_count;
 }
index 03f0bbb03d198661f7173392b3fb24536e172da7..97382e2a4fdad8c11d6d3007d455c3b85f3e20d4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.441 2008/01/07 17:12:28 hno Exp $
+ * $Id: comm.cc,v 1.442 2008/01/19 07:11:35 amosjeffries Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -1469,6 +1469,8 @@ comm_old_accept(int fd, ConnectionDetail &details)
 
     details.peer = *gai;
 
+    details.me.InitAddrInfo(gai);
+
     details.me.SetEmpty();
     getsockname(sock, gai->ai_addr, &gai->ai_addrlen);
     details.me = *gai;
@@ -1484,12 +1486,15 @@ comm_old_accept(int fd, ConnectionDetail &details)
     details.peer.NtoA(F->ipaddr,MAX_IPSTRLEN);
     F->remote_port = details.peer.GetPort();
     F->local_addr.SetPort(details.me.GetPort());
-    F->sock_family = gai->ai_family;
+#if USE_IPV6
+    F->sock_family = AF_INET;
+#else
+    F->sock_family = details.me.IsIPv4()?AF_INET:AF_INET6;
+#endif
+    details.me.FreeAddrInfo(gai);
 
     commSetNonBlocking(sock);
 
-    details.me.FreeAddrInfo(gai);
-
     PROF_stop(comm_accept);
     return sock;
 }
@@ -2284,9 +2289,10 @@ fdc_t::acceptOne(int fd) {
         return;
     }
 
-    debugs(5, 5, "fdc_t::acceptOne accepted: FD " << fd << " handler: " << (void*)accept.accept.callback.handler << " newfd: " << newfd);
+    debugs(5, 5, HERE << "accepted: FD " << fd << " handler: " << (void*)accept.accept.callback.handler << " newfd: " << newfd << " from: " << accept.connDetails.peer);
 
     assert(accept.accept.callback.handler);
+
     accept.accept.doCallback(fd, newfd, COMM_OK, 0, &accept.connDetails);
 
     /* If we weren't re-registed, don't bother trying again! */