------------------------------------------------------------ revno: 9574 revision-id: squid3@treenet.co.nz-20090606001407-a1aumyggp72en3u0 parent: squid3@treenet.co.nz-20090606001144-gpfzd19pe0do3xp5 committer: Amos Jeffries branch nick: SQUID_3_1 timestamp: Sat 2009-06-06 12:14:07 +1200 message: Port from 2.7: Show local address on listening sockets ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20090606001407-a1aumyggp72en3u0 # target_branch: http://www.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 59e8493eb1e9445bf5ce489d05ac6a5ec92803db # timestamp: 2009-06-06 00:14:30 +0000 # source_branch: http://www.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20090606001144-\ # gpfzd19pe0do3xp5 # # Begin patch === modified file 'src/fde.cc' --- src/fde.cc 2009-02-01 10:09:23 +0000 +++ src/fde.cc 2009-06-06 00:14:07 +0000 @@ -107,12 +107,15 @@ char const * fde::remoteAddr() const { - LOCAL_ARRAY(char, buf, 32); + LOCAL_ARRAY(char, buf, MAX_IPSTRLEN ); if (type != FD_SOCKET) return null_string; - snprintf(buf, 32, "%s.%d", ipaddr, (int) remote_port); + if ( *ipaddr ) + snprintf( buf, MAX_IPSTRLEN, "%s:%d", ipaddr, (int)remote_port); + else + local_addr.ToURL(buf,MAX_IPSTRLEN); // ToHostname does not include port. return buf; }