]> git.ipfire.org Git - thirdparty/squid.git/commit - src/adaptation/icap/OptXact.cc
Bug #2583 fix: pure virtual method called
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 23 Aug 2010 23:15:26 +0000 (17:15 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 23 Aug 2010 23:15:26 +0000 (17:15 -0600)
commit4299f876344efc8a8446f2bc0c940fadad2bff09
treefdcbcc7c1219f22f21a49a4e6df804373869ce7b
parenta05af87908bad6c69f34834b10c3d8bdf470c9d0
Bug #2583 fix: pure virtual method called

When a cbdata-protected class holds its own cbdata and has virtual
toCbdata(), there is a catch22 problem: we need cbdata to know whether
the pointer to the class object is valid, and we need to dereference
that pointer to get cbdata.

Added CbcPointer class to hold both a pointer to a potentially freed
class object and the cbdata pointer protecting that object. Keeping the
cbdata pointer allows us to test whether the object is still there
without dereferencing the object pointer.

Use the CbcPointer class to hold safe pointers to AsyncJobs. This
prevents "pure virtual method called" failures because we no longer
dereference freed job pointers.

Removed Initiator parameter from many initiatee constructors. The
Adaptation::Initiator::initiateAdaptation method now sets the initiator
of the job. This makes the constructor profile simpler and removes the
need to propagate Initiator changes through all the [nested]
constructors.

Renamed AsyncJob::AsyncStart() to AsyncJob::Start(). I had to change the
callers code anyway and it was a good opportunity to remove the
redundant "Async".

Special thanks to Stefan Fritsch for updating and testing an earlier
version of this patch.
41 files changed:
src/BodyPipe.cc
src/BodyPipe.h
src/CommCalls.h
src/Server.cc
src/Server.h
src/adaptation/AccessCheck.cc
src/adaptation/Initiate.cc
src/adaptation/Initiate.h
src/adaptation/Initiator.cc
src/adaptation/Initiator.h
src/adaptation/Iterator.cc
src/adaptation/Iterator.h
src/adaptation/Service.h
src/adaptation/ecap/ServiceRep.cc
src/adaptation/ecap/ServiceRep.h
src/adaptation/ecap/XactionRep.cc
src/adaptation/ecap/XactionRep.h
src/adaptation/icap/Launcher.cc
src/adaptation/icap/Launcher.h
src/adaptation/icap/ModXact.cc
src/adaptation/icap/ModXact.h
src/adaptation/icap/OptXact.cc
src/adaptation/icap/OptXact.h
src/adaptation/icap/ServiceRep.cc
src/adaptation/icap/ServiceRep.h
src/adaptation/icap/Xaction.cc
src/adaptation/icap/Xaction.h
src/base/AsyncJob.cc
src/base/AsyncJob.h
src/base/AsyncJobCalls.h
src/base/AsyncJobs.dox
src/base/CbcPointer.h [new file with mode: 0644]
src/base/Makefile.am
src/client_side.cc
src/client_side_request.cc
src/client_side_request.h
src/ftp.cc
src/http.cc
src/ipc/Port.cc
src/ipc/UdsOp.cc
src/main.cc