]> git.ipfire.org Git - thirdparty/squid.git/commit - src/tests/stub_liblog.cc
Fix some failed transactions not being logged.
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Fri, 22 Jul 2016 19:37:12 +0000 (07:37 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 22 Jul 2016 19:37:12 +0000 (07:37 +1200)
commitda6dbcd110f7603f6d4cd9b3eef749311293fe77
treeaf9967ecedfc955a11b338ace5ee2d51fab234cd
parent7b2b7ef6c34410187888add4f9cb1cb0b530d001
Fix some failed transactions not being logged.

There are situations when Squid logs nothing to access.log after an
[abnormal] transaction termination. Such "stealthy" transactions may be
a security risk and an accounting problem.

ClientHttpRequest is responsible for logging most transactions but that
object is created only after the HTTP request headers are successfully
parsed. Request header parsing errors may be detected and logged
appropriately, but the job handling the incoming transaction may
terminate for reasons outside the parsing code control (e.g., a job-
killing exception thrown when there are no request headers to start
parsing yet or when the job waits for more request headers to finishing
parsing).

This change adds access logging for three cases:

1. accept(2) system call errors (before ConnStateData job is created).

2. Unexpected ConnStateData job termination, when there is no
   ClientHttpRequest to log the failure.

3. Connections which send no bytes: these connections drain Squid
   resources and, hence, should be logged.
   TODO: make this behavior configurable because some browsers are known to
   routinely create such connections(and, hence, logging them may create
   too much noise in some environments).
12 files changed:
doc/release-notes/release-4.sgml
src/Makefile.am
src/Pipeline.cc
src/Pipeline.h
src/client_side.cc
src/client_side.h
src/comm/TcpAcceptor.cc
src/comm/TcpAcceptor.h
src/servers/Server.cc
src/servers/Server.h
src/tests/stub_icp.cc
src/tests/stub_liblog.cc