--------------------- PatchSet 4529 Date: 2007/05/10 12:57:33 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Finally make old NEEDS_BRACKETS macro obsolete. Moved formatting of IPA as hostname into IPAddress and created protector methods for HttpRequest that check for IPA and isolate the information. Members: include/IPAddress.h:1.1.2.17->1.1.2.18 lib/IPAddress.cc:1.1.2.34->1.1.2.35 lib/tests/testIPAddress.cc:1.1.2.4->1.1.2.5 src/ACLDestinationDomain.cc:1.7.6.9->1.7.6.10 src/ACLDestinationIP.cc:1.6.6.4->1.6.6.5 src/HttpRequest.h:1.10.6.8->1.10.6.9 src/asn.cc:1.16.6.18->1.16.6.19 src/client_side.cc:1.68.2.19->1.68.2.20 src/client_side_reply.cc:1.57.4.12->1.57.4.13 src/errorpage.cc:1.23.6.7->1.23.6.8 src/external_acl.cc:1.37.6.8->1.37.6.9 src/forward.cc:1.35.4.17->1.35.4.18 src/ftp.cc:1.26.2.21->1.26.2.22 src/http.cc:1.43.4.15->1.43.4.16 src/icp_v2.cc:1.17.8.13->1.17.8.14 src/internal.cc:1.5.8.6->1.5.8.7 src/neighbors.cc:1.23.4.17->1.23.4.18 src/peer_select.cc:1.9.4.9->1.9.4.10 src/tunnel.cc:1.13.4.8->1.13.4.9 src/url.cc:1.9.8.14->1.9.8.15 src/tests/testHttpRequest.cc:1.1.14.3->1.1.14.4 Index: squid3/include/IPAddress.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/include/Attic/IPAddress.h,v retrieving revision 1.1.2.17 retrieving revision 1.1.2.18 diff -u -r1.1.2.17 -r1.1.2.18 --- squid3/include/IPAddress.h 29 Apr 2007 05:47:32 -0000 1.1.2.17 +++ squid3/include/IPAddress.h 10 May 2007 12:57:33 -0000 1.1.2.18 @@ -1,6 +1,6 @@ /* - * $Id: IPAddress.h,v 1.1.2.17 2007/04/29 05:47:32 amosjeffries Exp $ + * $Id: IPAddress.h,v 1.1.2.18 2007/05/10 12:57:33 amosjeffries Exp $ * * DEBUG: section 14 IP Storage and Handling * AUTHOR: Amos Jeffries @@ -245,9 +245,10 @@ * If buffer is not large enough the data is truncated silently. * \param buf Allocated buffer to write address to * \param len byte length of buffer available for writing. + * \param force (optional) require the IPA in a specific format. * \return pointer to buffer received. */ - char* NtoA(char *buf, unsigned int len) const; + char* NtoA(char *buf, unsigned int len, IPAddressType force = None) const; /** Return the ASCII equivalent of the address:port combination * Provides a URL formatted version of the content. @@ -259,6 +260,16 @@ */ char* ToURL(char *buf, unsigned int len) const; + /** Return a properly hostname formatted copy of the address + * Provides a URL formatted version of the content. + * If buffer is not large enough the data is truncated silently. + * eg. 127.0.0.1 (IPv4) or [::1] (IPv6) + * \param buf Allocated buffer to write address to + * \param len byte length of buffer available for writing. + * \return pointer to buffer received. + */ + unsigned int ToHostname(char *buf, const unsigned int len) const; + /** \fn bool GetReverseString(char buf[], IPAddressType show_format) * Convert the content into a Reverse-DNS string. * The buffer sent MUST be allocated large enough to hold the resulting string. @@ -332,6 +343,6 @@ } // Nasty hack. But there is no easy way around it yet. -#define NEEDS_BRACKETS(x) (strchr(x,':')!=0) +//#define NEEDS_BRACKETS(x) (strchr(x,':')!=0) #endif /* _INC_IPADDRESS_H */ Index: squid3/lib/IPAddress.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/lib/Attic/IPAddress.cc,v retrieving revision 1.1.2.34 retrieving revision 1.1.2.35 diff -u -r1.1.2.34 -r1.1.2.35 --- squid3/lib/IPAddress.cc 29 Apr 2007 15:28:54 -0000 1.1.2.34 +++ squid3/lib/IPAddress.cc 10 May 2007 12:57:38 -0000 1.1.2.35 @@ -1,6 +1,6 @@ /* - * $Id: IPAddress.cc,v 1.1.2.34 2007/04/29 15:28:54 amosjeffries Exp $ + * $Id: IPAddress.cc,v 1.1.2.35 2007/05/10 12:57:38 amosjeffries Exp $ * * DEBUG: section 14 IP Storage and Handling * AUTHOR: Amos Jeffries @@ -233,7 +233,11 @@ bool IPAddress::IsIPv6() const { +#if USE_IPV6 return IsAnyAddr() || IsNoAddr() || ((m_Type & IPv6) && !(m_Type & IPv4)); +#else + return false; // enforce IPv4 in IPv4-only mode. +#endif } bool IPAddress::IsAnyAddr() const @@ -387,7 +391,7 @@ #endif } - debugs(14,0, "Unable to convert '" << NtoA(buf,MAX_IPSTRLEN) << "' to the rDNS type requested.\n"); + debugs(14,0, "Unable to convert '" << NtoA(buf,MAX_IPSTRLEN) << "' to the rDNS type requested."); buf[0] = '\0'; @@ -412,7 +416,7 @@ struct hostent *hp = NULL; if ((hp = gethostbyname(s)) == NULL) { - debugs(14,1, HERE << "Given Bad IP '" << s << "'\n"); + debugs(14,1, HERE << "Given Bad IP '" << s << "'"); return false; } @@ -606,7 +610,7 @@ operator=(*ipv6); #else - debugs(14,1, HERE << "Discarded IPv6 Address. Protocol disabled.\n"); + debugs(14,1, HERE << "Discarded IPv6 Address. Protocol disabled."); // FIXME see if there is another address in the list that might be usable ?? return false; @@ -708,62 +712,83 @@ * * A copy of the buffer is also returned for simple immediate display. */ -char* IPAddress::NtoA(char* buf, unsigned int blen) const +char* IPAddress::NtoA(char* buf, unsigned int blen, IPAddressType force) const { // Ensure we have a buffer. if(buf == NULL) { - debugs(14,1, HERE << "Buffer received has no allocated space.\n"); + debugs(14,1, HERE << "Buffer received has no allocated space."); return NULL; } memset(buf,0,blen); - if(m_Type & IPv6 ) + if( (force & IPv64) && !(force & m_Type) ) { + debugs(14,1, HERE << "Unable to format IPA by force."); + return NULL; + } + + /* NP: CANNOT use IsIPv6() here as that is tuned to check for SPIT-STACK actions */ + /* Generic IPA display does not care what the system is. */ + if( !(force & IPv4) && (m_Type & IPv6) ) inet_ntop(AF_INET6, &m_SocketAddr.sin6_addr, buf, blen); - else + else if ( !(force & IPv6) && IsIPv4() ) +#if USE_IPV6 + { + struct in_addr tmp; + GetInAddr(tmp); + inet_ntop(AF_INET, &tmp, buf, blen); + } +#else inet_ntop(AF_INET, &m_SocketAddr.sin6_addr, buf, blen); +#endif + else assert(false); return buf; } -char* IPAddress::ToURL(char* buf, unsigned int blen) const +unsigned int IPAddress::ToHostname(char *buf, const unsigned int blen) const { char *p = buf; - // Ensure we have a buffer. - - if(buf == NULL) { - debugs(14,1, HERE << "Buffer received has no allocated space.\n"); - return NULL; - } - - memset(buf,0,blen); - -#if USE_IPV6 - - if(blen > 0) { + if(IsIPv6() && blen > 0) { *p = '['; p++; } -#endif - /* 7 being space for [,], and port */ - p = NtoA(p, blen-7); + if( IsIPv4() ) + NtoA(p, blen-7, IPv4); + else + NtoA(p, blen-7, IPv6); // find the end of the new string while(*p != '\0' && p < buf+blen) p++; -#if USE_IPV6 - - if(p < buf+blen-1) { + if(IsIPv6() && p < buf+blen-1) { *p = ']'; p++; } -#endif + /* return size of buffer now used */ + return (p - buf); +} + +char* IPAddress::ToURL(char* buf, unsigned int blen) const +{ + char *p = buf; + + // Ensure we have a buffer. + + if(buf == NULL) { + debugs(14,1, HERE << "Buffer received has no allocated space."); + return NULL; + } + + memset(buf,0,blen); + + p += ToHostname(p, blen); if(m_SocketAddr.sin6_port > 0 && p < buf+blen-6) { /* 6 is max length of expected ':port' (short int) */ @@ -891,7 +916,7 @@ case IPv6: // non-compatible IPv6 Pure Address default: - debugs(14,1, HERE << "IPAddress::GetInAddr : Cannot convert non-IP to IPv4.\n"); + debugs(14,1, HERE << "IPAddress::GetInAddr : Cannot convert non-IP to IPv4."); memset(&buf,0xFFFFFFFF,sizeof(struct in_addr)); return false; Index: squid3/lib/tests/testIPAddress.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/lib/tests/Attic/testIPAddress.cc,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid3/lib/tests/testIPAddress.cc 28 Apr 2007 14:29:27 -0000 1.1.2.4 +++ squid3/lib/tests/testIPAddress.cc 10 May 2007 12:57:40 -0000 1.1.2.5 @@ -340,11 +340,24 @@ IPAddress anIPA(inval); /* test values */ -#if USE_IPV6 - CPPUNIT_ASSERT( memcmp("[::ffff:192.168.100.12]", anIPA.ToURL(buf,MAX_IPSTRLEN), 24) == 0 ); -#else CPPUNIT_ASSERT( memcmp("192.168.100.12", anIPA.ToURL(buf,MAX_IPSTRLEN), 15) == 0 ); + +#if USE_IPV6 + + /* test output when constructed from in6_addr with IPv6 */ + struct in6_addr ip6val; + + ip6val.s6_addr32[0] = htonl(0xC0A8640C); + ip6val.s6_addr32[1] = htonl(0xFFFFFFFF); + ip6val.s6_addr32[2] = htonl(0xFFFFFFFF); + ip6val.s6_addr32[3] = htonl(0xFFFFFFFF); + + anIPA = ip6val; + + CPPUNIT_ASSERT( memcmp("[c0a8:640c:ffff:ffff:ffff:ffff:ffff:ffff]", anIPA.ToURL(buf,MAX_IPSTRLEN), 43) == 0 ); + #endif + } void @@ -358,11 +371,26 @@ char buf[MAX_IPSTRLEN]; /* test values */ -#if USE_IPV6 - CPPUNIT_ASSERT( memcmp("[::ffff:192.168.100.12]:80\0",anIPA.ToURL(buf,MAX_IPSTRLEN), 27) == 0 ); -#else CPPUNIT_ASSERT( memcmp("192.168.100.12:80",anIPA.ToURL(buf,MAX_IPSTRLEN), 18) == 0 ); + +#if USE_IPV6 + + /* test output when constructed from in6_addr with IPv6 */ + struct sockaddr_in6 ip6val; + + ip6val.sin6_addr.s6_addr32[0] = htonl(0xC0A8640C); + ip6val.sin6_addr.s6_addr32[1] = htonl(0xFFFFFFFF); + ip6val.sin6_addr.s6_addr32[2] = htonl(0xFFFFFFFF); + ip6val.sin6_addr.s6_addr32[3] = htonl(0xFFFFFFFF); + ip6val.sin6_port = htons(80); + ip6val.sin6_family = AF_INET6; + + anIPA = ip6val; + + CPPUNIT_ASSERT( memcmp("[c0a8:640c:ffff:ffff:ffff:ffff:ffff:ffff]:80", anIPA.ToURL(buf,MAX_IPSTRLEN), 46) == 0 ); + #endif + } void Index: squid3/src/ACLDestinationDomain.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLDestinationDomain.cc,v retrieving revision 1.7.6.9 retrieving revision 1.7.6.10 diff -u -r1.7.6.9 -r1.7.6.10 --- squid3/src/ACLDestinationDomain.cc 30 Apr 2007 13:27:36 -0000 1.7.6.9 +++ squid3/src/ACLDestinationDomain.cc 10 May 2007 12:57:40 -0000 1.7.6.10 @@ -1,5 +1,5 @@ /* - * $Id: ACLDestinationDomain.cc,v 1.7.6.9 2007/04/30 13:27:36 amosjeffries Exp $ + * $Id: ACLDestinationDomain.cc,v 1.7.6.10 2007/05/10 12:57:40 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -78,10 +78,10 @@ { const ipcache_addrs *ia = NULL; - if (data->match(checklist->request->host)) + if (data->match(checklist->request->GetHost())) return 1; - if ((ia = ipcacheCheckNumeric(checklist->request->host)) == NULL) + if ((ia = ipcacheCheckNumeric(checklist->request->GetHost())) == NULL) return 0; const char *fqdn = NULL; @@ -93,7 +93,7 @@ return data->match(fqdn); } else if (!checklist->destinationDomainChecked()) { /* 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->request->host << "'"); + debugs(28, 3, "aclMatchAcl: Can't yet compare '" << AclMatchedName << "' ACL for '" << checklist->request->GetHost() << "'"); checklist->changeState(DestinationDomainLookup::Instance()); return 0; } Index: squid3/src/ACLDestinationIP.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLDestinationIP.cc,v retrieving revision 1.6.6.4 retrieving revision 1.6.6.5 diff -u -r1.6.6.4 -r1.6.6.5 --- squid3/src/ACLDestinationIP.cc 29 Apr 2007 03:01:35 -0000 1.6.6.4 +++ squid3/src/ACLDestinationIP.cc 10 May 2007 12:57:40 -0000 1.6.6.5 @@ -1,5 +1,5 @@ /* - * $Id: ACLDestinationIP.cc,v 1.6.6.4 2007/04/29 03:01:35 amosjeffries Exp $ + * $Id: ACLDestinationIP.cc,v 1.6.6.5 2007/05/10 12:57:40 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -47,7 +47,7 @@ int ACLDestinationIP::match(ACLChecklist *checklist) { - const ipcache_addrs *ia = ipcache_gethostbyname(checklist->request->host, IP_LOOKUP_IF_MISS); + const ipcache_addrs *ia = ipcache_gethostbyname(checklist->request->GetHost(), IP_LOOKUP_IF_MISS); if (ia) { /* Entry in cache found */ @@ -61,7 +61,7 @@ return 0; } else if (!checklist->request->flags.destinationIPLookedUp()) { /* No entry in cache, lookup not attempted */ - debugs(28, 3, "aclMatchAcl: Can't yet compare '" << name << "' ACL for '" << checklist->request->host << "'"); + debugs(28, 3, "aclMatchAcl: Can't yet compare '" << name << "' ACL for '" << checklist->request->GetHost() << "'"); checklist->changeState (DestinationIPLookup::Instance()); return 0; } else { @@ -81,7 +81,7 @@ DestinationIPLookup::checkForAsync(ACLChecklist *checklist)const { checklist->asyncInProgress(true); - ipcache_nbgethostbyname(checklist->request->host, LookupDone, checklist); + ipcache_nbgethostbyname(checklist->request->GetHost(), LookupDone, checklist); } void Index: squid3/src/HttpRequest.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpRequest.h,v retrieving revision 1.10.6.8 retrieving revision 1.10.6.9 diff -u -r1.10.6.8 -r1.10.6.9 --- squid3/src/HttpRequest.h 22 Apr 2007 08:04:36 -0000 1.10.6.8 +++ squid3/src/HttpRequest.h 10 May 2007 12:57:40 -0000 1.10.6.9 @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.h,v 1.10.6.8 2007/04/22 08:04:36 amosjeffries Exp $ + * $Id: HttpRequest.h,v 1.10.6.9 2007/05/10 12:57:40 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -68,6 +68,20 @@ /* are responses to this request potentially cachable */ bool cacheable() const; + /* Now that we care what host contains it is better off being protected. */ + /* HACK: These two methods are only inline to get around Makefile dependancies */ + /* caused by HttpRequest being used in places it really shouldn't. */ + inline void SetHost(const char *src) + { + IPAddress test = src; + if(test.IsAnyAddr()) + xstrncpy(host, src, SQUIDHOSTNAMELEN); + else { + test.ToHostname(host, SQUIDHOSTNAMELEN); + } + }; + inline const char* GetHost(void) const { return host; }; + protected: void clean(); @@ -78,8 +92,9 @@ char login[MAX_LOGIN_SZ]; +private: char host[SQUIDHOSTNAMELEN + 1]; - +public: auth_user_request_t *auth_user_request; u_short port; Index: squid3/src/asn.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/asn.cc,v retrieving revision 1.16.6.18 retrieving revision 1.16.6.19 diff -u -r1.16.6.18 -r1.16.6.19 --- squid3/src/asn.cc 1 May 2007 08:32:28 -0000 1.16.6.18 +++ squid3/src/asn.cc 10 May 2007 12:57:40 -0000 1.16.6.19 @@ -1,6 +1,6 @@ /* - * $Id: asn.cc,v 1.16.6.18 2007/05/01 08:32:28 amosjeffries Exp $ + * $Id: asn.cc,v 1.16.6.19 2007/05/10 12:57:40 amosjeffries Exp $ * * DEBUG: section 53 AS Number handling * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -637,7 +637,7 @@ int ACLDestinationASNStrategy::match (ACLData * &data, ACLChecklist *checklist) { - const ipcache_addrs *ia = ipcache_gethostbyname(checklist->request->host, IP_LOOKUP_IF_MISS); + const ipcache_addrs *ia = ipcache_gethostbyname(checklist->request->GetHost(), IP_LOOKUP_IF_MISS); if (ia) { for (int k = 0; k < (int) ia->count; k++) { @@ -649,7 +649,7 @@ } else if (!checklist->request->flags.destinationIPLookedUp()) { /* No entry in cache, lookup not attempted */ /* XXX FIXME: allow accessing the acl name here */ - debugs(28, 3, "asnMatchAcl: Can't yet compare '" << "unknown" /*name*/ << "' ACL for '" << checklist->request->host << "'"); + debugs(28, 3, "asnMatchAcl: Can't yet compare '" << "unknown" /*name*/ << "' ACL for '" << checklist->request->GetHost() << "'"); checklist->changeState (DestinationIPLookup::Instance()); } else { IPAddress noaddr; noaddr.SetNoAddr(); Index: squid3/src/client_side.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side.cc,v retrieving revision 1.68.2.19 retrieving revision 1.68.2.20 diff -u -r1.68.2.19 -r1.68.2.20 --- squid3/src/client_side.cc 1 May 2007 08:32:28 -0000 1.68.2.19 +++ squid3/src/client_side.cc 10 May 2007 12:57:40 -0000 1.68.2.20 @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.68.2.19 2007/05/01 08:32:28 amosjeffries Exp $ + * $Id: client_side.cc,v 1.68.2.20 2007/05/10 12:57:40 amosjeffries Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2191,12 +2191,11 @@ #endif if (internalCheck(request->urlpath.buf())) { - if (internalHostnameIs(request->host) && + if (internalHostnameIs(request->GetHost()) && request->port == getMyPort()) { http->flags.internal = 1; } else if (Config.onoff.global_internal_static && internalStaticCheck(request->urlpath.buf())) { - xstrncpy(request->host, internalHostname(), - SQUIDHOSTNAMELEN); + request->SetHost(internalHostname()); // xstrncpy(request->host, internalHostname(), SQUIDHOSTNAMELEN); request->port = getMyPort(); http->flags.internal = 1; } Index: squid3/src/client_side_reply.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side_reply.cc,v retrieving revision 1.57.4.12 retrieving revision 1.57.4.13 diff -u -r1.57.4.12 -r1.57.4.13 --- squid3/src/client_side_reply.cc 9 May 2007 07:27:14 -0000 1.57.4.12 +++ squid3/src/client_side_reply.cc 10 May 2007 12:57:41 -0000 1.57.4.13 @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.57.4.12 2007/05/09 07:27:14 amosjeffries Exp $ + * $Id: client_side_reply.cc,v 1.57.4.13 2007/05/10 12:57:41 amosjeffries Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -839,7 +839,7 @@ } /* Release both IP cache */ - ipcacheInvalidate(http->request->host); + ipcacheInvalidate(http->request->GetHost()); if (!http->flags.purging) purgeRequestFindObjectToPurge(); @@ -1414,11 +1414,11 @@ #if USE_DNSSERVERS - ipcacheInvalidate(r->host); + ipcacheInvalidate(r->GetHost()); #else - ipcacheInvalidateNegative(r->host); + ipcacheInvalidateNegative(r->GetHost()); #endif /* USE_DNSSERVERS */ @@ -1430,11 +1430,11 @@ #if USE_DNSSERVERS - ipcacheInvalidate(r->host); + ipcacheInvalidate(r->GetHost()); #else - ipcacheInvalidateNegative(r->host); + ipcacheInvalidateNegative(r->GetHost()); #endif /* USE_DNSSERVERS */ Index: squid3/src/errorpage.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/errorpage.cc,v retrieving revision 1.23.6.7 retrieving revision 1.23.6.8 diff -u -r1.23.6.7 -r1.23.6.8 --- squid3/src/errorpage.cc 8 May 2007 13:31:15 -0000 1.23.6.7 +++ squid3/src/errorpage.cc 10 May 2007 12:57:41 -0000 1.23.6.8 @@ -1,6 +1,6 @@ /* - * $Id: errorpage.cc,v 1.23.6.7 2007/05/08 13:31:15 amosjeffries Exp $ + * $Id: errorpage.cc,v 1.23.6.8 2007/05/10 12:57:41 amosjeffries Exp $ * * DEBUG: section 4 Error Generation * AUTHOR: Duane Wessels @@ -686,7 +686,7 @@ if (r->hier.host) p = r->hier.host; else - p = r->host; + p = r->GetHost(); } else p = "[unknown host]"; Index: squid3/src/external_acl.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/external_acl.cc,v retrieving revision 1.37.6.8 retrieving revision 1.37.6.9 diff -u -r1.37.6.8 -r1.37.6.9 --- squid3/src/external_acl.cc 29 Apr 2007 03:01:37 -0000 1.37.6.8 +++ squid3/src/external_acl.cc 10 May 2007 12:57:41 -0000 1.37.6.9 @@ -1,6 +1,6 @@ /* - * $Id: external_acl.cc,v 1.37.6.8 2007/04/29 03:01:37 amosjeffries Exp $ + * $Id: external_acl.cc,v 1.37.6.9 2007/05/10 12:57:41 amosjeffries Exp $ * * DEBUG: section 82 External ACL * AUTHOR: Henrik Nordstrom, MARA Systems AB @@ -799,7 +799,7 @@ break; case _external_acl_format::EXT_ACL_DST: - str = request->host; + str = request->GetHost(); break; case _external_acl_format::EXT_ACL_PROTO: Index: squid3/src/forward.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/forward.cc,v retrieving revision 1.35.4.17 retrieving revision 1.35.4.18 diff -u -r1.35.4.17 -r1.35.4.18 --- squid3/src/forward.cc 8 May 2007 13:55:38 -0000 1.35.4.17 +++ squid3/src/forward.cc 10 May 2007 12:57:41 -0000 1.35.4.18 @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.35.4.17 2007/05/08 13:55:38 amosjeffries Exp $ + * $Id: forward.cc,v 1.35.4.18 2007/05/10 12:57:41 amosjeffries Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -668,7 +668,7 @@ if (NULL == fs->_peer) flags.dont_retry = 1; - debugs(17, 4, "fwdConnectDone: Unknown host: " << request->host); + debugs(17, 4, "fwdConnectDone: Unknown host: " << request->GetHost()); ErrorState *anErr = errorCon(ERR_DNS_FAIL, HTTP_SERVICE_UNAVAILABLE, request); @@ -765,9 +765,9 @@ : Config.Timeout.peer_connect; if (fs->_peer->options.originserver) - domain = request->host; + domain = request->GetHost(); } else { - host = request->host; + host = request->GetHost(); port = request->port; ctimeout = Config.Timeout.connect; } @@ -892,7 +892,7 @@ } #endif - hierarchyNote(&request->hier, fs->code, request->host); + hierarchyNote(&request->hier, fs->code, request->GetHost()); } commConnectStart(fd, host, port, fwdConnectDoneWrapper, this); @@ -944,7 +944,7 @@ EBIT_SET(entry->flags, ENTRY_DISPATCHED); - netdbPingSite(request->host); + netdbPingSite(request->GetHost()); if (servers && (p = servers->_peer)) { p->stats.fetches++; Index: squid3/src/ftp.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ftp.cc,v retrieving revision 1.26.2.21 retrieving revision 1.26.2.22 diff -u -r1.26.2.21 -r1.26.2.22 --- squid3/src/ftp.cc 8 May 2007 13:31:15 -0000 1.26.2.21 +++ squid3/src/ftp.cc 10 May 2007 12:57:41 -0000 1.26.2.22 @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.26.2.21 2007/05/08 13:31:15 amosjeffries Exp $ + * $Id: ftp.cc,v 1.26.2.22 2007/05/10 12:57:41 amosjeffries Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1469,7 +1469,7 @@ title_url.append("@"); } - title_url.append(request->host); + title_url.append(request->GetHost()); if (request->port != urlDefaultPort(PROTO_FTP)) { title_url.append(":"); @@ -1491,7 +1491,7 @@ base_href.append("@"); } - base_href.append(request->host); + base_href.append(request->GetHost()); if (request->port != urlDefaultPort(PROTO_FTP)) { base_href.append(":"); @@ -1535,7 +1535,7 @@ checkUrlpath(); buildTitleUrl(); - debugs(9, 5, "ftpStart: host=" << request->host << ", path=" << + debugs(9, 5, "ftpStart: host=" << request->GetHost() << ", path=" << request->urlpath.buf() << ", user=" << user << ", passwd=" << password); @@ -1888,7 +1888,7 @@ if (ftpState->proxy_host != NULL) snprintf(cbuf, 1024, "USER %s@%s\r\n", ftpState->user, - ftpState->request->host); + ftpState->request->GetHost()); else snprintf(cbuf, 1024, "USER %s\r\n", ftpState->user); Index: squid3/src/http.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/http.cc,v retrieving revision 1.43.4.15 retrieving revision 1.43.4.16 diff -u -r1.43.4.15 -r1.43.4.16 --- squid3/src/http.cc 9 May 2007 07:27:14 -0000 1.43.4.15 +++ squid3/src/http.cc 10 May 2007 12:57:42 -0000 1.43.4.16 @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.43.4.15 2007/05/09 07:27:14 amosjeffries Exp $ + * $Id: http.cc,v 1.43.4.16 2007/05/10 12:57:42 amosjeffries Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -99,7 +99,7 @@ HttpRequest * proxy_req = new HttpRequest(orig_request->method, orig_request->protocol, url); - xstrncpy(proxy_req->host, _peer->host, SQUIDHOSTNAMELEN); + proxy_req->SetHost(_peer->host); // xstrncpy(proxy_req->host, _peer->host, SQUIDHOSTNAMELEN); proxy_req->port = _peer->http_port; @@ -691,7 +691,7 @@ int skew = abs((int)(reply->date - squid_curtime)); if (skew > 86400) - debugs(11, 3, "" << request->host << "'s clock is skewed by " << skew << " seconds!"); + debugs(11, 3, "" << request->GetHost() << "'s clock is skewed by " << skew << " seconds!"); } } @@ -1210,11 +1210,11 @@ if (_peer) { if (_peer->options.originserver) - fwd->pconnPush(fd, _peer->name, orig_request->port, orig_request->host, client_addr); + fwd->pconnPush(fd, _peer->name, orig_request->port, orig_request->GetHost(), client_addr); else fwd->pconnPush(fd, _peer->name, _peer->http_port, NULL, client_addr); } else { - fwd->pconnPush(fd, request->host, request->port, NULL, client_addr); + fwd->pconnPush(fd, request->GetHost(), request->port, NULL, client_addr); } fd = -1; @@ -1429,19 +1429,11 @@ hdr_out->putStr(HDR_HOST, orig_request->peer_domain); } else if (orig_request->port == urlDefaultPort(orig_request->protocol)) { /* use port# only if not default */ - hdr_out->putStr(HDR_HOST, orig_request->host); + hdr_out->putStr(HDR_HOST, orig_request->GetHost()); } else { -#ifdef INET6 - httpHeaderPutStrf(hdr_out, HDR_HOST, "%s%s%s:%d", - NEEDS_BRACKETS(orig_request->host) ? "[": null_string, - orig_request->host, - NEEDS_BRACKETS(orig_request->host) ? "]": null_string, - (int) orig_request->port); -#else httpHeaderPutStrf(hdr_out, HDR_HOST, "%s:%d", - orig_request->host, + orig_request->GetHost(), (int) orig_request->port); -#endif } } @@ -1633,19 +1625,11 @@ /* use port# only if not default */ if (orig_request->port == urlDefaultPort(orig_request->protocol)) { - hdr_out->putStr(HDR_HOST, orig_request->host); + hdr_out->putStr(HDR_HOST, orig_request->GetHost()); } else { -#ifdef INET6 - httpHeaderPutStrf(hdr_out, HDR_HOST, "%s%s%s:%d", - NEEDS_BRACKETS(orig_request->host) ? "[" : null_string , - orig_request->host, - NEEDS_BRACKETS(orig_request->host) ? "]" : null_string , - (int) orig_request->port); -#else httpHeaderPutStrf(hdr_out, HDR_HOST, "%s:%d", - orig_request->host, + orig_request->GetHost(), (int) orig_request->port); -#endif } } Index: squid3/src/icp_v2.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/icp_v2.cc,v retrieving revision 1.17.8.13 retrieving revision 1.17.8.14 diff -u -r1.17.8.13 -r1.17.8.14 --- squid3/src/icp_v2.cc 1 May 2007 08:32:31 -0000 1.17.8.13 +++ squid3/src/icp_v2.cc 10 May 2007 12:57:45 -0000 1.17.8.14 @@ -1,6 +1,6 @@ /* - * $Id: icp_v2.cc,v 1.17.8.13 2007/05/01 08:32:31 amosjeffries Exp $ + * $Id: icp_v2.cc,v 1.17.8.14 2007/05/10 12:57:45 amosjeffries Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -138,8 +138,8 @@ codeToSend = ICP_HIT; } else { if (Config.onoff.test_reachability && rtt == 0) { - if ((rtt = netdbHostRtt(request->host)) == 0) - netdbPingSite(request->host); + if ((rtt = netdbHostRtt(request->GetHost())) == 0) + netdbPingSite(request->GetHost()); } if (icpGetCommonOpcode() != ICP_ERR) @@ -461,8 +461,8 @@ if (header.flags & ICP_FLAG_SRC_RTT) { - rtt = netdbHostRtt(icp_request->host); - int hops = netdbHostHops(icp_request->host); + rtt = netdbHostRtt(icp_request->GetHost()); + int hops = netdbHostHops(icp_request->GetHost()); src_rtt = ((hops & 0xFFFF) << 16) | (rtt & 0xFFFF); if (rtt) Index: squid3/src/internal.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/internal.cc,v retrieving revision 1.5.8.6 retrieving revision 1.5.8.7 diff -u -r1.5.8.6 -r1.5.8.7 --- squid3/src/internal.cc 29 Apr 2007 03:01:38 -0000 1.5.8.6 +++ squid3/src/internal.cc 10 May 2007 12:57:46 -0000 1.5.8.7 @@ -1,6 +1,6 @@ /* - * $Id: internal.cc,v 1.5.8.6 2007/04/29 03:01:38 amosjeffries Exp $ + * $Id: internal.cc,v 1.5.8.7 2007/05/10 12:57:46 amosjeffries Exp $ * * DEBUG: section 76 Internal Squid Object handling * AUTHOR: Duane, Alex, Henrik @@ -106,6 +106,15 @@ /* convert host name to lower case */ xstrncpy(lc_host, host, SQUIDHOSTNAMELEN); Tolower(lc_host); + +#if USE_IPV6 + /* check for an IP address and format appropriately if found */ + IPAddress test = lc_host; + if ( !test.IsAnyAddr() ) { + test.ToHostname(lc_host,SQUIDHOSTNAMELEN); + } +#endif + /* * append the domain in order to mirror the requests with appended * domains @@ -119,15 +128,8 @@ static MemBuf mb; mb.reset(); -#ifdef INET6 - if (NEEDS_BRACKETS(lc_host)) { - mb.Printf("http://[%s]", lc_host); - } else { - mb.Printf("http://%s", lc_host); - } -#else + mb.Printf("http://%s", lc_host); -#endif /* append port if not default */ if (port && port != urlDefaultPort(PROTO_HTTP)) Index: squid3/src/neighbors.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/neighbors.cc,v retrieving revision 1.23.4.17 retrieving revision 1.23.4.18 diff -u -r1.23.4.17 -r1.23.4.18 --- squid3/src/neighbors.cc 1 May 2007 08:32:31 -0000 1.23.4.17 +++ squid3/src/neighbors.cc 10 May 2007 12:57:46 -0000 1.23.4.18 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.23.4.17 2007/05/01 08:32:31 amosjeffries Exp $ + * $Id: neighbors.cc,v 1.23.4.18 2007/05/10 12:57:46 amosjeffries Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -123,7 +123,7 @@ const struct _domain_type *d = NULL; for (d = p->typelist; d; d = d->next) { - if (0 == matchDomainName(request->host, d->domain)) + if (0 == matchDomainName(request->GetHost(), d->domain)) if (d->type != PEER_NONE) return d->type; } @@ -165,7 +165,7 @@ do_ping = 0; for (d = p->peer_domain; d; d = d->next) { - if (0 == matchDomainName(request->host, d->domain)) { + if (0 == matchDomainName(request->GetHost(), d->domain)) { do_ping = d->do_ping; break; } Index: squid3/src/peer_select.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/peer_select.cc,v retrieving revision 1.9.4.9 retrieving revision 1.9.4.10 diff -u -r1.9.4.9 -r1.9.4.10 --- squid3/src/peer_select.cc 1 May 2007 08:32:31 -0000 1.9.4.9 +++ squid3/src/peer_select.cc 10 May 2007 12:57:46 -0000 1.9.4.10 @@ -1,6 +1,6 @@ /* - * $Id: peer_select.cc,v 1.9.4.9 2007/05/01 08:32:31 amosjeffries Exp $ + * $Id: peer_select.cc,v 1.9.4.10 2007/05/10 12:57:46 amosjeffries Exp $ * * DEBUG: section 44 Peer Selection Algorithm * AUTHOR: Duane Wessels @@ -254,7 +254,7 @@ if (psstate->direct == DIRECT_NO) return 0; - myrtt = netdbHostRtt(psstate->request->host); + myrtt = netdbHostRtt(psstate->request->GetHost()); debugs(44, 3, "peerCheckNetdbDirect: MY RTT = " << myrtt << " msec"); debugs(44, 3, "peerCheckNetdbDirect: minimum_direct_rtt = " << Config.minDirectRtt << " msec"); @@ -263,7 +263,7 @@ if (myrtt && myrtt <= Config.minDirectRtt) return 1; - myhops = netdbHostHops(psstate->request->host); + myhops = netdbHostHops(psstate->request->GetHost()); debugs(44, 3, "peerCheckNetdbDirect: MY hops = " << myhops); debugs(44, 3, "peerCheckNetdbDirect: minimum_direct_hops = " << Config.minDirectHops); @@ -290,7 +290,7 @@ { StoreEntry *entry = ps->entry; HttpRequest *request = ps->request; - debugs(44, 3, "peerSelectFoo: '" << RequestMethodStr[request->method] << " " << request->host << "'"); + debugs(44, 3, "peerSelectFoo: '" << RequestMethodStr[request->method] << " " << request->GetHost() << "'"); if (ps->direct == DIRECT_UNKNOWN) { if (ps->always_direct == 0 && Config.accessList.AlwaysDirect) { @@ -453,7 +453,7 @@ if (peerCheckNetdbDirect(ps)) { code = CLOSEST_DIRECT; - debugs(44, 3, "peerSelect: " << hier_strings[code] << "/" << request->host); + debugs(44, 3, "peerSelect: " << hier_strings[code] << "/" << request->GetHost()); peerAddFwdServer(&ps->servers, NULL, code); return; } @@ -505,7 +505,7 @@ peer *p; HttpRequest *request = ps->request; hier_code code = HIER_NONE; - debugs(44, 3, "peerGetSomeParent: " << RequestMethodStr[request->method] << " " << request->host); + debugs(44, 3, "peerGetSomeParent: " << RequestMethodStr[request->method] << " " << request->GetHost()); if (ps->direct == DIRECT_YES) return; Index: squid3/src/tunnel.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tunnel.cc,v retrieving revision 1.13.4.8 retrieving revision 1.13.4.9 diff -u -r1.13.4.8 -r1.13.4.9 --- squid3/src/tunnel.cc 1 May 2007 08:32:32 -0000 1.13.4.8 +++ squid3/src/tunnel.cc 10 May 2007 12:57:47 -0000 1.13.4.9 @@ -1,6 +1,6 @@ /* - * $Id: tunnel.cc,v 1.13.4.8 2007/05/01 08:32:32 amosjeffries Exp $ + * $Id: tunnel.cc,v 1.13.4.9 2007/05/10 12:57:47 amosjeffries Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -716,7 +716,7 @@ } sslState->servers = fs; - sslState->host = fs->_peer ? fs->_peer->host : request->host; + sslState->host = fs->_peer ? fs->_peer->host : xstrdup(request->GetHost()); if (fs->_peer == NULL) { sslState->port = request->port; Index: squid3/src/url.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/url.cc,v retrieving revision 1.9.8.14 retrieving revision 1.9.8.15 diff -u -r1.9.8.14 -r1.9.8.15 --- squid3/src/url.cc 29 Apr 2007 03:01:40 -0000 1.9.8.14 +++ squid3/src/url.cc 10 May 2007 12:57:47 -0000 1.9.8.15 @@ -1,6 +1,6 @@ /* - * $Id: url.cc,v 1.9.8.14 2007/04/29 03:01:40 amosjeffries Exp $ + * $Id: url.cc,v 1.9.8.15 2007/05/10 12:57:47 amosjeffries Exp $ * * DEBUG: section 23 URL Parsing * AUTHOR: Duane Wessels @@ -436,7 +436,7 @@ request->initHTTP(method, protocol, urlpath); } - xstrncpy(request->host, host, SQUIDHOSTNAMELEN); + request->SetHost(host); //xstrncpy(request->host(), host, SQUIDHOSTNAMELEN); xstrncpy(request->login, login, MAX_LOGIN_SZ); request->port = (u_short) port; return request; @@ -464,15 +464,7 @@ switch (request->method) { case METHOD_CONNECT: -#if USE_IPV6 - snprintf(urlbuf, MAX_URL, "%s%s%s:%d", - NEEDS_BRACKETS(request->host) ? "[" : null_string, - request->host, - NEEDS_BRACKETS(request->host) ? "]" : null_string, - request->port); -#else - snprintf(urlbuf, MAX_URL, "%s:%d", request->host, request->port); -#endif + snprintf(urlbuf, MAX_URL, "%s:%d", request->GetHost(), request->port); break; default: @@ -481,25 +473,13 @@ if (request->port != urlDefaultPort(request->protocol)) snprintf(portbuf, 32, ":%d", request->port); -#if USE_IPV6 - snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s%s%s", - ProtocolStr[request->protocol], - NEEDS_BRACKETS(request->host) ? "[" : null_string, - request->login, - *request->login ? "@" : null_string, - request->host, - NEEDS_BRACKETS(request->host) ? "]" : null_string, - portbuf, - request->urlpath.buf()); -#else snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s", ProtocolStr[request->protocol], request->login, *request->login ? "@" : null_string, - request->host, + request->GetHost(), portbuf, request->urlpath.buf()); -#endif break; } } @@ -521,17 +501,9 @@ switch (request->method) { case METHOD_CONNECT: -#if USE_IPV6 - snprintf(buf, MAX_URL, "%s%s%s:%d", - NEEDS_BRACKETS(request->host) ? "[" : null_string, - request->host, - NEEDS_BRACKETS(request->host) ? "]" : null_string, - request->port); -#else snprintf(buf, MAX_URL, "%s:%d", - request->host, + request->GetHost(), request->port); -#endif break; default: @@ -551,23 +523,12 @@ strcat(loginbuf, "@"); } -#if USE_IPV6 - snprintf(buf, MAX_URL, "%s://%s%s%s%s%s%s", - ProtocolStr[request->protocol], - NEEDS_BRACKETS(request->host) ? "[" : null_string, - loginbuf, - request->host, - NEEDS_BRACKETS(request->host) ? "]" : null_string, - portbuf, - request->urlpath.buf()); -#else snprintf(buf, MAX_URL, "%s://%s%s%s%s", ProtocolStr[request->protocol], loginbuf, - request->host, + request->GetHost(), portbuf, request->urlpath.buf()); -#endif /* * strip arguments AFTER a question-mark */ Index: squid3/src/tests/testHttpRequest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/testHttpRequest.cc,v retrieving revision 1.1.14.3 retrieving revision 1.1.14.4 diff -u -r1.1.14.3 -r1.1.14.4 --- squid3/src/tests/testHttpRequest.cc 15 Apr 2007 12:37:35 -0000 1.1.14.3 +++ squid3/src/tests/testHttpRequest.cc 10 May 2007 12:57:47 -0000 1.1.14.4 @@ -38,7 +38,7 @@ HttpRequest *nullRequest = NULL; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->host)); + CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/bar"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); CPPUNIT_ASSERT_EQUAL(String("http://foo:90/bar"), String(url)); @@ -50,7 +50,7 @@ expected_port = 80; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_PUT, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->host)); + CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/bar"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); CPPUNIT_ASSERT_EQUAL(String("http://foo/bar"), String(url)); @@ -67,7 +67,7 @@ expected_port = 45; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_CONNECT, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->host)); + CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String(""), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_NONE, aRequest->protocol); CPPUNIT_ASSERT_EQUAL(String("foo:45"), String(url)); @@ -87,7 +87,7 @@ expected_port = 90; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->host)); + CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/bar"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); CPPUNIT_ASSERT_EQUAL(String("http://foo:90/bar"), String(url)); @@ -110,7 +110,7 @@ expected_port = 80; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("200:800::45"), String(aRequest->host)); + CPPUNIT_ASSERT_EQUAL(String("200:800::45"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/foo"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); CPPUNIT_ASSERT_EQUAL(String("http://[200:800::45]/foo"), String(url)); @@ -122,7 +122,7 @@ expected_port = 90; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("2000:800::45"), String(aRequest->host)); + CPPUNIT_ASSERT_EQUAL(String("2000:800::45"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/foo"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); CPPUNIT_ASSERT_EQUAL(String("http://[2000:800::45]:90/foo"), String(url)); @@ -134,7 +134,7 @@ expected_port = 80; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("2000:800:45"), String(aRequest->host)); + CPPUNIT_ASSERT_EQUAL(String("2000:800:45"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/foo"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); CPPUNIT_ASSERT_EQUAL(String("http://2000:800:45/foo"), String(url));