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
};
extern void hierarchyNote(HierarchyLogEntry *, hier_code, const char *);
<A Server IP address or peer name
la Local IP address (http_port)
lp Local port number (http_port)
+ <lp Local port number of the last server or peer connection
sn Unique sequence number per log line entry
ts Seconds since epoch
tu subsecond time (milliseconds)
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);
+
dispatch();
return;
if (!fs->_peer)
origin_tries++;
+ request->hier.peer_local_port = comm_local_port(fd);
+
/*
* stats.conn_open is used to account for the number of
* connections that we have open to the peer, so we can limit
LFT_LOCAL_IP,
LFT_LOCAL_PORT,
/*LFT_LOCAL_NAME, */
+ LFT_PEER_LOCAL_PORT,
LFT_TIME_SECONDS_SINCE_EPOCH,
LFT_TIME_SUBSECOND,
{"la", LFT_LOCAL_IP},
{"lp", LFT_LOCAL_PORT},
/*{ "lA", LFT_LOCAL_NAME }, */
+ {"<lp", LFT_PEER_LOCAL_PORT},
{"ts", LFT_TIME_SECONDS_SINCE_EPOCH},
{"tu", LFT_TIME_SUBSECOND},
break;
+ case LFT_PEER_LOCAL_PORT:
+ if (al->hier.peer_local_port) {
+ outint = al->hier.peer_local_port;
+ doint = 1;
+ }
+
+ break;
+
case LFT_TIME_SECONDS_SINCE_EPOCH:
// some platforms store time in 32-bit, some 64-bit...
outoff = static_cast<int64_t>(current_time.tv_sec);
n_ichoices(0),
peer_reply_status(HTTP_STATUS_NONE),
peer_response_time(-1),
- total_response_time(-1)
+ total_response_time(-1),
+ peer_local_port(0)
{
memset(host, '\0', SQUIDHOSTNAMELEN);
memset(cd_host, '\0', SQUIDHOSTNAMELEN);