<tag>logformat</tag>
<p><em>%>bs</em> Number of HTTP-equivalent message body bytes received from the next hop.
<p><em>icap::%>bs</em> Number of message body bytes received from the ICAP server.
- <p><em>%>lp</em> Local TCP port used by transactions with http servers.
+ <p><em>%<la</em> Local IP address of the last server or peer connection. Ported from 2.7 where it is called <em>%oa</em>.
+ <p><em>%<lp</em> Local port number of the last server or peer connection.
<p><em>%sn</em> Unique sequence number per log line. Ported from 2.7
<p><em>%>eui</em> EUI logging (EUI-48 / MAC address for IPv4, EUI-64 for IPv6)
Both EUI forms are logged in the same field. Type can be identified by length or byte delimiter.
<tag>location_rewrite_program</tag>
<p>Not yet ported from 2.6
- <tag>logformat</tag>
- <p><em>%oa</em> tag not yet ported from 2.7
-
<tag>refresh_pattern</tag>
<p><em>stale-while-revalidate=</em> not yet ported from 2.7
<p><em>ignore-stale-while-revalidate=</em> not yet ported from 2.7
#define SQUID_HTTPHIERARCHYLOGENTRY_H
#include "hier_code.h"
+#include "ip/Address.h"
#include "lookup_t.h"
#include "rfc2181.h"
#include "PingData.h"
int64_t peer_response_time; ///< last peer response delay
timeval first_conn_start; ///< first connection use among all peers
int64_t total_response_time; ///< cumulative for all peers
- u_short peer_local_port; //< local port of the last server-side connection
+ Ip::Address peer_local_addr; ///< local IP:port of the last server-side connection
int64_t bodyBytesRead; ///< number of body bytes received from the next hop or -1
};
<A Server IP address or peer name
la Local IP address (http_port)
lp Local port number (http_port)
+ <la Local IP address of the last server or peer connection
<lp Local port number of the last server or peer connection
Time related format codes:
comm_add_close_handler(fd, fwdServerClosedWrapper, this);
- // TODO: Avoid this if %<lp is not used? F->local_port is often cached.
- request->hier.peer_local_port = comm_local_port(fd);
+ if (comm_local_port(fd))
+ request->hier.peer_local_addr = fd_table[fd].local_addr;
dispatch();
if (!fs->_peer)
origin_tries++;
- request->hier.peer_local_port = comm_local_port(fd);
+ 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
case LFT_LOCAL_IP:
if (al->request) {
- out = al->request->my_addr.NtoA(tmp,1024);
+ out = al->request->my_addr.NtoA(tmp,sizeof(tmp));
}
break;
break;
+ // the fmt->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 (al->hier.peer_local_port) {
- outint = al->hier.peer_local_port;
+ if ((outint = al->hier.peer_local_addr.GetPort())) {
doint = 1;
}
/*{ "<p", LFT_SERVER_PORT }, */
{"<A", LFT_SERVER_IP_OR_PEER_NAME},
- /* {"oa", LFT_OUTGOING_IP}, */
- /* {"ot", LFT_OUTGOING_TOS}, */
-
{"la", LFT_LOCAL_IP},
{"lp", LFT_LOCAL_PORT},
/*{ "lA", LFT_LOCAL_NAME }, */
+
+ {"<la", LFT_PEER_LOCAL_IP},
+ {"oa", LFT_PEER_LOCAL_IP_OLD_27},
{"<lp", LFT_PEER_LOCAL_PORT},
+ /* {"ot", LFT_PEER_OUTGOING_TOS}, */
{"ts", LFT_TIME_SECONDS_SINCE_EPOCH},
{"tu", LFT_TIME_SUBSECOND},
break;
case LFT_HTTP_SENT_STATUS_CODE_OLD_30:
- debugs(46, 0, "WARNING: the \"Hs\" formating code is deprecated use the \">Hs\" instead");
+ debugs(46, 0, "WARNING: The \"Hs\" formatting 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 \"<la\" instead.");
+ lt->type = LFT_PEER_LOCAL_IP;
+ break;
+
default:
break;
}
LFT_LOCAL_IP,
LFT_LOCAL_PORT,
/*LFT_LOCAL_NAME, */
+ LFT_PEER_LOCAL_IP,
+ LFT_PEER_LOCAL_IP_OLD_27,
LFT_PEER_LOCAL_PORT,
LFT_TIME_SECONDS_SINCE_EPOCH,
peer_reply_status(HTTP_STATUS_NONE),
peer_response_time(-1),
total_response_time(-1),
- peer_local_port(0),
+ peer_local_addr(),
bodyBytesRead(-1)
{
memset(host, '\0', SQUIDHOSTNAMELEN);
return;
}
- request->hier.peer_local_port = comm_local_port(sock); // for %<lp logging
+ // record local IP:port for %<la and %<lp logging
+ if (comm_local_port(sock))
+ request->hier.peer_local_addr = fd_table[sock].local_addr;
tunnelState = new TunnelStateData;
#if USE_DELAY_POOLS