--------------------- PatchSet 5494 Date: 2007/08/25 15:02:34 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Fix the cause of some bits of weirdness. valgrind detected. Members: lib/IPAddress.cc:1.1.2.68->1.1.2.69 lib/rfc3596.c:1.1.2.3->1.1.2.4 src/cache_cf.cc:1.40.2.39->1.40.2.40 src/client_side.cc:1.68.2.38->1.68.2.39 Index: squid3/lib/IPAddress.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/lib/Attic/IPAddress.cc,v retrieving revision 1.1.2.68 retrieving revision 1.1.2.69 diff -u -r1.1.2.68 -r1.1.2.69 --- squid3/lib/IPAddress.cc 22 Aug 2007 08:25:00 -0000 1.1.2.68 +++ squid3/lib/IPAddress.cc 25 Aug 2007 15:02:34 -0000 1.1.2.69 @@ -1,5 +1,5 @@ /* - * $Id: IPAddress.cc,v 1.1.2.68 2007/08/22 08:25:00 amosjeffries Exp $ + * $Id: IPAddress.cc,v 1.1.2.69 2007/08/25 15:02:34 amosjeffries Exp $ * * DEBUG: section 14 IP Storage and Handling * AUTHOR: Amos Jeffries @@ -293,7 +293,11 @@ /// NOTE: Does NOT clear the Port stored. Ony the Address and Type. void IPAddress::SetAnyAddr() { - memset(&m_SocketAddr.sin6_addr, 0, sizeof(m_SocketAddr.sin6_addr) ); +#if USE_IPV6 + memset(&m_SocketAddr.sin6_addr, 0, sizeof(struct in6_addr) ); +#else + memset(&m_SocketAddr.sin_addr, 0, sizeof(struct in_addr) ); +#endif } /// NOTE: completely empties the IPAddress structure. Address, Port, Type, everything. @@ -380,8 +384,13 @@ void IPAddress::SetNoAddr() { - memset(&(m_SocketAddr.sin6_addr),0xFFFFFFFF,sizeof(m_SocketAddr.sin6_addr)); +#if USE_IPV6 + memset(&m_SocketAddr.sin6_addr, 0xFFFFFFFF, sizeof(struct in6_addr) ); m_SocketAddr.sin6_family = AF_INET6; +#else + memset(&m_SocketAddr.sin_addr, 0xFFFFFFFF, sizeof(struct in_addr) ); + m_SocketAddr.sin_family = AF_INET; +#endif } #if USE_IPV6 Index: squid3/lib/rfc3596.c =================================================================== RCS file: /cvsroot/squid-sf//squid3/lib/Attic/rfc3596.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid3/lib/rfc3596.c 25 Apr 2007 12:53:44 -0000 1.1.2.3 +++ squid3/lib/rfc3596.c 25 Aug 2007 15:02:34 -0000 1.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: rfc3596.c,v 1.1.2.3 2007/04/25 12:53:44 amosjeffries Exp $ + * $Id: rfc3596.c,v 1.1.2.4 2007/08/25 15:02:34 amosjeffries Exp $ * * Low level DNS protocol routines * AUTHOR: Amos Jeffries, Rafael Martinez Torres @@ -191,7 +191,7 @@ for(i = 15; i >= 0; i--, p+=4) { - snprintf(p, 4, "%x.%x.", ((r[i]>>4)&0xf), (r[i])&0xf ); + snprintf(p, 4, "%1x.%1x.", ((r[i]>>4)&0xf), (r[i])&0xf ); } snprintf(p,10,"ip6.arpa."); Index: squid3/src/cache_cf.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/cache_cf.cc,v retrieving revision 1.40.2.39 retrieving revision 1.40.2.40 diff -u -r1.40.2.39 -r1.40.2.40 --- squid3/src/cache_cf.cc 21 Aug 2007 12:52:18 -0000 1.40.2.39 +++ squid3/src/cache_cf.cc 25 Aug 2007 15:02:34 -0000 1.40.2.40 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.40.2.39 2007/08/21 12:52:18 amosjeffries Exp $ + * $Id: cache_cf.cc,v 1.40.2.40 2007/08/25 15:02:34 amosjeffries Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2738,22 +2738,23 @@ if (NULL == host) { s->s.SetAnyAddr(); + s->s.SetPort(port); debugs(3, 3, "http(s)_port: found Listen on wildcard address: " << s->s); } else if ( s->s = host ) { /* check/parse numeric IPA */ + s->s.SetPort(port); debugs(3, 3, "http(s)_port: Listen on Host/IP: " << host << " --> " << s->s); } else if ( s->s.GetHostByName(host) ) { /* check/parse for FQDN */ /* dont use ipcache */ s->defaultsite = xstrdup(host); + s->s.SetPort(port); debugs(3, 3, "http(s)_port: found Listen as Host " << s->defaultsite << " on IP: " << s->s); } else { debugs(3, 0, "http(s)_port: failed to resolve Host/IP: " << host); self_destruct(); } - - s->s.SetPort(port); } static void Index: squid3/src/client_side.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side.cc,v retrieving revision 1.68.2.38 retrieving revision 1.68.2.39 diff -u -r1.68.2.38 -r1.68.2.39 --- squid3/src/client_side.cc 19 Aug 2007 11:03:13 -0000 1.68.2.38 +++ squid3/src/client_side.cc 25 Aug 2007 15:02:34 -0000 1.68.2.39 @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.68.2.38 2007/08/19 11:03:13 amosjeffries Exp $ + * $Id: client_side.cc,v 1.68.2.39 2007/08/25 15:02:34 amosjeffries Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2975,8 +2975,8 @@ static void clientHttpConnectionsOpen(void) { - http_port_list *s; - int fd; + http_port_list *s = NULL; + int fd = -1; for (s = Config.Sockaddr.http; s; s = s->next) { if (MAXHTTPPORTS == NHttpSockets) {