]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Several fixes and improvements to help collapsed forwarding work reliably:
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 1 Jul 2013 02:25:50 +0000 (20:25 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 1 Jul 2013 02:25:50 +0000 (20:25 -0600)
Removed ENTRY_CACHABLE. AFAICT, it was just negating RELEASE_REQUEST AFAICT.

Broadcast transients index instead of key because key may become private.

Squid uses private keys to resolve store_table collisions (among other
things). Thus, a public entry may become private at any time, at any worker.
Using keys results in collapsed entries getting stuck waiting for an update.
The transients index remains constant and can be used for reliable
synchronization.

Using transient index, however, requires storing a pointer to the transient
entry corresponding to that index. Otherwise, there is no API to find the
entry object when a notification comes: Store::Root().get() needs a key.

Mark an entry for release when setting its key from public to private. The old
code was only logging SWAP_LOG_DEL, but we now need to prevent requests in
other workers from collapsing on top of a now-private cache entry. In many
cases, such an entry is in trouble (but not all cases because private keys are
also used for store_table collision resolution).

Fixed syncing of abandoned entries.

Prevent new requests from collapsing on writer-less transient entries.

20 files changed:
src/CollapsedForwarding.cc
src/MemStore.cc
src/Store.h
src/SwapDir.h
src/Transients.cc
src/Transients.h
src/enums.h
src/fs/coss/store_dir_coss.cc
src/fs/rock/RockSwapDir.cc
src/fs/ufs/UFSSwapDir.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/stat.cc
src/store.cc
src/store_digest.cc
src/store_dir.cc
src/tests/testStoreController.cc
src/tests/testStoreHashIndex.cc
src/whois.cc

index 6cd2380170b4552c90b70a4e93804588720686f4..e743fb4d192cca74878f6120e67b1d5ae2e1b1fa 100644 (file)
@@ -28,11 +28,13 @@ std::auto_ptr<CollapsedForwarding::Queue> CollapsedForwarding::queue;
 class CollapsedForwardingMsg
 {
 public:
-    CollapsedForwardingMsg(): sender(-1) { key[0] = key[1] = 0; }
+    CollapsedForwardingMsg(): sender(-1), xitIndex(-1) {}
 
 public:
-    int sender; /// kid ID of sending process
-    uint64_t key[2]; ///< StoreEntry key
+    int sender; ///< kid ID of sending process
+
+    /// transients index, so that workers can find [private] entries to sync
+    sfileno xitIndex; 
 };
 
 // CollapsedForwarding
@@ -59,10 +61,9 @@ CollapsedForwarding::Broadcast(const StoreEntry &e)
 
     CollapsedForwardingMsg msg;
     msg.sender = KidIdentifier;
-    memcpy(msg.key, e.key, sizeof(msg.key));
+    msg.xitIndex = e.mem_obj->xitTable.index;
 
-    debugs(17, 5, storeKeyText(static_cast<cache_key*>(e.key)) << " to " <<
-           Config.workers << "-1 workers");
+    debugs(17, 5, e << " to " << Config.workers << "-1 workers");
 
     // TODO: send only to workers who are waiting for data
     for (int workerId = 1; workerId <= Config.workers; ++workerId) {
@@ -105,10 +106,9 @@ CollapsedForwarding::HandleNewData(const char *const when)
                    " != " << msg.sender);
         }
 
-        const cache_key *key = reinterpret_cast<const cache_key*>(msg.key);
-        debugs(17, 7, "hadling " << storeKeyText(key));
-        Store::Root().syncCollapsed(key);
-        debugs(17, 7, "handled " << storeKeyText(key));
+        debugs(17, 7, "handling entry " << msg.xitIndex << " in transients_map");
+        Store::Root().syncCollapsed(msg.xitIndex);
+        debugs(17, 7, "handled entry " << msg.xitIndex << " in transients_map");
 
         // XXX: stop and schedule an async call to continue
         assert(++poppedCount < SQUID_MAXFD);
