--------------------- PatchSet 4413 Date: 2007/04/29 05:47:32 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Use of debugs stream allows a much smaller stack footprint here now. Fixed some compile errors with debugs use. Members: include/IPAddress.h:1.1.2.16->1.1.2.17 lib/IPAddress.cc:1.1.2.31->1.1.2.32 src/ACLARP.cc:1.9.4.8->1.9.4.9 src/ACLIP.cc:1.8.2.25->1.8.2.26 src/ACLSourceDomain.cc:1.3.12.5->1.3.12.6 src/AuthUser.cc:1.1.8.5->1.1.8.6 src/AuthUserRequest.cc:1.2.4.11->1.2.4.12 src/asn.cc:1.16.6.16->1.16.6.17 src/comm.cc:1.47.2.20->1.47.2.21 src/dns_internal.cc:1.15.6.14->1.15.6.15 src/fqdncache.cc:1.9.2.13->1.9.2.14 src/htcp.cc:1.15.6.6->1.15.6.7 src/ipcache.cc:1.9.2.20->1.9.2.21 src/peer_digest.cc:1.11.4.6->1.11.4.7 src/tools.cc:1.22.2.14->1.22.2.15 Index: squid3/include/IPAddress.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/include/Attic/IPAddress.h,v retrieving revision 1.1.2.16 retrieving revision 1.1.2.17 diff -u -r1.1.2.16 -r1.1.2.17 --- squid3/include/IPAddress.h 28 Apr 2007 14:46:13 -0000 1.1.2.16 +++ squid3/include/IPAddress.h 29 Apr 2007 05:47:32 -0000 1.1.2.17 @@ -1,6 +1,6 @@ /* - * $Id: IPAddress.h,v 1.1.2.16 2007/04/28 14:46:13 amosjeffries Exp $ + * $Id: IPAddress.h,v 1.1.2.17 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 14 IP Storage and Handling * AUTHOR: Amos Jeffries @@ -50,7 +50,7 @@ #include #endif -#include +#include /// Test to verify the build configure options are correct. // COMMENT THE FOLLOW LINE TO TEST: @@ -269,12 +269,6 @@ */ bool GetReverseString(char buf[], IPAddressType show_format = None) const; -#ifdef _GLIBCXX_IOSTREAM - - std::ostream& operator<<(std::ostream& os) const; -#endif - - /** Test how two IP relate to each other. * \retval 0 IP are equal * \retval 1 IP rhs is greater (numerically) than that stored. @@ -329,6 +323,14 @@ #endif }; +inline std::ostream & +operator << (std::ostream &os, IPAddress const &ipa) +{ + char buf[MAX_IPSTRLEN]; + os << ipa.ToURL(buf,MAX_IPSTRLEN); + return os; +} + // Nasty hack. But there is no easy way around it yet. #define NEEDS_BRACKETS(x) (strchr(x,':')!=0) Index: squid3/lib/IPAddress.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/lib/Attic/IPAddress.cc,v retrieving revision 1.1.2.31 retrieving revision 1.1.2.32 diff -u -r1.1.2.31 -r1.1.2.32 --- squid3/lib/IPAddress.cc 28 Apr 2007 15:46:22 -0000 1.1.2.31 +++ squid3/lib/IPAddress.cc 29 Apr 2007 05:47:32 -0000 1.1.2.32 @@ -1,6 +1,6 @@ /* - * $Id: IPAddress.cc,v 1.1.2.31 2007/04/28 15:46:22 amosjeffries Exp $ + * $Id: IPAddress.cc,v 1.1.2.32 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 14 IP Storage and Handling * AUTHOR: Amos Jeffries @@ -618,29 +618,6 @@ return true; } -#ifdef _GLIBCXX_IOSTREAM -/// Operator to output ASCII version of Address:Port to a ostream -std::ostream& IPAddress::operator<<(std::ostream& os) const -{ - char buf[MAX_IPSTRLEN]; - // Dump the Current [Address]:Port to the debug stream. -#if USE_IPV6 - - if(IsIPv6()) -#else - - if(false) -#endif - - os << "[" << NtoA(buf,MAX_IPSTRLEN) << "]:" << m_SocketAddr.sin6_port; - else - os << NtoA(buf,MAX_IPSTRLEN) << ":" << m_SocketAddr.sin6_port; - - return os; -} - -#endif - int IPAddress::matchIPAddr(const IPAddress &rhs) const { unsigned int slen = sizeof(m_SocketAddr.sin6_addr); Index: squid3/src/ACLARP.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLARP.cc,v retrieving revision 1.9.4.8 retrieving revision 1.9.4.9 diff -u -r1.9.4.8 -r1.9.4.9 --- squid3/src/ACLARP.cc 29 Apr 2007 03:01:35 -0000 1.9.4.8 +++ squid3/src/ACLARP.cc 29 Apr 2007 05:47:32 -0000 1.9.4.9 @@ -1,5 +1,5 @@ /* - * $Id: ACLARP.cc,v 1.9.4.8 2007/04/29 03:01:35 amosjeffries Exp $ + * $Id: ACLARP.cc,v 1.9.4.9 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -264,8 +264,7 @@ /* IPv6 does not do ARP */ if(!c.IsIPv4()) { - debug(14, 3) ("aclMatchArp: IPv4 Required for ARP Lookups. Skipping %s\n", - c.NtoA(ntoabuf,MAX_IPSTRLEN) ); + debugs(14, 3, "aclMatchArp: IPv4 Required for ARP Lookups. Skipping " << c ); return 0; } #endif @@ -298,7 +297,7 @@ acl_arp_data X; memcpy (X.eth, arpReq.arp_ha.sa_data, 6); *Top = (*Top)->splay(&X, aclArpCompare); - debugs(28, 3, "aclMatchArp: '" << c.NtoA(ntoabuf,MAX_IPSTRLEN) << "' " << (splayLastResult ? "NOT found" : "found")); + debugs(28, 3, "aclMatchArp: '" << c << "' " << (splayLastResult ? "NOT found" : "found")); return (0 == splayLastResult); } @@ -332,7 +331,7 @@ if (NULL != strchr(ifr->ifr_name, ':')) continue; - debugs(28, 4, "Looking up ARP address for " << c.NtoA(ntoabuf,MAX_IPSTRLEN) << " on " << ifr->ifr_name); + debugs(28, 4, "Looking up ARP address for " << c << " on " << ifr->ifr_name); /* Set up structures for ARP lookup */ ipAddr.SetEmpty(); @@ -386,7 +385,7 @@ /* Return if match, otherwise continue to other interfaces */ if (0 == splayLastResult) { - debugs(28, 3, "aclMatchArp: " << c.NtoA(ntoabuf,MAX_IPSTRLEN) << " found on " << ifr->ifr_name); + debugs(28, 3, "aclMatchArp: " << c << " found on " << ifr->ifr_name); return 1; } @@ -408,8 +407,7 @@ /* IPv6 does not do ARP */ if(!c.IsIPv4()) { - debug(14, 3) ("aclMatchArp: IPv4 Required for ARP Lookups. Skipping %s\n", - c.NtoA(ntoabuf,MAX_IPSTRLEN) ); + debug(14, 3, "aclMatchArp: IPv4 Required for ARP Lookups. Skipping " << c ); return 0; } #endif @@ -449,7 +447,7 @@ /* Do lookup */ *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare); - debugs(28, 3, "aclMatchArp: '" << c.NtoA(ntoabuf,MAX_IPSTRLEN) << "' " << (splayLastResult ? "NOT found" : "found")); + debugs(28, 3, "aclMatchArp: '" << c << "' " << (splayLastResult ? "NOT found" : "found")); return (0 == splayLastResult); } @@ -478,8 +476,7 @@ /* IPv6 does not do ARP */ if(!c.IsIPv4()) { - debug(14, 3) ("aclMatchArp: IPv4 Required for ARP Lookups. Skipping %s\n", - c.NtoA(ntoabuf,MAX_IPSTRLEN) ); + debug(14, 3, "aclMatchArp: IPv4 Required for ARP Lookups. Skipping " << c ); return 0; } #endif @@ -565,7 +562,7 @@ /* Do lookup */ *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare); - debugs(28, 3, "aclMatchArp: '" << c.NtoA(ntoabuf,MAX_IPSTRLEN) << "' " << (splayLastResult ? "NOT found" : "found")); + debugs(28, 3, "aclMatchArp: '" << c << "' " << (splayLastResult ? "NOT found" : "found")); return (0 == splayLastResult); @@ -589,8 +586,7 @@ /* IPv6 does not do ARP */ if(!c.IsIPv4()) { - debug(14, 3) ("aclMatchArp: IPv4 Required for ARP Lookups. Skipping %s\n", - c.NtoA(ntoabuf,MAX_IPSTRLEN) ); + debug(14, 3, "aclMatchArp: IPv4 Required for ARP Lookups. Skipping " << c ); return 0; } #endif @@ -640,7 +636,7 @@ /* Do lookup */ *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare); - debugs(28, 3, "aclMatchArp: '" << c.NtoA(ntoabuf,MAX_IPSTRLEN) << "' " << (splayLastResult ? "NOT found" : "found")); + debugs(28, 3, "aclMatchArp: '" << c << "' " << (splayLastResult ? "NOT found" : "found")); return (0 == splayLastResult); @@ -652,7 +648,7 @@ /* * Address was not found on any interface */ - debugs(28, 3, "aclMatchArp: " << c.NtoA(ntoabuf,MAX_IPSTRLEN) << " NOT found"); + debugs(28, 3, "aclMatchArp: " << c << " NOT found"); return 0; } Index: squid3/src/ACLIP.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLIP.cc,v retrieving revision 1.8.2.25 retrieving revision 1.8.2.26 diff -u -r1.8.2.25 -r1.8.2.26 --- squid3/src/ACLIP.cc 29 Apr 2007 03:01:35 -0000 1.8.2.25 +++ squid3/src/ACLIP.cc 29 Apr 2007 05:47:32 -0000 1.8.2.26 @@ -1,5 +1,5 @@ /* - * $Id: ACLIP.cc,v 1.8.2.25 2007/04/29 03:01:35 amosjeffries Exp $ + * $Id: ACLIP.cc,v 1.8.2.26 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -243,7 +243,6 @@ debugs(28, 5, "aclParseIpData: " << t); acl_ip_data *q = new acl_ip_data; IPAddressType iptype = None; - char tmpbuf[MAX_IPSTRLEN]; if (strcasecmp(t, "all") == 0) { q->addr1.SetAnyAddr(); @@ -337,7 +336,7 @@ Q = &r->next; - debugs(28, 3, "" << l_addr1 << " --> " << r->addr1.NtoA(tmpbuf,MAX_IPSTRLEN)); + debugs(28, 3, "" << l_addr1 << " --> " << r->addr1 ); } if (*Q != NULL) { @@ -432,13 +431,12 @@ * address. Since we are scanning for a single IP mask and addr2 * MUST be set to empty. */ - char tmpbuf[MAX_IPSTRLEN]; ClientAddress.addr1 = clientip; ClientAddress.addr2.SetEmpty(); ClientAddress.mask.SetEmpty(); acl_ip_data *ClientAddressPointer = &ClientAddress; data = data->splay(ClientAddressPointer, aclIpAddrNetworkCompare); - debugs(28, 3, "aclMatchIp: '" << clientip.NtoA(tmpbuf,MAX_IPSTRLEN) << "' " << (splayLastResult ? "NOT found" : "found")); + debugs(28, 3, "aclMatchIp: '" << clientip << "' " << (splayLastResult ? "NOT found" : "found")); return !splayLastResult; } Index: squid3/src/ACLSourceDomain.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLSourceDomain.cc,v retrieving revision 1.3.12.5 retrieving revision 1.3.12.6 diff -u -r1.3.12.5 -r1.3.12.6 --- squid3/src/ACLSourceDomain.cc 29 Apr 2007 03:01:35 -0000 1.3.12.5 +++ squid3/src/ACLSourceDomain.cc 29 Apr 2007 05:47:32 -0000 1.3.12.6 @@ -1,5 +1,5 @@ /* - * $Id: ACLSourceDomain.cc,v 1.3.12.5 2007/04/29 03:01:35 amosjeffries Exp $ + * $Id: ACLSourceDomain.cc,v 1.3.12.6 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -76,7 +76,6 @@ ACLSourceDomainStrategy::match (ACLData * &data, ACLChecklist *checklist) { const char *fqdn = NULL; - char buf[MAX_IPSTRLEN]; /* FIXME INET6 : drop temp conversion */ struct IN_ADDR tmp; checklist->src_addr.GetInAddr(tmp); fqdn = fqdncache_gethostbyaddr(tmp, FQDN_LOOKUP_IF_MISS); @@ -84,7 +83,7 @@ return data->match(fqdn); } else if (!checklist->sourceDomainChecked()) { /* FIXME: Using AclMatchedName here is not OO correct. Should find a way to the current acl */ - debugs(28, 3, "aclMatchAcl: Can't yet compare '" << AclMatchedName << "' ACL for '" << checklist->src_addr.NtoA(buf,MAX_IPSTRLEN) << "'"); + debugs(28, 3, "aclMatchAcl: Can't yet compare '" << AclMatchedName << "' ACL for '" << checklist->src_addr << "'"); checklist->changeState(SourceDomainLookup::Instance()); return 0; } Index: squid3/src/AuthUser.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AuthUser.cc,v retrieving revision 1.1.8.5 retrieving revision 1.1.8.6 diff -u -r1.1.8.5 -r1.1.8.6 --- squid3/src/AuthUser.cc 29 Apr 2007 03:01:35 -0000 1.1.8.5 +++ squid3/src/AuthUser.cc 29 Apr 2007 05:47:32 -0000 1.1.8.6 @@ -1,6 +1,6 @@ /* - * $Id: AuthUser.cc,v 1.1.8.5 2007/04/29 03:01:35 amosjeffries Exp $ + * $Id: AuthUser.cc,v 1.1.8.6 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -267,7 +267,6 @@ AuthUser::addIp(IPAddress ipaddr) { auth_user_ip_t *ipdata = (auth_user_ip_t *) ip_list.head; - char ip1[MAX_IPSTRLEN]; int found = 0; CBDATA_INIT_TYPE(auth_user_ip_t); Index: squid3/src/AuthUserRequest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AuthUserRequest.cc,v retrieving revision 1.2.4.11 retrieving revision 1.2.4.12 diff -u -r1.2.4.11 -r1.2.4.12 --- squid3/src/AuthUserRequest.cc 29 Apr 2007 03:01:35 -0000 1.2.4.11 +++ squid3/src/AuthUserRequest.cc 29 Apr 2007 05:47:32 -0000 1.2.4.12 @@ -1,6 +1,6 @@ /* - * $Id: AuthUserRequest.cc,v 1.2.4.11 2007/04/29 03:01:35 amosjeffries Exp $ + * $Id: AuthUserRequest.cc,v 1.2.4.12 2007/04/29 05:47:32 amosjeffries Exp $ * * DO NOT MODIFY NEXT 2 LINES: * arch-tag: 6803fde1-d5a2-4c29-9034-1c0c9f650eb4 @@ -329,7 +329,6 @@ AuthUserRequest::authenticate(auth_user_request_t ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData::Pointer conn, IPAddress &src_addr) { - char buf[MAX_IPSTRLEN]; const char *proxy_auth; assert(headertype != 0); @@ -413,7 +412,7 @@ debugs(29, 1, "authenticateAuthenticate: Unexpected change of authentication scheme from '" << conn->auth_user_request->user()->config->type() << "' to '" << proxy_auth << "' (client " << - src_addr.NtoA(buf,MAX_IPSTRLEN) << ")"); + src_addr << ")"); conn->auth_user_request->unlock(); conn->auth_user_request = NULL; Index: squid3/src/asn.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/asn.cc,v retrieving revision 1.16.6.16 retrieving revision 1.16.6.17 diff -u -r1.16.6.16 -r1.16.6.17 --- squid3/src/asn.cc 29 Apr 2007 03:01:36 -0000 1.16.6.16 +++ squid3/src/asn.cc 29 Apr 2007 05:47:32 -0000 1.16.6.17 @@ -1,6 +1,6 @@ /* - * $Id: asn.cc,v 1.16.6.16 2007/04/29 03:01:36 amosjeffries Exp $ + * $Id: asn.cc,v 1.16.6.17 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 53 AS Number handling * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -142,9 +142,8 @@ m_ADDR m_addr; List *a = NULL; List *b = NULL; - char buf[MAX_IPSTRLEN]; - debugs(53, 3, "asnMatchIp: Called for " << addr.NtoA(buf,MAX_IPSTRLEN)); + debugs(53, 3, "asnMatchIp: Called for " << addr ); if (AS_tree_head == NULL) return 0; @@ -398,7 +397,6 @@ rtentry_t *e; struct squid_radix_node *rn; - char dbg1[MAX_IPSTRLEN], dbg2[MAX_IPSTRLEN]; List **Tail = NULL; List *q = NULL; as_info *asinfo = NULL; @@ -428,7 +426,7 @@ mask.SetNoAddr(); mask.ApplyMask(bitl, (t!=NULL?IPv4:IPv6) ); - debugs(53, 3, "asnAddNet: called for " << addr.NtoA(dbg1,MAX_IPSTRLEN) << "/" << mask.NtoA(dbg2,MAX_IPSTRLEN)); + debugs(53, 3, "asnAddNet: called for " << addr << "/" << mask ); e = (rtentry_t *)xmalloc(sizeof(rtentry_t)); @@ -444,7 +442,7 @@ asinfo = ((rtentry_t *) rn)->e_info; if (asinfo->as_number->find(as_number)) { - debugs(53, 3, "asnAddNet: Ignoring repeated network '" << dbg1 << "/" << bitl << "' for AS " << as_number); + debugs(53, 3, "asnAddNet: Ignoring repeated network '" << addr << "/" << bitl << "' for AS " << as_number); } else { debugs(53, 3, "asnAddNet: Warning: Found a network with multiple AS numbers!"); Index: squid3/src/comm.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/comm.cc,v retrieving revision 1.47.2.20 retrieving revision 1.47.2.21 diff -u -r1.47.2.20 -r1.47.2.21 --- squid3/src/comm.cc 29 Apr 2007 03:01:37 -0000 1.47.2.20 +++ squid3/src/comm.cc 29 Apr 2007 05:47:32 -0000 1.47.2.21 @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.47.2.20 2007/04/29 03:01:37 amosjeffries Exp $ + * $Id: comm.cc,v 1.47.2.21 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1267,7 +1267,7 @@ if (x < 0) { debugs(5, 9, "connect FD " << sock << ": " << xstrerror()); - debugs(14,9, "connected to: " << address.ToURL(buf,MAX_IPSTRLEN) ); + debugs(14,9, "connected to: " << address ); } } else { Index: squid3/src/dns_internal.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/dns_internal.cc,v retrieving revision 1.15.6.14 retrieving revision 1.15.6.15 diff -u -r1.15.6.14 -r1.15.6.15 --- squid3/src/dns_internal.cc 29 Apr 2007 03:01:37 -0000 1.15.6.14 +++ squid3/src/dns_internal.cc 29 Apr 2007 05:47:32 -0000 1.15.6.15 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.15.6.14 2007/04/29 03:01:37 amosjeffries Exp $ + * $Id: dns_internal.cc,v 1.15.6.15 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -188,7 +188,6 @@ static void idnsAddNameserver(const char *buf) { - char ntoabuf[MAX_IPSTRLEN]; IPAddress A; if (!(A = buf)) { @@ -197,9 +196,9 @@ } if (A.IsAnyAddr()) { - debugs(78, 0, "WARNING: Squid does not accept " << A.NtoA(ntoabuf,MAX_IPSTRLEN) << " in DNS server specifications."); + debugs(78, 0, "WARNING: Squid does not accept " << A << " in DNS server specifications."); A = "127.0.0.1"; - debugs(78, 0, "Will be using " << A.NtoA(ntoabuf,MAX_IPSTRLEN) << " instead, assuming you meant that DNS is running on the same machine"); + debugs(78, 0, "Will be using " << A << " instead, assuming you meant that DNS is running on the same machine"); } if (nns == nns_alloc) { @@ -224,7 +223,7 @@ A.SetPort(NS_DEFAULTPORT); /* FIXME INET6 : remove temporary conversion: final version: nameservers[nns].S = A; */ A.GetSockAddr(nameservers[nns].S); - debugs(78, 3, "idnsAddNameserver: Added nameserver #" << nns << ": " << A.NtoA(ntoabuf,MAX_IPSTRLEN)); + debugs(78, 3, "idnsAddNameserver: Added nameserver #" << nns << ": " << A ); nns++; } Index: squid3/src/fqdncache.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fqdncache.cc,v retrieving revision 1.9.2.13 retrieving revision 1.9.2.14 diff -u -r1.9.2.13 -r1.9.2.14 --- squid3/src/fqdncache.cc 29 Apr 2007 03:01:38 -0000 1.9.2.13 +++ squid3/src/fqdncache.cc 29 Apr 2007 05:47:32 -0000 1.9.2.14 @@ -1,6 +1,6 @@ /* - * $Id: fqdncache.cc,v 1.9.2.13 2007/04/29 03:01:38 amosjeffries Exp $ + * $Id: fqdncache.cc,v 1.9.2.14 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -450,7 +450,7 @@ debugs(35, 4, "fqdncache_nbgethostbyaddr: Name '" << name << "'."); FqdncacheStats.requests++; - if (name == NULL || name[0] == '\0') + if (name[0] == '\0') { debugs(35, 4, "fqdncache_nbgethostbyaddr: Invalid name!"); dns_error_message = "Invalid hostname"; @@ -499,7 +499,6 @@ dnsSubmit(hashKeyStr(&f->hash), fqdncacheHandleReply, c); #else -// /* FIXME INET6 : drop temp conversion. */ struct IN_ADDR tmp; addr.GetInAddr(tmp); idnsPTRLookup(addr, fqdncacheHandleReply, c); #endif } Index: squid3/src/htcp.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/htcp.cc,v retrieving revision 1.15.6.6 retrieving revision 1.15.6.7 diff -u -r1.15.6.6 -r1.15.6.7 --- squid3/src/htcp.cc 29 Apr 2007 03:01:38 -0000 1.15.6.6 +++ squid3/src/htcp.cc 29 Apr 2007 05:47:32 -0000 1.15.6.7 @@ -1,6 +1,6 @@ /* - * $Id: htcp.cc,v 1.15.6.6 2007/04/29 03:01:38 amosjeffries Exp $ + * $Id: htcp.cc,v 1.15.6.7 2007/04/29 05:47:32 amosjeffries Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -609,7 +609,7 @@ int x; char ntoabuf[MAX_IPSTRLEN]; - debugs(31, 3, "htcpSend: " << to.ToURL(ntoabuf,MAX_IPSTRLEN) ); + debugs(31, 3, "htcpSend: " << to ); htcpHexdump("htcpSend", buf, len); /* FIXME INET6 : drop temp conversion. */ sockaddr_in tmp_to; to.GetSockAddr(tmp_to); @@ -1133,7 +1133,7 @@ debugs(31, 2, "htcpHandleTstResponse: No matching query id '" << hdr->msg_id << "' (expected " << queried_id[hdr->msg_id % N_QUERIED_KEYS] << ") from '" << - from.NtoA(ntoabuf,MAX_IPSTRLEN) << "'"); + from << "'"); return; } @@ -1142,7 +1142,7 @@ if (!key) { - debugs(31, 1, "htcpHandleTstResponse: No query key for response id '" << hdr->msg_id << "' from '" << from.NtoA(ntoabuf,MAX_IPSTRLEN) << "'"); + debugs(31, 1, "htcpHandleTstResponse: No query key for response id '" << hdr->msg_id << "' from '" << from << "'"); return; } @@ -1150,7 +1150,7 @@ if ( *peer != from || peer->GetPort() != from.GetPort() ) { - debugs(31, 1, "htcpHandleTstResponse: Unexpected response source " << from.NtoA(ntoabuf,MAX_IPSTRLEN)); + debugs(31, 1, "htcpHandleTstResponse: Unexpected response source " << from ); return; } @@ -1363,7 +1363,7 @@ if (hdr.opcode >= HTCP_END) { - debugs(31, 1, "htcpHandleData: client " << from.NtoA(ntoabuf,MAX_IPSTRLEN) << ", opcode " << (int) hdr.opcode << " out of range"); + debugs(31, 1, "htcpHandleData: client " << from << ", opcode " << (int) hdr.opcode << " out of range"); return; } @@ -1451,15 +1451,14 @@ if (sz != htcpHdr.length) { debugs(31, 1, "htcpHandle: sz/" << sz << " != htcpHdr.length/" << - htcpHdr.length << " from " << from.ToURL(ntoabuf,MAX_IPSTRLEN)); + htcpHdr.length << " from " << from ); return; } if (htcpHdr.major != 0) { - debugs(31, 1, "htcpHandle: Unknown major version " << htcpHdr.major << - " from " << from.ToURL(ntoabuf,MAX_IPSTRLEN)); + debugs(31, 1, "htcpHandle: Unknown major version " << htcpHdr.major << " from " << from ); return; } @@ -1486,7 +1485,7 @@ /* FIXME INET6 : drop temp construction */ from = tmp_from; - debugs(31, 3, "htcpRecv: FD " << fd << ", " << len << " bytes from " << from.ToURL(ntoabuf,MAX_IPSTRLEN)); + debugs(31, 3, "htcpRecv: FD " << fd << ", " << len << " bytes from " << from ); if (len) statCounter.htcp.pkts_recv++; Index: squid3/src/ipcache.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ipcache.cc,v retrieving revision 1.9.2.20 retrieving revision 1.9.2.21 diff -u -r1.9.2.20 -r1.9.2.21 --- squid3/src/ipcache.cc 29 Apr 2007 03:01:39 -0000 1.9.2.20 +++ squid3/src/ipcache.cc 29 Apr 2007 05:47:33 -0000 1.9.2.21 @@ -1,6 +1,6 @@ /* - * $Id: ipcache.cc,v 1.9.2.20 2007/04/29 03:01:39 amosjeffries Exp $ + * $Id: ipcache.cc,v 1.9.2.21 2007/04/29 05:47:33 amosjeffries Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -843,7 +843,6 @@ ipcache_entry *i; ipcache_addrs *ia; int k; - char tmpbuf[MAX_IPSTRLEN]; if ((i = ipcache_get(name)) == NULL) return; @@ -864,7 +863,7 @@ ia->bad_mask[k] = TRUE; ia->badcount++; i->expires = XMIN(squid_curtime + XMAX((time_t)60, Config.negativeDnsTtl), i->expires); - debugs(14, 2, "ipcacheMarkBadAddr: " << name << " " << addr.NtoA(tmpbuf,MAX_IPSTRLEN)); + debugs(14, 2, "ipcacheMarkBadAddr: " << name << " " << addr ); } ipcacheCycleAddr(name, ia); @@ -874,7 +873,6 @@ ipcacheMarkGoodAddr(const char *name, IPAddress &addr) { - char tmpbuf[MAX_IPSTRLEN]; ipcache_entry *i; ipcache_addrs *ia; int k; @@ -900,7 +898,7 @@ ia->badcount--; - debugs(14, 2, "ipcacheMarkGoodAddr: " << name << " " << addr.NtoA(tmpbuf,MAX_IPSTRLEN)); + debugs(14, 2, "ipcacheMarkGoodAddr: " << name << " " << addr ); } static void Index: squid3/src/peer_digest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/peer_digest.cc,v retrieving revision 1.11.4.6 retrieving revision 1.11.4.7 diff -u -r1.11.4.6 -r1.11.4.7 --- squid3/src/peer_digest.cc 29 Apr 2007 03:01:39 -0000 1.11.4.6 +++ squid3/src/peer_digest.cc 29 Apr 2007 05:47:33 -0000 1.11.4.7 @@ -1,6 +1,6 @@ /* - * $Id: peer_digest.cc,v 1.11.4.6 2007/04/29 03:01:39 amosjeffries Exp $ + * $Id: peer_digest.cc,v 1.11.4.7 2007/04/29 05:47:33 amosjeffries Exp $ * * DEBUG: section 72 Peer Digest Routines * AUTHOR: Alex Rousskov @@ -269,7 +269,7 @@ } /* FIXME INET6 : drop temp conversion */ IPAddress tmp(pd->peer->host); tmp.SetPort(pd->peer->http_port); - debugs(72, 3, "peerDigestCheck: peer " << tmp.ToURL(buf,MAX_IPSTRLEN)); + debugs(72, 3, "peerDigestCheck: peer " << tmp ); debugs(72, 3, "peerDigestCheck: time: " << (long int) squid_curtime << ", last received: " << (long int) pd->times.received << " (" << std::showpos << (int) (squid_curtime - pd->times.received) << ")"); Index: squid3/src/tools.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tools.cc,v retrieving revision 1.22.2.14 retrieving revision 1.22.2.15 diff -u -r1.22.2.14 -r1.22.2.15 --- squid3/src/tools.cc 29 Apr 2007 03:01:40 -0000 1.22.2.14 +++ squid3/src/tools.cc 29 Apr 2007 05:47:33 -0000 1.22.2.15 @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.22.2.14 2007/04/29 03:01:40 amosjeffries Exp $ + * $Id: tools.cc,v 1.22.2.15 2007/04/29 05:47:33 amosjeffries Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -576,7 +576,6 @@ static int present = 0; const struct hostent *h = NULL; IPAddress sa; - char buf[MAX_IPSTRLEN]; if (Config.visibleHostname != NULL) return Config.visibleHostname; @@ -628,7 +627,7 @@ return host; } - debugs(50, 1, "WARNING: failed to resolve " << sa.NtoA(buf,MAX_IPSTRLEN) << " to a fully qualified hostname"); + debugs(50, 1, "WARNING: failed to resolve " << sa << " to a fully qualified hostname"); } /*