]> git.ipfire.org Git - thirdparty/squid.git/commit - src/base/AsyncCall.h
Author: Stefan Fritsch <sf@sfritsch.de>
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 2 Dec 2010 23:33:27 +0000 (16:33 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 2 Dec 2010 23:33:27 +0000 (16:33 -0700)
commit37cba319026e2bd0dd323fb01182f1dda8cbe593
tree85a1cfb7b4bc77903408adc41748f8c925ddafe0
parentf7b048461dc33641e1ccb5339bd996d30625acb9
Author: Stefan Fritsch <sf@sfritsch.de>
Bug 3096: Squid destroys CbDataList<DeferredRead> objects too late

When server download speed exceeds client download speed, Squid creates a
CbDataList<DeferredRead> object and associates a comm_close handler with it.
When the server kicks the deferred read, the comm_close handler is canceled.
This create/cancel sequence happens every time the server-side code wants to
read but has to wait for the client, which may happen hundreds of times per
second.

Before this change, those canceled comm_close handlers were not removed from
Comm until the end of the entire server transaction, possibly accumulating
thousands of CbDataList<DeferredRead> objects tied to the socket descriptor
via the canceled but still stored close handler.

comm_remove_close_handler now immediately removes canceled close handlers to
avoid their accumulation.
src/base/AsyncCall.cc
src/base/AsyncCall.h
src/comm.cc