]> git.ipfire.org Git - thirdparty/squid.git/commit
Made eCAP compile again after CbcPointer<> changes.
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 29 Aug 2010 21:50:09 +0000 (15:50 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Sun, 29 Aug 2010 21:50:09 +0000 (15:50 -0600)
commit419adc9d1ddc75272df418ba69e437f459634b02
tree80d82266d34038640490c9a38af8a7f3e2806794
parent596e3d5f059f84c8181513c27a354b0e46d3b7ba
Made eCAP compile again after CbcPointer<> changes.

Old eCAP code tried to call stillProducing(this) and stillConsuming(this)
methods from a const status() method. Doing so produces compiler errors
because stillProducing() and stillConsuming() do not accept pointers to
constant jobs.

CBDATA_CLASSes and, hence, CbcPointer<>, do not support const-correctness
well: In order to create/destroy a cbdata-based smart pointer, one has to
lock/unlock cbdata, which requires modifying the object. Thus, the smart
pointer cannot point to a truly constant object. The core of the problem is
that CBDATA_CLASSes keep cbdata and object data together. When all raw/dumb
CBDATA_CLASS pointers are gone, we can separate the two "datas" and solve the
const-correctness problem for good. The "separate-datas" design would even be
consistent with the original cbdata design which we often violate, IMO.

There are other workarounds. We could declare toCbdata() constant, for
example. However, that would essentially disable checks where a
cbdata-protected object is being destroyed despite the caller's intent to keep
the object constant. This change is not as general but is also much less
intrusive.
src/adaptation/ecap/XactionRep.cc