index c3b18ecc1fca3bc8ebcddeda5d39b36bcd9e45c5..bd52388303328f2bd308b50d1790a18726a4c17c 100644 (file)
@@ -288,7 +288,6 @@ MemStore::anchorEntry(StoreEntry &e, const sfileno index, const Ipc::StoreMapAnc
     assert(e.swap_status == SWAPOUT_NONE); // set in StoreEntry constructor
     e.ping_status = PING_NONE;
 
-    EBIT_SET(e.flags, ENTRY_CACHABLE);
     EBIT_CLR(e.flags, RELEASE_REQUEST);
     EBIT_CLR(e.flags, KEY_PRIVATE);
     EBIT_SET(e.flags, ENTRY_VALIDATED);
index 446894d3b3442f967e129cc7337ac0d3af8c9e64..4ce61544f0fa4a2aa75ca66a2b4ab7940d58ad95 100644 (file)
@@ -385,7 +385,7 @@ public:
     // XXX: This method belongs to Store::Root/StoreController, but it is here
     // to avoid casting Root() to StoreController until Root() API is fixed.
     /// Update local intransit entry after changes made by appending worker.
-    virtual void syncCollapsed(const cache_key *key) {}
+    virtual void syncCollapsed(const sfileno xitIndex) {}
 
     // XXX: This method belongs to Store::Root/StoreController, but it is here
     // to avoid casting Root() to StoreController until Root() API is fixed.
index fa08136f05a67b9faa6bbefec392809a4c8d781e..1dcae1198ff7a3d65b50415c91a4989449db7750 100644 (file)
@@ -71,7 +71,7 @@ public:
     virtual void memoryUnlink(StoreEntry &e);
     virtual void memoryDisconnect(MemObject &mem_obj);
     virtual void allowCollapsing(StoreEntry *e, const RequestFlags &reqFlags, const HttpRequestMethod &reqMethod);
-    virtual void syncCollapsed(const cache_key *key);
+    virtual void syncCollapsed(const sfileno xitIndex);
 
     virtual void init();
 
index 10a2480ec3c196c749d60e5a4a34534f3bde5544..5dfaabc405c4d3eeccdffb1fc8ea9eba201fe460 100644 (file)
 static const char *MapLabel = "transients_map";
 
 
-Transients::Transients(): map(NULL)
+Transients::Transients(): map(NULL), locals(NULL)
 {
 }
 
 Transients::~Transients()
 {
     delete map;
+    delete locals;
 }
 
 void
@@ -45,6 +46,8 @@ Transients::init()
     Must(!map);
     map = new TransientsMap(MapLabel);
     map->cleaner = this;
+
+    locals = new Locals(entryLimit, NULL);
 }
 
 void
@@ -157,15 +160,18 @@ Transients::get(const cache_key *key)
     if (!anchor)
         return NULL;
 
-    // Without a writer, either the response has been cached already or we will
-    // get stuck waiting for it to be cached (because nobody will cache it).
-    if (!anchor->writing()) {
-        debugs(20, 5, "ignoring writer-less entry " << index);
-       } else if (StoreEntry *e = copyFromShm(index)) {
-        return e; // keep read lock to receive updates from others
+    // If we already have a local entry, the store_table should have found it.
+    // Since it did not, the local entry key must have changed from public to
+    // private. We still need to keep the private entry around for syncing as
+    // its clients depend on it, but we should not allow new clients to join.
+    if (StoreEntry *oldE = locals->at(index)) {
+        debugs(20, 3, "not joining private " << *oldE);
+        assert(EBIT_TEST(oldE->flags, KEY_PRIVATE));
+    } else if (StoreEntry *newE = copyFromShm(index)) {
+        return newE; // keep read lock to receive updates from others
     }
 
-    // missing writer or loading failure
+    // private entry or loading failure
     map->closeForReading(index);
     return NULL;
 }
@@ -192,6 +198,10 @@ Transients::copyFromShm(const sfileno index)
     // TODO: Can we remove smpCollapsed by not syncing non-transient entries?
     e->mem_obj->smpCollapsed = true;
 
+    assert(!locals->at(index));
+    // We do not lock e because we do not want to prevent its destruction;
+    // e is tied to us via mem_obj so we will know when it is destructed.
+    locals->at(index) = e;
     return e;
 }
 
@@ -202,6 +212,22 @@ Transients::get(String const key, STOREGETCLIENT aCallback, void *aCallbackData)
     fatal("Transients::get(key,callback,data) should not be called");
 }
 
+StoreEntry *
+Transients::findCollapsed(const sfileno index)
+{
+    if (!map)
+        return NULL;
+
+    if (StoreEntry *oldE = locals->at(index)) {
+        debugs(20, 5, "found " << *oldE << " at " << index << " in " << MapLabel);
+        assert(oldE->mem_obj && oldE->mem_obj->xitTable.index == index);
+        return oldE;
+    }
+
+    debugs(20, 3, "no entry at " << index << " in " << MapLabel);
+    return NULL;
+}
+
 void
 Transients::startWriting(StoreEntry *e, const RequestFlags &reqFlags,
                 const HttpRequestMethod &reqMethod)
