------------------------------------------------------------ revno: 10305 revision-id: squid3@treenet.co.nz-20110607021337-6t3jv37ft2ly8q8c parent: squid3@treenet.co.nz-20110531042555-0ltfgposjhgaak4a fixes bug(s): http://bugs.squid-cache.org/show_bug.cgi?id=3236 author: Amos Jeffries , Christos Tsantilas committer: Amos Jeffries branch nick: SQUID_3_1 timestamp: Mon 2011-06-06 20:13:37 -0600 message: Bug 3236: Port of %oa, %type can not be LFT_PEER_LOCAL_IP_OLD_27 + // but compiler complains if ommited + case LFT_PEER_LOCAL_IP_OLD_27: + case LFT_PEER_LOCAL_IP: + if (!al->hier.peer_local_addr.IsAnyAddr()) { + out = al->hier.peer_local_addr.NtoA(tmp,sizeof(tmp)); + } + break; + + case LFT_PEER_LOCAL_PORT: + if ((outint = al->hier.peer_local_addr.GetPort())) { + doint = 1; + } + + break; + case LFT_TIME_SECONDS_SINCE_EPOCH: // some platforms store time in 32-bit, some 64-bit... outoff = static_cast(current_time.tv_sec); @@ -1498,6 +1521,12 @@ debugs(46, 0, "WARNING: the \"Hs\" formating code is deprecated use the \">Hs\" instead"); lt->type = LFT_HTTP_SENT_STATUS_CODE; break; + + case LFT_PEER_LOCAL_IP_OLD_27: + debugs(46, 0, "WARNING: The \"oa\" formatting code is deprecated. Use the \"type = LFT_PEER_LOCAL_IP; + break; + default: break; } @@ -2049,7 +2078,8 @@ n_ichoices(0), peer_reply_status(HTTP_STATUS_NONE), peer_response_time(-1), - total_response_time(-1) + total_response_time(-1), + peer_local_addr() { memset(host, '\0', SQUIDHOSTNAMELEN); memset(cd_host, '\0', SQUIDHOSTNAMELEN); === modified file 'src/cf.data.pre' --- src/cf.data.pre 2011-05-29 14:20:41 +0000 +++ src/cf.data.pre 2011-06-07 02:13:37 +0000 @@ -2535,6 +2535,8 @@ hier.peer_local_addr = fd_table[fd].local_addr; + dispatch(); return; @@ -950,6 +953,9 @@ if (!fs->_peer) origin_tries++; + if (comm_local_port(fd)) + request->hier.peer_local_addr = fd_table[fd].local_addr; + /* * stats.conn_open is used to account for the number of * connections that we have open to the peer, so we can limit === modified file 'src/tunnel.cc' --- src/tunnel.cc 2011-04-11 12:00:03 +0000 +++ src/tunnel.cc 2011-06-07 02:13:37 +0000 @@ -676,6 +676,10 @@ return; } + // record local IP:port for %hier.peer_local_addr = fd_table[sock].local_addr; + tunnelState = new TunnelStateData; #if DELAY_POOLS