]> git.ipfire.org Git - thirdparty/squid.git/commit
Keep Connection and other objects in sync with Comm in closure callbacks
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 9 Aug 2021 02:46:31 +0000 (22:46 -0400)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 9 Aug 2021 02:46:31 +0000 (22:46 -0400)
commite05a15516e0045f20d22dfdc0936cbb36a4fe9f7
treef5ec04392c524237d65599412fdadcb116c18b15
parent9eab3ce7df7aad8026caf31632de98a434f0b1da
Keep Connection and other objects in sync with Comm in closure callbacks

There are lots of small bugs, inconsistencies, and other problems in
Connection closure handlers. It is not clear whether any of those
problems could result in serious runtime errors or leaks. In theory, the
rest of the code could neutralize their negative side effects. However,
even in that case, it was just a matter of time before the next bug will
bite us due to stale Connection::fd and such. These changes themselves
carry elevated risk, but I think we have to do them to get closer to a
reliable code as far as Connection maintenance is concerned; otherwise,
we will keep chasing their deadly side effects.

Long-term, all these manual efforts to keep things in sync should become
unnecessary with the introduction of appropriate Connection ownership
APIs that automatically maintain the corresponding environments (TODO).

Also marked a few newly uncovered bugs in the official code.
19 files changed:
src/FwdState.cc
src/FwdState.h
src/adaptation/icap/Xaction.cc
src/client_side.cc
src/clients/FtpClient.cc
src/clients/HttpTunneler.cc
src/comm.cc
src/comm/TcpAcceptor.cc
src/dns_internal.cc
src/gopher.cc
src/ident/Ident.cc
src/log/TcpLogger.cc
src/mgr/Forwarder.cc
src/mgr/Inquirer.cc
src/mgr/StoreToCommWriter.cc
src/security/PeerConnector.cc
src/snmp/Forwarder.cc
src/snmp/Inquirer.cc
src/whois.cc