@@ -302,6 +328,9 @@ Transients::completeWriting(const StoreEntry &e)
 {
     if (e.mem_obj && e.mem_obj->xitTable.index >= 0) {
         assert(e.mem_obj->xitTable.io == MemObject::ioWriting);
+        // there will be no more updates from us after this, so we must prevent
+        // future readers from joining
+        map->freeEntry(e.mem_obj->xitTable.index); // just marks the locked entry
         map->closeForWriting(e.mem_obj->xitTable.index);
         e.mem_obj->xitTable.index = -1;
         e.mem_obj->xitTable.io = MemObject::ioDone;
@@ -336,6 +365,7 @@ Transients::disconnect(MemObject &mem_obj)
             assert(mem_obj.xitTable.io == MemObject::ioReading);
             map->closeForReading(mem_obj.xitTable.index);
         }
+        locals->at(mem_obj.xitTable.index) = NULL;
         mem_obj.xitTable.index = -1;
         mem_obj.xitTable.io = MemObject::ioDone;
     }
index 0204853015f7feda1e5fada25bdb16f796ac2de9..307db40b66da4ba6d0aba9560535ef620dbc0d4e 100644 (file)
@@ -6,6 +6,7 @@
 #include "ipc/mem/PageStack.h"
 #include "ipc/StoreMap.h"
 #include "Store.h"
+#include <vector>
 
 // StoreEntry restoration info not already stored by Ipc::StoreMap
 struct TransientsMapExtras {
@@ -24,6 +25,9 @@ public:
     Transients();
     virtual ~Transients();
 
+    /// return a local, previously collapsed entry
+    StoreEntry *findCollapsed(const sfileno xitIndex);
+
     /// add an in-transit entry suitable for collapsing future requests
     void startWriting(StoreEntry *e, const RequestFlags &reqFlags, const HttpRequestMethod &reqMethod);
 
@@ -72,7 +76,12 @@ protected:
     virtual void noteFreeMapSlice(const sfileno sliceId);
 
 private:
-    TransientsMap *map; ///< index of mem-cached entries
+    /// shared packed info indexed by Store keys, for creating new StoreEntries
+    TransientsMap *map;
+
+    typedef std::vector<StoreEntry*> Locals;
+    /// local collapsed entries indexed by transient ID, for syncing old StoreEntries
+    Locals *locals;
 };
 
 // TODO: Why use Store as a base? We are not really a cache.
