]> git.ipfire.org Git - thirdparty/squid.git/commit
Fixed %<Hs, %<pt, %<tt, %<bs calculation bugs for error responses (#79)
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 16 Nov 2017 05:11:19 +0000 (22:11 -0700)
committerGitHub <noreply@github.com>
Thu, 16 Nov 2017 05:11:19 +0000 (22:11 -0700)
commitd81657759f3ac9f3e688b4b2e8051166a23f01e1
tree9c9570f2bc477fd1ee1bc572ee193fed08011df7
parent8341f96de105a95265087b6546c1a57d98c7ac39
Fixed %<Hs, %<pt, %<tt, %<bs calculation bugs for error responses (#79)

This change started as a %<Hs fix described in the first bullet but
subsequent testing exposed the bug described in the second bullet,
fixing which resulted in other related fixes/improvements:

* Fixed %<Hs for received CONNECT errors: Correctly store the response
  status code for %<Hs logging (instead of misplacing it in the %>Hs
  location that was later overwritten with the correct to-client value).

* Fixed %<pt and %<tt for received CONNECT errors: Squid tunneling code
  was missing message I/O timing maintenance required for those %codes.

* Probably fixed %<bs logging bug on forwarding retries: Squid did not
  clear the (bodyBytesRead) counter between retries.

* Possibly improved %<Hs, %<pt, %<tt, %<bs logging on SslBump errors:
  request->hier member did not copy all the sslServerBump->request->hier
  details when generating an error response in
  ConnStateData::serveDelayedError().

* Probably fixed a server.all.kbytes_out and server.other.kbytes_out
  statistics bug: Squid missed written CONNECT request header bytes.

Also improved HierarchyLogEntry-related code: Reduced code duplication,
removed unnecessary destructor, and described the class. Removed
peer_http_request_sent timestamp because it ought to be equal to the
last request write time (now peer_last_write_).

TODO: Relay (expected) peer CONNECT error responses to users (instead of
hiding them behind a Squid-generated ERR_CONNECT_FAIL) and support %<h.
src/FwdState.cc
src/HierarchyLogEntry.h
src/client_side.cc
src/clients/Client.cc
src/format/Format.cc
src/http.cc
src/log/access_log.cc
src/store.cc
src/tests/stub_access_log.cc
src/tunnel.cc