]> git.ipfire.org Git - thirdparty/squid.git/commit
Removed StoreEntry::hidden_mem_obj.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 24 Jun 2013 17:05:13 +0000 (11:05 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 24 Jun 2013 17:05:13 +0000 (11:05 -0600)
commitc877c0bca97f07d63a092fc9f0e31ee63a05064a
tree3322a532287c0859e0c9766faaaf070966d3ae49
parent4475555f19b4b53536230b757d11ef7252372e29
Removed StoreEntry::hidden_mem_obj.
Replaced MemObject::url with MemObject::urlXXX() and storeId().

* Replace StoreEntry::hidden_mem_obj hack with explicit MemObject::setUris().
We need MemObject to tie Store::get() results to locked memory cache entries
and such but Store::get() does not know the entry URIs so we had to use fake
"TBD" URIs instead.  The hidden_mem_obj hack was added to minimize chances
that those temporary "TBD" URIs are going to be logged or forwarded.

However, new code uses MemObject cache ties a lot more, and it became too
cumbersome and error prone to always check whether there is a hidden object
holding indexes of locked StoreMap entries. It should be easier to ensure
that true URIs are set after Store::get() instead.

* Provide accessors for MemObject::url (which is actually a store ID these
days) and MemObject::log_url (which is usually the same as the url so we now
do not allocated it when it is the same). These accessors allow us to verify
that the caller is not going to use an undefined URI or Store ID because some
code forgot to set them explicitly.

* Add urlXXX() to mark old callers that appear to assume that MemObject::url
still holds a URI (instead of StoreID). Fixing those callers is outside this
project scope, but this was a good opportunity to identify/mark them because
we needed to hide raw Store ID field name ("url") anyway.
14 files changed:
src/MemObject.cc
src/MemObject.h
src/MemStore.cc
src/Store.h
src/StoreMetaURL.cc
src/client_side.cc
src/client_side_reply.cc
src/http.cc
src/peer_digest.cc
src/refresh.cc
src/store.cc
src/store_client.cc
src/store_log.cc
src/tests/stub_store.cc