index 01310216b62df589bbb8954477b6a283264d4918..c810cdf0f6f2c9a6220ec536589965fee4adc681 100644 (file)
@@ -122,7 +122,7 @@ enum {
     DELAY_SENDING,
     RELEASE_REQUEST,
     REFRESH_REQUEST,
-    ENTRY_CACHABLE,
+    ENTRY_CACHABLE_RESERVED_FOR_FUTURE_USE,
     ENTRY_DISPATCHED,
     KEY_PRIVATE,
     ENTRY_FWD_HDR_WAIT,
index 72a592ced36f2a827fd89d5c9f94bca0929d436d..dc61b00987a89e125530f2de96e2896ccb004f2e 100644 (file)
@@ -526,7 +526,6 @@ CossSwapDir::addDiskRestore(const cache_key *const key,
     e->lastmod = lastmod;
     e->refcount = refcount;
     e->flags = flags;
-    EBIT_SET(e->flags, ENTRY_CACHABLE);
     EBIT_CLR(e->flags, RELEASE_REQUEST);
     EBIT_CLR(e->flags, KEY_PRIVATE);
     e->ping_status = PING_NONE;
index a992b17d6bd71addc536a2243403ac57a75eb7ab..7cfc82a554b7a9f9b7d3ce056e4784accf9e64ed 100644 (file)
@@ -138,7 +138,6 @@ Rock::SwapDir::anchorEntry(StoreEntry &e, const sfileno filen, const Ipc::StoreM
     e.swap_status = SWAPOUT_DONE;
     e.ping_status = PING_NONE;
 
-    EBIT_SET(e.flags, ENTRY_CACHABLE);
     EBIT_CLR(e.flags, RELEASE_REQUEST);
     EBIT_CLR(e.flags, KEY_PRIVATE);
     EBIT_SET(e.flags, ENTRY_VALIDATED);
index 599b8ad2be92cae13e80659129fd668f0b209d9e..239273846752bc2cb7a834a3d95da1cda5f2c5ae 100644 (file)
@@ -760,7 +760,6 @@ Fs::Ufs::UFSSwapDir::addDiskRestore(const cache_key * key,
     e->lastmod = lastmod;
     e->refcount = refcount;
     e->flags = newFlags;
-    EBIT_SET(e->flags, ENTRY_CACHABLE);
     EBIT_CLR(e->flags, RELEASE_REQUEST);
     EBIT_CLR(e->flags, KEY_PRIVATE);
     e->ping_status = PING_NONE;
index 757db4e01525329117bb9a3f4ee549d1b6a2653a..373899704f1172ba40b35a499bdec44b736e77cc 100644 (file)
@@ -3704,7 +3704,7 @@ FtpStateData::haveParsedReplyHeaders()
          * Authenticated requests can't be cached.
          */
         e->release();
-    } else if (EBIT_TEST(e->flags, ENTRY_CACHABLE) && !getCurrentOffset()) {
+    } else if (!EBIT_TEST(e->flags, RELEASE_REQUEST) && !getCurrentOffset()) {
         e->setPublicKey();
     } else {
         e->release();
index 63241914ff1da1cf4b9de3f28202527025897cea..0cf485c2ba66a599180411c20c0578e9dc2bbff9 100644 (file)
@@ -945,8 +945,7 @@ gopherSendRequest(int fd, void *data)
                                          CommIoCbPtrFun(gopherSendComplete, gopherState));
     Comm::Write(gopherState->serverConn, buf, strlen(buf), call, NULL);
 
-    if (EBIT_TEST(gopherState->entry->flags, ENTRY_CACHABLE))
-        gopherState->entry->setPublicKey();    /* Make it public */
+    gopherState->entry->makePublic();
 }
 
 /// \ingroup ServerProtocolGopherInternal
index a08b9de126ce2580c391f7dc04dd4d80c7456604..9fa1efb5b4943cbfaac318bb71db987713f2fd0c 100644 (file)
@@ -345,6 +345,11 @@ HttpStateData::cacheableReply()
 #define REFRESH_OVERRIDE(flag) 0
 #endif
 
+    if (EBIT_TEST(entry->flags, RELEASE_REQUEST)) {
+        debugs(22, 3, "NO because " << *entry << " has been released.");
+        return 0;
+    }
+
     // Check for Surrogate/1.0 protocol conditions
     // NP: reverse-proxy traffic our parent server has instructed us never to cache
     if (surrogateNoStore) {
index 715bef8310735c9ec53628d6af832ea9f9d872ce..4ef301884b554900f9a1170539115a56d49dd017 100644 (file)
@@ -320,9 +320,6 @@ storeEntryFlags(const StoreEntry * entry)
     if (EBIT_TEST(flags, REFRESH_REQUEST))
         strcat(buf, "REFRESH_REQUEST,");
 
-    if (EBIT_TEST(flags, ENTRY_CACHABLE))
-        strcat(buf, "CACHABLE,");
-
     if (EBIT_TEST(flags, ENTRY_DISPATCHED))
         strcat(buf, "DISPATCHED,");
 
index 35f483f9970f4128cc72b89a610ba9874eec6916..d32f7c0eded26f05906a41694741ed4e148feac9 100644 (file)
@@ -191,7 +191,7 @@ StoreEntry::makePublic()
 {
     /* This object can be cached for a long time */
 
-    if (EBIT_TEST(flags, ENTRY_CACHABLE))
+    if (!EBIT_TEST(flags, RELEASE_REQUEST))
         setPublicKey();
 }
 
@@ -201,7 +201,6 @@ StoreEntry::makePrivate()
     /* This object should never be cached at all */
     expireNow();
     releaseRequest(); /* delete object when not used */
-    /* releaseRequest clears ENTRY_CACHABLE flag */
 }
 
 void
@@ -209,9 +208,7 @@ StoreEntry::cacheNegatively()
 {
     /* This object may be negatively cached */
     negativeCache();
-
-    if (EBIT_TEST(flags, ENTRY_CACHABLE))
-        setPublicKey();
+    makePublic();
 }
 
 size_t
@@ -523,14 +520,7 @@ StoreEntry::releaseRequest()
     if (EBIT_TEST(flags, RELEASE_REQUEST))
         return;
 
-    setReleaseFlag();
-
-    /*
-     * Clear cachable flag here because we might get called before
-     * anyone else even looks at the cachability flag.  Also, this
-     * prevents httpMakePublic from really setting a public key.
-     */
-    EBIT_CLR(flags, ENTRY_CACHABLE);
+    setReleaseFlag(); // makes validToSend() false, preventing future hits
 
     setPrivateKey();
 }
@@ -651,6 +641,9 @@ StoreEntry::setPrivateKey()
         return;                 /* is already private */
 
     if (key) {
+        setReleaseFlag(); // will markForUnlink(); all caches/workers will know
+
+        // TODO: move into SwapDir::markForUnlink() already called by Root()
         if (swap_filen > -1)
             storeDirSwapLog(this, SWAP_LOG_DEL);
 
@@ -686,8 +679,7 @@ StoreEntry::setPublicKey()
      * store clients won't be able to access object data which has
      * been freed from memory.
      *
-     * If RELEASE_REQUEST is set, then ENTRY_CACHABLE should not
-     * be set, and StoreEntry::setPublicKey() should not be called.
+     * If RELEASE_REQUEST is set, setPublicKey() should not be called.
      */
 #if MORE_DEBUG_OUTPUT
 
@@ -798,10 +790,8 @@ storeCreatePureEntry(const char *url, const char *log_url, const RequestFlags &f
     e->mem_obj->setUris(url, log_url, method);
 
     if (flags.cachable) {
-        EBIT_SET(e->flags, ENTRY_CACHABLE);
         EBIT_CLR(e->flags, RELEASE_REQUEST);
     } else {
-        /* StoreEntry::releaseRequest() clears ENTRY_CACHABLE */
         e->releaseRequest();
     }
 
@@ -958,9 +948,9 @@ StoreEntry::checkCachable()
         if (store_status == STORE_OK && EBIT_TEST(flags, ENTRY_BAD_LENGTH)) {
             debugs(20, 2, "StoreEntry::checkCachable: NO: wrong content-length");
             ++store_check_cachable_hist.no.wrong_content_length;
-        } else if (!EBIT_TEST(flags, ENTRY_CACHABLE)) {
+        } else if (EBIT_TEST(flags, RELEASE_REQUEST)) {
             debugs(20, 2, "StoreEntry::checkCachable: NO: not cachable");
-            ++store_check_cachable_hist.no.not_entry_cachable;
+            ++store_check_cachable_hist.no.not_entry_cachable; // TODO: rename?
         } else if (EBIT_TEST(flags, ENTRY_NEGCACHED)) {
             debugs(20, 3, "StoreEntry::checkCachable: NO: negative cached");
             ++store_check_cachable_hist.no.negative_cached;
@@ -995,7 +985,6 @@ StoreEntry::checkCachable()
         }
 
     releaseRequest();
-    /* StoreEntry::releaseRequest() cleared ENTRY_CACHABLE */
     return 0;
 }
 
@@ -2010,7 +1999,6 @@ std::ostream &operator <<(std::ostream &os, const StoreEntry &e)
         if (EBIT_TEST(e.flags, DELAY_SENDING)) os << 'P';
         if (EBIT_TEST(e.flags, RELEASE_REQUEST)) os << 'X';
         if (EBIT_TEST(e.flags, REFRESH_REQUEST)) os << 'F';
-        if (EBIT_TEST(e.flags, ENTRY_CACHABLE)) os << 'C';
         if (EBIT_TEST(e.flags, ENTRY_DISPATCHED)) os << 'D';
         if (EBIT_TEST(e.flags, KEY_PRIVATE)) os << 'I';
         if (EBIT_TEST(e.flags, ENTRY_FWD_HDR_WAIT)) os << 'W';
index f8b2cca2e02d6cab3b061b9f69bf6c201ca1650e..1a636252f91ec2ad23ee5e3c0012affdc4a143b2 100644 (file)
@@ -224,11 +224,6 @@ storeDigestAddable(const StoreEntry * e)
 
     /* check various entry flags (mimics StoreEntry::checkCachable XXX) */
 
-    if (!EBIT_TEST(e->flags, ENTRY_CACHABLE)) {
-        debugs(71, 6, "storeDigestAddable: NO: not cachable");
-        return 0;
-    }
-
     if (EBIT_TEST(e->flags, KEY_PRIVATE)) {
         debugs(71, 6, "storeDigestAddable: NO: private key");
         return 0;
index 74e336dcef20d781047d1fdaad008c38fc48000c..b362896ad9285b5d9277638517b35350a10f04e4 100644 (file)
@@ -1001,43 +1001,21 @@ StoreController::allowCollapsing(StoreEntry *e, const RequestFlags &reqFlags,
 }
 
 void
-StoreController::syncCollapsed(const cache_key *key)
+StoreController::syncCollapsed(const sfileno xitIndex)
 {
-    StoreEntry *collapsed = swapDir->get(key);
-    if (!collapsed) { // the entry is no longer locally active, ignore update
-        debugs(20, 7, "not SMP-syncing not-local " << storeKeyText(key));
-        return;
-    }
-
-    if (!collapsed->mem_obj) {
-        // without mem_obj, the entry cannot be transient so we ignore it
-        debugs(20, 7, "not SMP-syncing not-shared " << *collapsed);
-        return;
-    }
-
-    if (collapsed->mem_obj->xitTable.index < 0) {
-        debugs(20, 7, "not SMP-syncing not-transient " << *collapsed);
-        return;
-    }
-
-    // this must be done before the abandoned() check because we may be looking
-    // at an entry we are writing while abandoned() requires a reading lock.
-    if (!collapsed->mem_obj->smpCollapsed) {
-        // this happens, e.g., when we tried collapsing but rejected the hit
-        // or a stale notification was received (and we are now the writer)
-        debugs(20, 7, "not SMP-syncing not-SMP-collapsed " << *collapsed);
-        return;
-    }
-
     assert(transients);
-    if (transients->abandoned(*collapsed)) {
-        debugs(20, 3, "aborting abandoned " << *collapsed);
-        collapsed->abort();
+
+    StoreEntry *collapsed = transients->findCollapsed(xitIndex);
+    if (!collapsed) { // the entry is no longer locally active, ignore update
+        debugs(20, 7, "not SMP-syncing not-transient " << xitIndex);
         return;
     }
+    assert(collapsed->mem_obj);
+    assert(collapsed->mem_obj->smpCollapsed);
 
     debugs(20, 7, "syncing " << *collapsed);
 
+    bool abandoned = transients->abandoned(*collapsed);
     bool found = false;
     bool inSync = false;
     if (memStore && collapsed->mem_obj->memCache.io == MemObject::ioDone) {
@@ -1054,6 +1032,12 @@ StoreController::syncCollapsed(const cache_key *key)
         found = anchorCollapsed(*collapsed, inSync);
     }
 
+    if (abandoned && collapsed->store_status == STORE_PENDING) {
+        debugs(20, 3, "aborting abandoned but STORE_PENDING " << *collapsed);
+        collapsed->abort();
+        return;
+    }
+
     if (inSync) {
         debugs(20, 5, "synced " << *collapsed);
         collapsed->invokeHandlers();
index 21e62cece9800005121764d5ab18c0c171c413c5..eaf263925c855678d55f9a0487151053bca970ce 100644 (file)
@@ -105,7 +105,6 @@ addedEntry(StorePointer hashStore,
     e->expires = squid_curtime;
     e->lastmod = squid_curtime;
     e->refcount = 1;
-    EBIT_SET(e->flags, ENTRY_CACHABLE);
     EBIT_CLR(e->flags, RELEASE_REQUEST);
     EBIT_CLR(e->flags, KEY_PRIVATE);
     e->ping_status = PING_NONE;
index 9d320794f4f83f2f7c217f9f6027b63fe669d5be..87f6b955bce4d8a6fa2d18f09654355b644d11ad 100644 (file)
@@ -86,7 +86,6 @@ addedEntry(StorePointer hashStore,
     e->expires = squid_curtime;
     e->lastmod = squid_curtime;
     e->refcount = 1;
-    EBIT_SET(e->flags, ENTRY_CACHABLE);
     EBIT_CLR(e->flags, RELEASE_REQUEST);
     EBIT_CLR(e->flags, KEY_PRIVATE);
     e->ping_status = PING_NONE;
index a3b51d30ea85013a42f90305f234206b7ccc5c37..43f41930cf8b108b18386e4f69125a4779fc69d2 100644 (file)
@@ -192,8 +192,7 @@ WhoisState::readReply(const Comm::ConnectionPointer &conn, char *aBuffer, size_t
     entry->timestampsSet();
     entry->flush();
 
-    if (!EBIT_TEST(entry->flags, RELEASE_REQUEST))
-        entry->setPublicKey();
+    entry->makePublic();
 
     fwd->complete();
     debugs(75, 3, "whoisReadReply: Done: " << entry->url());