Squid-2.2.DEVEL3: Log destination IP on DIRECT This patch logs the destination IP as part of the hierarchy tag in access.log when going direct. This has been requested by a number of people from accounting reasons, and logging the hostname is mostly redundant as it is part of the URL as well. Index: squid/src/forward.c diff -u squid/src/forward.c:1.1.1.9.2.2 squid/src/forward.c:1.1.1.9.2.3 --- squid/src/forward.c:1.1.1.9.2.2 Sat Mar 6 22:52:27 1999 +++ squid/src/forward.c Tue Mar 9 23:02:10 1999 @@ -191,6 +191,10 @@ comm_close(server_fd); } else { debug(17, 3) ("fwdConnectDone: FD %d: '%s'\n", server_fd, storeUrl(fwdState->entry)); + if (fs->peer) + hierarchyNote(&fwdState->request->hier, fs->code, fs->peer->host); + else + hierarchyNote(&fwdState->request->hier, fs->code, fd_table[server_fd].ipaddr); fd_note(server_fd, storeUrl(fwdState->entry)); fd_table[server_fd].uses++; if (fs->peer) @@ -237,7 +241,6 @@ host = fwdState->request->host; port = fwdState->request->port; } - hierarchyNote(&fwdState->request->hier, fs->code, host); if ((fd = pconnPop(host, port)) >= 0) { debug(17, 3) ("fwdConnectStart: reusing pconn FD %d\n", fd); fwdState->server_fd = fd;