]> git.ipfire.org Git - thirdparty/squid.git/commit
%la for intercepted connections
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 9 Sep 2011 20:41:40 +0000 (23:41 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 9 Sep 2011 20:41:40 +0000 (23:41 +0300)
commit284175067442617f6d20f4cddceca4d7c16891ff
treee42d7aa65bce96934b2e89d2744dccd8bdfbd2ce
parent60c3d5b748b63f887ccb314b095fb4e0137f6edd
%la for intercepted connections

This patch adjusts the %la logformat code handling for intercepted connections
based on the following rules:
 - If the corresponding http_port or https_port option has an explicit
   listening host name or IP address, then log the IP address.
 - Otherwise, log a dash character.

Also adjusts %lp logformat code handling for intercepted connections to always
log the port number from the corresponding http_port or https_port option.

Amos comments about %la formating code:
For the record these are the permutations we seek to cover...

Scenario 1: client 192.168.0.3 connects to google (74.125.237.81). Gets intercepted into Squid.

  1a) squid.conf:  http_port 3129 intercept|tproxy

   tcpClient->remote == 192.168.0.3:$random    (%>a:%>p)
   tcpClient->local == 74.125.237.81:80        (%>la:%>lp)
   al->cache.port->s.local == 0.0.0.0:3129     (%la:%lp) [log "-"]

  1b) squid.conf:  http_port 192.168.0.1:3129 intercept|tproxy

   tcpClient->remote == 192.168.0.3:$random    (%>a:%>p)
   tcpClient->local == 74.125.237.81:80        (%>la:%>lp)
   al->cache.port->s.local == 192.168.0.1:3129  (%la:%lp) [log 192...]

Scenario 2: client 192.168.0.3 connects to Squid asking for http://google.com

  2a) squid.conf:  http_port 3128 [accel]

   tcpClient->remote == 192.168.0.3:$random    (%>a:%>p)
   tcpClient->local == 192.168.0.1:3128        (%>la:%>lp)
   al->cache.port->s.local == 0.0.0.0:3128     (%la:%lp) [log 192...]

  2b) squid.conf:  http_port 192.168.0.1:3128 [accel]

   tcpClient->remote == 192.168.0.3:$random    (%>a:%>p)
   tcpClient->local == 192.168.0.1:3128        (%>la:%>lp)
   al->cache.port->s.local == 192.168.0.1:3128 (%la:%lp) [log 192...]

Senario 3: squid generates an internal request.

 tcpClient == NULL    (%>a:%>p,%>la:%>lp) [log "-"]
 al->cache.port == NULL     (%la:%lp) [log "-"]
src/AccessLogEntry.h
src/cf.data.pre
src/client_side.cc
src/format/Format.cc
src/format/Tokens.cc
src/format/Tokens.h
src/log/access_log.cc