]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix socket accounting for TCP accept() (#854)
authorAmos Jeffries <yadij@users.noreply.github.com>
Mon, 5 Jul 2021 14:55:29 +0000 (14:55 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 7 Jul 2021 14:56:08 +0000 (14:56 +0000)
commit72bfd2f252168d73144756139076d0aced491ced
tree2b6ebc44a6a5ff82b7b187271e76531f9782cc70
parent5ea861f588d65785773f9b979b3d019f8643dbea
Fix socket accounting for TCP accept() (#854)

The incoming_sockets_accepted counter is used by Comm I/O modules to
count the number of successfully accept()ed FDs during a single
select(2) (or equivalent) scan of ready descriptors. For TCP
connections, the official code incremented that counter in the async
TcpAcceptor callbacks. Those callbacks run outside the counting Comm I/O
context, rendering counter increments useless and resulting in
under-reporting of actual acceptance activity.

Also, some successfully accepted TCP connections fire no callbacks, so
it is conceptually wrong to count accepted sockets in callbacks,
regardless of the timing problems.
src/client_side.cc
src/comm/TcpAcceptor.cc
src/servers/FtpServer.cc