]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
sigh, undo StoreEntry->flags changes to make it a structure with single-bit ints
authorwessels <>
Sat, 19 Sep 1998 23:05:58 +0000 (23:05 +0000)
committerwessels <>
Sat, 19 Sep 1998 23:05:58 +0000 (23:05 +0000)
24 files changed:
src/client.cc
src/client_side.cc
src/enums.h
src/forward.cc
src/fqdncache.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/mime.cc
src/neighbors.cc
src/peer_digest.cc
src/peer_select.cc
src/refresh.cc
src/stat.cc
src/store.cc
src/store_client.cc
src/store_digest.cc
src/store_dir.cc
src/store_rebuild.cc
src/store_swapin.cc
src/store_swapout.cc
src/structs.h
src/typedefs.h
src/wais.cc

index ecea0a4a611a50cb513286858265be5a7a4c7874..615dc4aceafbb040fdce0837638cbdef1ef70e49 100644 (file)
@@ -1,6 +1,7 @@
 
+
 /*
- * $Id: client.cc,v 1.74 1998/07/22 20:37:07 wessels Exp $
+ * $Id: client.cc,v 1.75 1998/09/19 17:05:58 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
index 421a2acb11f02d6cd7435c5c90f47e18c8bb9eb6..b7437070c9b1e1b5fd5e7be3e54139757f8b4c71 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.397 1998/09/15 22:05:10 wessels Exp $
+ * $Id: client_side.cc,v 1.398 1998/09/19 17:05:59 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -485,7 +485,7 @@ clientPurgeRequest(clientHttpRequest * http)
 int
 checkNegativeHit(StoreEntry * e)
 {
-    if (!e->flags.entry_negcached)
+    if (!EBIT_TEST(e->flags, ENTRY_NEGCACHED))
        return 0;
     if (e->expires <= squid_curtime)
        return 0;
@@ -1531,7 +1531,7 @@ clientWriteComplete(int fd, char *bufnotused, size_t size, int errflag, void *da
        } else if (!done) {
            debug(33, 5) ("clientWriteComplete: closing, !done\n");
            comm_close(fd);
-       } else if (entry->flags.entry_bad_length) {
+       } else if (EBIT_TEST(entry->flags, ENTRY_BAD_LENGTH)) {
            debug(33, 5) ("clientWriteComplete: closing, ENTRY_BAD_LENGTH\n");
            comm_close(fd);
        } else if (http->request->flags.proxy_keepalive) {
@@ -1599,7 +1599,7 @@ clientProcessRequest2(clientHttpRequest * http)
     } else if (!storeEntryValidToSend(e)) {
        http->entry = NULL;
        return LOG_TCP_MISS;
-    } else if (e->flags.entry_special) {
+    } else if (EBIT_TEST(e->flags, ENTRY_SPECIAL)) {
        /* Special entries are always hits, no matter what the client says */
        http->entry = e;
        return LOG_TCP_HIT;
@@ -1701,7 +1701,7 @@ clientProcessMiss(clientHttpRequest * http)
      * or IMS request.
      */
     if (http->entry) {
-       if (http->entry->flags.entry_special)
+       if (EBIT_TEST(http->entry->flags, ENTRY_SPECIAL))
            debug(33, 0) ("clientProcessMiss: miss on a special object (%s).\n", url);
        storeUnregister(http->entry, http);
        storeUnlockObject(http->entry);
@@ -2265,7 +2265,7 @@ CheckQuickAbort2(const clientHttpRequest * http)
 
     if (!http->request->flags.cachable)
        return 1;
-    if (http->entry->flags.key_private)
+    if (EBIT_TEST(http->entry->flags, KEY_PRIVATE))
        return 1;
     if (http->entry->mem_obj == NULL)
        return 1;
index 43acd75dc6b9ce57ec61d601379b1ec844c2141b..a82604c1d6253e56dbff1e373e27465bb4e61658 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: enums.h,v 1.129 1998/09/14 22:17:56 wessels Exp $
+ * $Id: enums.h,v 1.130 1998/09/19 17:06:00 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -428,8 +428,29 @@ typedef enum {
     HTTP_INVALID_HEADER = 600  /* Squid header parsing error */
 } http_status;
 
+/*
+ * These are for StoreEntry->flag, which is defined as a SHORT
+ *
+ * NOTE: These flags are written to swap.state, so think very carefully
+ * about deleting or re-assigning!
+ */
 enum {
-    ERR_FLAG_CBDATA
+    ENTRY_SPECIAL,
+    ENTRY_REVALIDATE,
+    DELAY_SENDING,
+    RELEASE_REQUEST,
+    REFRESH_REQUEST,
+    ENTRY_CACHABLE,
+    ENTRY_DISPATCHED,
+    KEY_PRIVATE,
+#ifndef PPNR_WIP
+    ENTRY_UNUSED_08,
+#else
+    ENTRY_FWD_HDR_WAIT,
+#endif                         /* PPNR_WIP */
+    ENTRY_NEGCACHED,
+    ENTRY_VALIDATED,
+    ENTRY_BAD_LENGTH
 };
 
 typedef enum {
index 3eecdc53ca757aec9b1c2a317111e350c871b88a..952a9da50a0c4b3ccc8e32d88fe552e1a3c7c95e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.27 1998/09/14 21:28:02 wessels Exp $
+ * $Id: forward.cc,v 1.28 1998/09/19 17:06:01 wessels Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -260,10 +260,10 @@ fwdDispatch(FwdState * fwdState)
        fwdState->client_fd,
        RequestMethodStr[request->method],
        storeUrl(entry));
-    /*assert(!entry->flags.entry_dispatched); */
+    /*assert(!EBIT_TEST(entry->flags, ENTRY_DISPATCHED)); */
     assert(entry->ping_status != PING_WAITING);
     assert(entry->lock_count);
-    entry->flags.entry_dispatched = 1;
+    EBIT_SET(entry->flags, ENTRY_DISPATCHED);
     netdbPingSite(request->host);
     /*
      * Assert that server_fd is set.  This is to guarantee that fwdState
@@ -412,7 +412,7 @@ void
 fwdFail(FwdState * fwdState, int err_code, http_status http_code, int xerrno)
 {
 #ifdef PPNR_WIP
-    assert(fwdState->entry->flags.entry_fwd_hdr_wait);
+    assert(EBIT_TEST(fwdState->entry->flags, ENTRY_FWD_HDR_WAIT));
 #endif /* PPNR_WIP */
     debug(17, 3) ("fwdFail: %s \"%s\"\n\t%s\n",
        err_type_str[err_code],
index ecc0daed02e05f55ec22a0b9324808bd729977b8..751abd5cd99e0ef11f19850a787992390cf59aca 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: fqdncache.cc,v 1.116 1998/09/15 22:29:30 wessels Exp $
+ * $Id: fqdncache.cc,v 1.117 1998/09/19 17:06:02 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -481,8 +481,8 @@ fqdncache_nbgethostbyaddr(struct in_addr addr, FQDNH * handler, void *handlerDat
        }
        return;
     } else {
-       debug(35,1)("fqdncache_nbgethostbyaddr: BAD status %d",
-               (int) f->status);
+       debug(35, 1) ("fqdncache_nbgethostbyaddr: BAD status %d",
+           (int) f->status);
        assert(0);
     }
 
index 3a34d57217bdd8d8aa385d32f21fa0cc66690565..0af18f31d121124b3ad67c386b45ff43314d690c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.251 1998/09/14 21:28:03 wessels Exp $
+ * $Id: ftp.cc,v 1.252 1998/09/19 17:06:03 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -2235,7 +2235,7 @@ ftpAppendSuccessHeader(FtpStateData * ftpState)
     storeBufferFlush(e);
     reply->hdr_sz = e->mem_obj->inmem_hi;
     storeTimestampsSet(e);
-    if (e->flags.entry_cachable)
+    if (EBIT_TEST(e->flags, ENTRY_CACHABLE))
        storeSetPublicKey(e);
 }
 
index 81caaf10fa596e07b4cdab5e2482e96df30b7069..47a373913ff00bf86d7d370ddc25b023d28f71d7 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: gopher.cc,v 1.138 1998/09/14 21:28:04 wessels Exp $
+ * $Id: gopher.cc,v 1.139 1998/09/19 17:06:04 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -763,7 +763,7 @@ gopherSendRequest(int fd, void *data)
        gopherSendComplete,
        data,
        memFree4K);
-    if (gopherState->entry->flags.entry_cachable)
+    if (EBIT_TEST(gopherState->entry->flags, ENTRY_CACHABLE))
        storeSetPublicKey(gopherState->entry);  /* Make it public */
 }
 
index 9fa9ad54ddbef1bd73fa055a2df61afb45b388b8..89b85a465715ad5b0324cb3db4a4ff6bc4cca9e6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.321 1998/09/15 22:05:09 wessels Exp $
+ * $Id: http.cc,v 1.322 1998/09/19 17:06:05 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -106,7 +106,7 @@ httpTimeout(int fd, void *data)
 static void
 httpMakePublic(StoreEntry * entry)
 {
-    if (entry->flags.entry_cachable)
+    if (EBIT_TEST(entry->flags, ENTRY_CACHABLE))
        storeSetPublicKey(entry);
 }
 
@@ -124,7 +124,7 @@ static void
 httpCacheNegatively(StoreEntry * entry)
 {
     storeNegativeCache(entry);
-    if (entry->flags.entry_cachable)
+    if (EBIT_TEST(entry->flags, ENTRY_CACHABLE))
        storeSetPublicKey(entry);
 }
 
@@ -134,7 +134,7 @@ httpMaybeRemovePublic(StoreEntry * e, http_status status)
     int remove = 0;
     const cache_key *key;
     StoreEntry *pe;
-    if (!e->flags.key_private)
+    if (!EBIT_TEST(e->flags, KEY_PRIVATE))
        return;
     switch (status) {
     case HTTP_OK:
@@ -327,9 +327,9 @@ httpProcessReplyHeader(HttpStateData * httpState, const char *buf, int size)
        }
        if (reply->cache_control) {
            if (EBIT_TEST(reply->cache_control->mask, CC_PROXY_REVALIDATE))
-               entry->flags.entry_revalidate = 1;
+               EBIT_SET(entry->flags, ENTRY_REVALIDATE);
            else if (EBIT_TEST(reply->cache_control->mask, CC_MUST_REVALIDATE))
-               entry->flags.entry_revalidate = 1;
+               EBIT_SET(entry->flags, ENTRY_REVALIDATE);
        }
        if (httpState->flags.keepalive)
            if (httpState->peer)
index ba174fc27adb6130a5a45cbe9037f652d3499707..9d1e50638a716ca5ed964597f910edb0e1d7b66b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: mime.cc,v 1.79 1998/09/14 21:28:05 wessels Exp $
+ * $Id: mime.cc,v 1.80 1998/09/19 17:06:06 wessels Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
@@ -415,7 +415,7 @@ mimeLoadIconFile(const char *icon)
     storeSetPublicKey(e);
     storeComplete(e);
     storeTimestampsSet(e);
-    e->flags.entry_special = 1;
+    EBIT_SET(e->flags, ENTRY_SPECIAL);
     debug(25, 3) ("Loaded icon %s\n", url);
     storeUnlockObject(e);
     memFree(MEM_4K_BUF, buf);
index 680a1d3a0a57ae4b772a2b182cc66517e49c5771..dd92d01944132820f294ac27f229f9af9a23eb57 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.250 1998/09/18 15:25:41 wessels Exp $
+ * $Id: neighbors.cc,v 1.251 1998/09/19 17:06:07 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -612,7 +612,7 @@ neighborUpdateRtt(peer * p, MemObject * mem)
     if (rtt < 1 || rtt > 10000)
        return;
     p->stats.rtt = intAverage(p->stats.rtt, rtt,
-        p->stats.pings_acked, RTT_AV_FACTOR);
+       p->stats.pings_acked, RTT_AV_FACTOR);
 }
 
 #if USE_HTCP
@@ -726,7 +726,7 @@ neighborsUdpAck(const cache_key * key, icp_common_t * header, const struct socka
        return;
     }
     /* check if someone is already fetching it */
-    if (entry->flags.entry_dispatched) {
+    if (EBIT_TEST(entry->flags, ENTRY_DISPATCHED)) {
        debug(15, 3) ("neighborsUdpAck: '%s' already being fetched.\n",
            storeKeyText(key));
        neighborCountIgnored(p);
@@ -1198,7 +1198,7 @@ neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const struct soc
        return;
     }
     /* check if someone is already fetching it */
-    if (e->flags.entry_dispatched) {
+    if (EBIT_TEST(e->flags, ENTRY_DISPATCHED)) {
        debug(15, 3) ("neighborsUdpAck: '%s' already being fetched.\n",
            storeKeyText(key));
        neighborCountIgnored(p);
index 19ea7a22c129e341a89db100f3d8f067c780c215..212d4426347a4c16c87f92b2d18b6ba9eefd61f9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_digest.cc,v 1.52 1998/09/15 19:37:55 wessels Exp $
+ * $Id: peer_digest.cc,v 1.53 1998/09/19 17:06:08 wessels Exp $
  *
  * DEBUG: section 72    Peer Digest Routines
  * AUTHOR: Alex Rousskov
@@ -275,7 +275,7 @@ peerDigestRequest(peer * p)
     }
     e = fetch->entry = storeCreateEntry(url, url, req->flags, req->method);
     debug(72, 5) ("peerDigestRequest: new entry is private: %d\n",
-       (int) e->flags.key_private);
+       (int) EBIT_TEST(e->flags, KEY_PRIVATE));
     storeClientListAdd(e, fetch);
     /* set lastmod to trigger IMS request if possible */
     if (old_e)
index de3cc68f2ba5f62a5941317b9c501a242d95beea..7bda5d61f515a998096c1679cf335ee01fd32382 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.84 1998/09/19 15:28:44 wessels Exp $
+ * $Id: peer_select.cc,v 1.85 1998/09/19 17:06:08 wessels Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -114,7 +114,7 @@ peerSelectIcpPing(request_t * request, int direct, StoreEntry * entry)
     assert(direct != DIRECT_YES);
     if (!request->flags.hierarchical && direct != DIRECT_NO)
        return 0;
-    if (entry->flags.key_private && !neighbors_do_private_keys)
+    if (EBIT_TEST(entry->flags, KEY_PRIVATE) && !neighbors_do_private_keys)
        if (direct != DIRECT_NO)
            return 0;
     n = neighborsCount(request);
index 615ca0669e074a0382fb05d9d8e34e071cf8f966..b931ae7caf885bf0bc7e9f1265a95d49eebcfdf5 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: refresh.cc,v 1.35 1998/09/14 21:28:10 wessels Exp $
+ * $Id: refresh.cc,v 1.36 1998/09/19 17:06:09 wessels Exp $
  *
  * DEBUG: section 22    Refresh Calculation
  * AUTHOR: Harvest Derived
@@ -117,7 +117,7 @@ refreshCheck(const StoreEntry * entry, request_t * request, time_t delta)
        uri = urlCanonical(request);
     debug(22, 3) ("refreshCheck: '%s'\n", uri);
     refreshCounts.total++;
-    if (entry->flags.entry_revalidate) {
+    if (EBIT_TEST(entry->flags, ENTRY_REVALIDATE)) {
        debug(22, 3) ("refreshCheck: YES: Required Authorization\n");
        refreshCounts.revalidate_stale++;
        return 1;
@@ -233,7 +233,7 @@ refreshWhen(const StoreEntry * entry)
        assert(entry->mem_obj->url);
        debug(22, 3) ("refreshWhen: key '%s'\n", storeKeyText(entry->key));
        debug(22, 3) ("refreshWhen: url '%s'\n", entry->mem_obj->url);
-       if (entry->flags.entry_revalidate) {
+       if (EBIT_TEST(entry->flags, ENTRY_REVALIDATE)) {
            debug(22, 3) ("refreshWhen: NOW: Required Authorization\n");
            return refresh_time;
        }
index 9c4be351a2e9118e70e271fa68ef004e4f82aa2f..07f0ddd50f53bb39722db5960067b30e4637349c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.289 1998/09/15 19:37:58 wessels Exp $
+ * $Id: stat.cc,v 1.290 1998/09/19 17:06:10 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -201,27 +201,27 @@ storeEntryFlags(const StoreEntry * entry)
     LOCAL_ARRAY(char, buf, 256);
     char *t;
     buf[0] = '\0';
-    if (entry->flags.entry_special)
+    if (EBIT_TEST(entry->flags, ENTRY_SPECIAL))
        strcat(buf, "SPECIAL,");
-    if (entry->flags.entry_revalidate)
+    if (EBIT_TEST(entry->flags, ENTRY_REVALIDATE))
        strcat(buf, "REVALIDATE,");
-    if (entry->flags.delay_sending)
+    if (EBIT_TEST(entry->flags, DELAY_SENDING))
        strcat(buf, "DELAY_SENDING,");
-    if (entry->flags.release_request)
+    if (EBIT_TEST(entry->flags, RELEASE_REQUEST))
        strcat(buf, "RELEASE_REQUEST,");
-    if (entry->flags.refresh_request)
+    if (EBIT_TEST(entry->flags, REFRESH_REQUEST))
        strcat(buf, "REFRESH_REQUEST,");
-    if (entry->flags.entry_cachable)
+    if (EBIT_TEST(entry->flags, ENTRY_CACHABLE))
        strcat(buf, "CACHABLE,");
-    if (entry->flags.entry_dispatched)
+    if (EBIT_TEST(entry->flags, ENTRY_DISPATCHED))
        strcat(buf, "DISPATCHED,");
-    if (entry->flags.key_private)
+    if (EBIT_TEST(entry->flags, KEY_PRIVATE))
        strcat(buf, "PRIVATE,");
-    if (entry->flags.entry_negcached)
+    if (EBIT_TEST(entry->flags, ENTRY_NEGCACHED))
        strcat(buf, "NEGCACHED,");
-    if (entry->flags.entry_validated)
+    if (EBIT_TEST(entry->flags, ENTRY_VALIDATED))
        strcat(buf, "VALIDATED,");
-    if (entry->flags.entry_bad_length)
+    if (EBIT_TEST(entry->flags, ENTRY_BAD_LENGTH))
        strcat(buf, "BAD_LENGTH,");
     if ((t = strrchr(buf, ',')))
        *t = '\0';
index d71343ecf9c754d80228d61125f3e0d7d83b3e87..77d1c5b0c593bfb2d8f87da33f27cedfa37711d0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.461 1998/09/15 20:16:22 wessels Exp $
+ * $Id: store.cc,v 1.462 1998/09/19 17:06:12 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -225,17 +225,17 @@ storeLockObject(StoreEntry * e)
 void
 storeReleaseRequest(StoreEntry * e)
 {
-    if (e->flags.release_request)
+    if (EBIT_TEST(e->flags, RELEASE_REQUEST))
        return;
     assert(storeEntryLocked(e));
     debug(20, 3) ("storeReleaseRequest: '%s'\n", storeKeyText(e->key));
-    e->flags.release_request = 1;
+    EBIT_SET(e->flags, RELEASE_REQUEST);
     /*
      * 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.
      */
-    e->flags.entry_cachable = 0;
+    EBIT_CLR(e->flags, ENTRY_CACHABLE);
     storeSetPrivateKey(e);
 }
 
@@ -250,11 +250,11 @@ storeUnlockObject(StoreEntry * e)
     if (e->lock_count)
        return (int) e->lock_count;
     if (e->store_status == STORE_PENDING) {
-       assert(!e->flags.entry_dispatched);
-       e->flags.release_request = 1;
+       assert(!EBIT_TEST(e->flags, ENTRY_DISPATCHED));
+       EBIT_SET(e->flags, RELEASE_REQUEST);
     }
     assert(storePendingNClients(e) == 0);
-    if (e->flags.release_request)
+    if (EBIT_TEST(e->flags, RELEASE_REQUEST))
        storeRelease(e);
     else if (storeKeepInMemory(e)) {
        storeSetMemStatus(e, IN_MEMORY);
@@ -262,7 +262,7 @@ storeUnlockObject(StoreEntry * e)
        e->mem_obj->request = NULL;
     } else {
        storePurgeMem(e);
-       if (e->flags.key_private) {
+       if (EBIT_TEST(e->flags, KEY_PRIVATE)) {
            dlinkDelete(&e->lru, &store_list);
            dlinkAddTail(e, &e->lru, &store_list);
        }
@@ -293,7 +293,7 @@ storeSetPrivateKey(StoreEntry * e)
 {
     const cache_key *newkey;
     MemObject *mem = e->mem_obj;
-    if (e->key && e->flags.key_private)
+    if (e->key && EBIT_TEST(e->flags, KEY_PRIVATE))
        return;                 /* is already private */
     if (e->key) {
        if (e->swap_file_number > -1)
@@ -307,7 +307,7 @@ storeSetPrivateKey(StoreEntry * e)
        newkey = storeKeyPrivate("JUNK", METHOD_NONE, getKeyCounter());
     }
     assert(hash_lookup(store_table, newkey) == NULL);
-    e->flags.key_private = 1;
+    EBIT_SET(e->flags, KEY_PRIVATE);
     storeHashInsert(e, newkey);
 }
 
@@ -317,7 +317,7 @@ storeSetPublicKey(StoreEntry * e)
     StoreEntry *e2 = NULL;
     const cache_key *newkey;
     MemObject *mem = e->mem_obj;
-    if (e->key && !e->flags.key_private)
+    if (e->key && !EBIT_TEST(e->flags, KEY_PRIVATE))
        return;                 /* is already public */
     assert(mem);
     /*
@@ -327,7 +327,7 @@ storeSetPublicKey(StoreEntry * e)
      * store clients won't be able to access object data which has
      * been freed from memory.
      */
-    assert(!e->flags.release_request);
+    assert(!EBIT_TEST(e->flags, RELEASE_REQUEST));
     newkey = storeKeyPublic(mem->url, mem->method);
     if ((e2 = (StoreEntry *) hash_lookup(store_table, newkey))) {
        debug(20, 3) ("storeSetPublicKey: Making old '%s' private.\n", mem->url);
@@ -337,7 +337,7 @@ storeSetPublicKey(StoreEntry * e)
     }
     if (e->key)
        storeHashDelete(e);
-    e->flags.key_private = 0;
+    EBIT_CLR(e->flags, KEY_PRIVATE);
     storeHashInsert(e, newkey);
     if (e->swap_file_number > -1)
        storeDirSwapLog(e, SWAP_LOG_ADD);
@@ -359,10 +359,10 @@ storeCreateEntry(const char *url, const char *log_url, request_flags flags, meth
     else
        storeSetPublicKey(e);
     if (flags.cachable) {
-       e->flags.entry_cachable = 1;
-       e->flags.release_request = 0;
+       EBIT_SET(e->flags, ENTRY_CACHABLE);
+       EBIT_CLR(e->flags, RELEASE_REQUEST);
     } else {
-       e->flags.entry_cachable = 0;
+       EBIT_CLR(e->flags, ENTRY_CACHABLE);
        storeReleaseRequest(e);
     }
     e->store_status = STORE_PENDING;
@@ -373,9 +373,9 @@ storeCreateEntry(const char *url, const char *log_url, request_flags flags, meth
     e->lastref = squid_curtime;
     e->timestamp = 0;          /* set in storeTimestampsSet() */
     e->ping_status = PING_NONE;
-    e->flags.entry_validated = 1;
+    EBIT_SET(e->flags, ENTRY_VALIDATED);
 #ifdef PPNR_WIP
-    e->flags.entry_fwd_hdr_wait = 1;
+    EBIT_SET(e->flags, ENTRY_FWD_HDR_WAIT);
 #endif /* PPNR_WIP */
     return e;
 }
@@ -403,7 +403,7 @@ storeAppend(StoreEntry * e, const char *buf, int len)
        stmemAppend(&mem->data_hdr, buf, len);
        mem->inmem_hi += len;
     }
-    if (e->flags.delay_sending)
+    if (EBIT_TEST(e->flags, DELAY_SENDING))
        return;
 #ifdef OPTIMISTIC_IO
     storeLockObject(e);
@@ -483,23 +483,23 @@ storeCheckCachable(StoreEntry * e)
        store_check_cachable_hist.no.non_get++;
     } else
 #endif
-    if (!e->flags.entry_cachable) {
+    if (!EBIT_TEST(e->flags, ENTRY_CACHABLE)) {
        debug(20, 2) ("storeCheckCachable: NO: not cachable\n");
        store_check_cachable_hist.no.not_entry_cachable++;
-    } else if (e->flags.release_request) {
+    } else if (EBIT_TEST(e->flags, RELEASE_REQUEST)) {
        debug(20, 2) ("storeCheckCachable: NO: release requested\n");
        store_check_cachable_hist.no.release_request++;
-    } else if (e->store_status == STORE_OK && e->flags.entry_bad_length) {
+    } else if (e->store_status == STORE_OK && EBIT_TEST(e->flags, ENTRY_BAD_LENGTH)) {
        debug(20, 2) ("storeCheckCachable: NO: wrong content-length\n");
        store_check_cachable_hist.no.wrong_content_length++;
-    } else if (e->flags.entry_negcached) {
+    } else if (EBIT_TEST(e->flags, ENTRY_NEGCACHED)) {
        debug(20, 3) ("storeCheckCachable: NO: negative cached\n");
        store_check_cachable_hist.no.negative_cached++;
        return 0;               /* avoid release call below */
     } else if (e->mem_obj->inmem_hi > Config.Store.maxObjectSize) {
        debug(20, 2) ("storeCheckCachable: NO: too big\n");
        store_check_cachable_hist.no.too_big++;
-    } else if (e->flags.key_private) {
+    } else if (EBIT_TEST(e->flags, KEY_PRIVATE)) {
        debug(20, 3) ("storeCheckCachable: NO: private key\n");
        store_check_cachable_hist.no.private_key++;
     } else if (storeTooManyDiskFilesOpen()) {
@@ -514,7 +514,7 @@ storeCheckCachable(StoreEntry * e)
        return 1;
     }
     storeReleaseRequest(e);
-    e->flags.entry_cachable = 0;
+    EBIT_CLR(e->flags, ENTRY_CACHABLE);
     return 0;
 }
 
@@ -553,7 +553,7 @@ storeComplete(StoreEntry * e)
     e->store_status = STORE_OK;
     assert(e->mem_status == NOT_IN_MEMORY);
     if (!storeEntryValidLength(e))
-       e->flags.entry_bad_length = 1;
+       EBIT_SET(e->flags, ENTRY_BAD_LENGTH);
 #if USE_CACHE_DIGESTS
     if (e->mem_obj->request)
        e->mem_obj->request->hier.store_complete_stop = current_time;
@@ -566,8 +566,8 @@ storeComplete(StoreEntry * e)
 void
 storePPNR(StoreEntry * e)
 {
-    assert(e->flags.entry_fwd_hdr_wait);
-    e->flags.entry_fwd_hdr_wait = 0;
+    assert(EBIT_TEST(e->flags, ENTRY_FWD_HDR_WAIT));
+    EBIT_CLR(e->flags, ENTRY_FWD_HDR_WAIT);
 }
 
 #endif /* PPNR_WIP */
@@ -769,7 +769,7 @@ storeRelease(StoreEntry * e)
            storeUrl(e));
        storeExpireNow(e);
        storeSetPrivateKey(e);
-       e->flags.release_request = 1;
+       EBIT_SET(e->flags, RELEASE_REQUEST);
        return;
     }
 #if USE_ASYNC_IO
@@ -783,9 +783,9 @@ storeRelease(StoreEntry * e)
        storeUnlinkFileno(e->swap_file_number);
        storeDirMapBitReset(e->swap_file_number);
        if (e->swap_status == SWAPOUT_DONE)
-           if (e->flags.entry_validated)
+           if (EBIT_TEST(e->flags, ENTRY_VALIDATED))
                storeDirUpdateSwapSize(e->swap_file_number, e->swap_file_sz, -1);
-       if (!e->flags.key_private)
+       if (!EBIT_TEST(e->flags, KEY_PRIVATE))
            storeDirSwapLog(e, SWAP_LOG_DEL);
     }
     storeSetMemStatus(e, NOT_IN_MEMORY);
@@ -804,7 +804,7 @@ storeEntryLocked(const StoreEntry * e)
        return 1;
     if (e->store_status == STORE_PENDING)
        return 1;
-    if (e->flags.entry_special)
+    if (EBIT_TEST(e->flags, ENTRY_SPECIAL))
        return 1;
     return 0;
 }
@@ -878,7 +878,6 @@ storeInitHashValues(void)
 void
 storeInit(void)
 {
-    assert(sizeof(store_flags) == sizeof(unsigned short));
     storeKeyInit();
     storeInitHashValues();
     store_table = hash_create(storeKeyHashCmp,
@@ -941,9 +940,9 @@ storeCheckExpired(const StoreEntry * e)
 {
     if (storeEntryLocked(e))
        return 0;
-    if (e->flags.release_request)
+    if (EBIT_TEST(e->flags, RELEASE_REQUEST))
        return 1;
-    if (e->flags.entry_negcached && squid_curtime >= e->expires)
+    if (EBIT_TEST(e->flags, ENTRY_NEGCACHED) && squid_curtime >= e->expires)
        return 1;
     if (squid_curtime - e->lastref > storeExpiredReferenceAge())
        return 1;
@@ -982,7 +981,7 @@ void
 storeNegativeCache(StoreEntry * e)
 {
     e->expires = squid_curtime + Config.negativeTtl;
-    e->flags.entry_negcached = 1;
+    EBIT_SET(e->flags, ENTRY_NEGCACHED);
 }
 
 void
@@ -1007,9 +1006,9 @@ expiresMoreThan(time_t expires, time_t when)
 int
 storeEntryValidToSend(StoreEntry * e)
 {
-    if (e->flags.release_request)
+    if (EBIT_TEST(e->flags, RELEASE_REQUEST))
        return 0;
-    if (e->flags.entry_negcached)
+    if (EBIT_TEST(e->flags, ENTRY_NEGCACHED))
        if (e->expires <= squid_curtime)
            return 0;
     if (e->store_status == STORE_ABORTED)
@@ -1142,14 +1141,14 @@ storeCreateMemObject(StoreEntry * e, const char *url, const char *log_url)
 void
 storeBuffer(StoreEntry * e)
 {
-    e->flags.delay_sending = 1;
+    EBIT_SET(e->flags, DELAY_SENDING);
 }
 
 /* this just clears DELAY_SENDING and Invokes the handlers */
 void
 storeBufferFlush(StoreEntry * e)
 {
-    e->flags.delay_sending = 0;
+    EBIT_CLR(e->flags, DELAY_SENDING);
     InvokeHandlers(e);
     storeCheckSwapOut(e);
 }
index f4261ac4a1f67c08aa2332e07d117306bde52913..c0c89a70d9d20f82a8cf4e7605de2f5d68b89681 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_client.cc,v 1.42 1998/09/19 16:39:15 wessels Exp $
+ * $Id: store_client.cc,v 1.43 1998/09/19 17:06:13 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Client-Side Interface
  * AUTHOR: Duane Wessels
@@ -179,7 +179,7 @@ storeClientCopy2(StoreEntry * e, store_client * sc)
     if (sc->flags.copy_event_pending)
        return;
 #ifdef PPNR_WIP
-    if (e->flags.entry_fwd_hdr_wait)
+    if (EBIT_TEST(e->flags, ENTRY_FWD_HDR_WAIT))
        return;
 #endif /* PPNR_WIP */
     if (sc->flags.store_copying) {
index 31d8800c5d96289f016a41eeeb3ab14217454e40..dcc09ef83aecff1d6b91bb9a14b93b2d08786413 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: store_digest.cc,v 1.27 1998/09/14 21:28:13 wessels Exp $
+ * $Id: store_digest.cc,v 1.28 1998/09/19 17:06:13 wessels Exp $
  *
  * DEBUG: section 71    Store Digest Manager
  * AUTHOR: Alex Rousskov
@@ -139,7 +139,7 @@ storeDigestDel(const StoreEntry * entry)
     assert(entry && store_digest);
     debug(71, 6) ("storeDigestDel: checking entry, key: %s\n",
        storeKeyText(entry->key));
-    if (!entry->flags.key_private) {
+    if (!EBIT_TEST(entry->flags, KEY_PRIVATE)) {
        if (!cacheDigestTest(store_digest, entry->key)) {
            sd_stats.del_lost_count++;
            debug(71, 6) ("storeDigestDel: lost entry, key: %s url: %s\n",
@@ -188,7 +188,7 @@ storeDigestAdd(const StoreEntry * entry)
     debug(71, 6) ("storeDigestAdd: checking entry, key: %s\n",
        storeKeyText(entry->key));
     /* only public entries are digested */
-    if (!entry->flags.key_private) {
+    if (!EBIT_TEST(entry->flags, KEY_PRIVATE)) {
        const time_t refresh = refreshWhen(entry);
        debug(71, 6) ("storeDigestAdd: entry expires in %d secs\n",
            (int) (refresh - squid_curtime));
@@ -326,7 +326,7 @@ storeDigestRewriteResume(void)
     assert(sd_state.rewrite_lock);
     assert(!sd_state.rebuild_lock);
     sd_state.rewrite_offset = 0;
-    e->flags.entry_special = 1;
+    EBIT_SET(e->flags, ENTRY_SPECIAL);
     /* setting public key will purge old digest entry if any */
     storeSetPublicKey(e);
     /* fake reply */
index 22f58cba18a52741d870a8320474bace40be309d..201e57e277345401f6528a02f6fa98132a18fa69 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.78 1998/09/18 15:14:42 wessels Exp $
+ * $Id: store_dir.cc,v 1.79 1998/09/19 17:06:14 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -390,12 +390,12 @@ storeDirSwapLog(const StoreEntry * e, int op)
     int dirn;
     dirn = e->swap_file_number >> SWAP_DIR_SHIFT;
     assert(dirn < Config.cacheSwap.n_configured);
-    assert(!e->flags.key_private);
+    assert(!EBIT_TEST(e->flags, KEY_PRIVATE));
     assert(e->swap_file_number >= 0);
     /*
      * icons and such; don't write them to the swap log
      */
-    if (e->flags.entry_special)
+    if (EBIT_TEST(e->flags, ENTRY_SPECIAL))
        return;
     assert(op > SWAP_LOG_NOP && op < SWAP_LOG_MAX);
     debug(20, 3) ("storeDirSwapLog: %s %s %08X\n",
@@ -674,11 +674,11 @@ storeDirWriteCleanLogs(int reopen)
            continue;
        if (e->swap_file_sz <= 0)
            continue;
-       if (e->flags.release_request)
+       if (EBIT_TEST(e->flags, RELEASE_REQUEST))
            continue;
-       if (e->flags.key_private)
+       if (EBIT_TEST(e->flags, KEY_PRIVATE))
            continue;
-       if (e->flags.entry_special)
+       if (EBIT_TEST(e->flags, ENTRY_SPECIAL))
            continue;
        dirn = storeDirNumber(e->swap_file_number);
        assert(dirn < N);
index 56bf7aaf90bf1d71817f8828213f39123744593e..102bd326278d9e545199776111070a5df5cda7b7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_rebuild.cc,v 1.50 1998/09/15 19:38:03 wessels Exp $
+ * $Id: store_rebuild.cc,v 1.51 1998/09/19 17:06:15 wessels Exp $
  *
  * DEBUG: section 20    Store Rebuild Routines
  * AUTHOR: Duane Wessels
@@ -99,7 +99,7 @@ static StoreEntry *storeAddDiskRestore(const cache_key * key,
     time_t lastref,
     time_t lastmod,
     u_num32 refcount,
-    store_flags flags,
+    u_short flags,
     int clean);
 static AIOCB storeValidateComplete;
 
@@ -197,7 +197,7 @@ storeRebuildFromDirectory(rebuild_dir * d)
            storeUnlinkFileno(sfileno);
            continue;
        }
-       if (tmpe.flags.key_private) {
+       if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) {
            storeUnlinkFileno(sfileno);
            RebuildState.badflags++;
            continue;
@@ -274,7 +274,7 @@ storeRebuildFromSwapLog(rebuild_dir * d)
                 */
                storeExpireNow(e);
                storeSetPrivateKey(e);
-               e->flags.release_request = 1;
+               EBIT_SET(e->flags, RELEASE_REQUEST);
                if (e->swap_file_number > -1) {
                    storeDirMapBitReset(e->swap_file_number);
                    e->swap_file_number = -1;
@@ -298,7 +298,7 @@ storeRebuildFromSwapLog(rebuild_dir * d)
            RebuildState.invalid++;
            continue;
        }
-       if (s.flags.key_private) {
+       if (EBIT_TEST(s.flags, KEY_PRIVATE)) {
            RebuildState.badflags++;
            continue;
        }
@@ -356,7 +356,7 @@ storeRebuildFromSwapLog(rebuild_dir * d)
            /* junk old, load new */
            storeExpireNow(e);
            storeSetPrivateKey(e);
-           e->flags.release_request = 1;
+           EBIT_SET(e->flags, RELEASE_REQUEST);
            if (e->swap_file_number > -1) {
                storeDirMapBitReset(e->swap_file_number);
                e->swap_file_number = -1;
@@ -545,7 +545,7 @@ storeAddDiskRestore(const cache_key * key,
     time_t lastref,
     time_t lastmod,
     u_num32 refcount,
-    store_flags flags,
+    u_short flags,
     int clean)
 {
     StoreEntry *e = NULL;
@@ -566,11 +566,11 @@ storeAddDiskRestore(const cache_key * key,
     e->lastmod = lastmod;
     e->refcount = refcount;
     e->flags = flags;
-    e->flags.entry_cachable = 1;
-    e->flags.release_request = 0;
-    e->flags.key_private = 0;
+    EBIT_SET(e->flags, ENTRY_CACHABLE);
+    EBIT_CLR(e->flags, RELEASE_REQUEST);
+    EBIT_CLR(e->flags, KEY_PRIVATE);
     e->ping_status = PING_NONE;
-    e->flags.entry_validated = 0;
+    EBIT_CLR(e->flags, ENTRY_VALIDATED);
     storeDirMapBitSet(e->swap_file_number);
     storeHashInsert(e, key);   /* do it after we clear KEY_PRIVATE */
     return e;
@@ -600,7 +600,7 @@ storeCleanup(void *datanotused)
     while (NULL != (link_ptr = link_next)) {
        link_next = link_ptr->next;
        e = (StoreEntry *) link_ptr;
-       if (e->flags.entry_validated)
+       if (EBIT_TEST(e->flags, ENTRY_VALIDATED))
            continue;
        /*
         * Calling storeRelease() has no effect because we're
@@ -631,7 +631,7 @@ storeCleanup(void *datanotused)
                continue;
            }
        }
-       e->flags.entry_validated = 1;
+       EBIT_SET(e->flags, ENTRY_VALIDATED);
        /* Only set the file bit if we know its a valid entry */
        /* otherwise, set it in the validation procedure */
        storeDirUpdateSwapSize(e->swap_file_number, e->swap_file_sz, 1);
@@ -650,9 +650,9 @@ storeValidate(StoreEntry * e, STVLDCB * callback, void *callback_data, void *tag
 #if !USE_ASYNC_IO
     int x;
 #endif
-    assert(!e->flags.entry_validated);
+    assert(!EBIT_TEST(e->flags, ENTRY_VALIDATED));
     if (e->swap_file_number < 0) {
-       e->flags.entry_validated = 0;
+       EBIT_CLR(e->flags, ENTRY_VALIDATED);
        callback(callback_data, 0, 0);
        return;
     }
@@ -696,9 +696,9 @@ storeValidateComplete(int fd, void *data, int retcode, int errcode)
        retcode = stat(path, sb);
     }
     if (retcode < 0 || sb->st_size == 0 || sb->st_size != e->swap_file_sz) {
-       e->flags.entry_validated = 0;
+       EBIT_CLR(e->flags, ENTRY_VALIDATED);
     } else {
-       e->flags.entry_validated = 1;
+       EBIT_SET(e->flags, ENTRY_VALIDATED);
        storeDirUpdateSwapSize(e->swap_file_number, e->swap_file_sz, 1);
     }
     errno = errcode;
index d3748d1cde22c09228969f1888e151ff7f6cc907..13d5880199183aa175f08abde369b39f29f273f6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapin.cc,v 1.13 1998/09/14 21:28:16 wessels Exp $
+ * $Id: store_swapin.cc,v 1.14 1998/09/19 17:06:16 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Swapin Functions
  * AUTHOR: Duane Wessels
@@ -50,7 +50,7 @@ storeSwapInStart(StoreEntry * e, SIH * callback, void *callback_data)
 {
     swapin_ctrl_t *ctrlp;
     assert(e->mem_status == NOT_IN_MEMORY);
-    if (!e->flags.entry_validated) {
+    if (!EBIT_TEST(e->flags, ENTRY_VALIDATED)) {
        /* We're still reloading and haven't validated this entry yet */
        callback(-1, callback_data);
        return;
@@ -64,7 +64,7 @@ storeSwapInStart(StoreEntry * e, SIH * callback, void *callback_data)
     ctrlp->e = e;
     ctrlp->callback = callback;
     ctrlp->callback_data = callback_data;
-    if (e->flags.entry_validated)
+    if (EBIT_TEST(e->flags, ENTRY_VALIDATED))
        storeSwapInValidateComplete(ctrlp, 0, 0);
     else
        storeValidate(e, storeSwapInValidateComplete, ctrlp, callback_data);
@@ -81,7 +81,7 @@ storeSwapInValidateComplete(void *data, int retcode, int errcode)
     }
     e = ctrlp->e;
     assert(e->mem_status == NOT_IN_MEMORY);
-    if (!e->flags.entry_validated) {
+    if (!EBIT_TEST(e->flags, ENTRY_VALIDATED)) {
        /* Invoke a store abort that should free the memory object */
        (ctrlp->callback) (-1, ctrlp->callback_data);
        xfree(ctrlp);
index 15e694b07985491892a6b82091e8536d069eba7a..5491ee46a2d16813d7cd908317ecbec09cfe3a24 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapout.cc,v 1.32 1998/09/18 15:15:25 wessels Exp $
+ * $Id: store_swapout.cc,v 1.33 1998/09/19 17:06:16 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Swapout Functions
  * AUTHOR: Duane Wessels
@@ -140,7 +140,7 @@ storeCheckSwapOut(StoreEntry * e)
     debug(20, 3) ("storeCheckSwapOut: store_status = %s\n",
        storeStatusStr[e->store_status]);
     if (e->store_status == STORE_ABORTED) {
-       assert(e->flags.release_request);
+       assert(EBIT_TEST(e->flags, RELEASE_REQUEST));
        storeSwapOutFileClose(e);
        return;
     }
@@ -155,7 +155,7 @@ storeCheckSwapOut(StoreEntry * e)
 #if USE_ASYNC_IO
     if (mem->inmem_hi < mem->swapout.queue_offset) {
        storeAbort(e, 0);
-       assert(e->flags.release_request);
+       assert(EBIT_TEST(e->flags, RELEASE_REQUEST));
        storeSwapOutFileClose(e);
        return;
     }
@@ -378,5 +378,5 @@ storeSwapOutAble(const StoreEntry * e)
     if (e->mem_obj->inmem_lo > 0)
        return 0;
     /* swapout.fd == -1 && inmem_lo == 0 */
-    return e->flags.entry_cachable;
+    return EBIT_TEST(e->flags, ENTRY_CACHABLE);
 }
index c105fe02efe83743fa5416692cc89abd7785e25c..0a1eafab7720c4c2be577f9f2a664708256986fb 100644 (file)
@@ -1,6 +1,7 @@
 
+
 /*
- * $Id: structs.h,v 1.230 1998/09/15 19:38:04 wessels Exp $
+ * $Id: structs.h,v 1.231 1998/09/19 17:06:17 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -1214,54 +1215,6 @@ struct _MemObject {
     size_t swap_hdr_sz;
 };
 
-struct _store_flags {
-    /*
-     * These are for StoreEntry->flag, which is defined as a SHORT
-     *
-     * NOTE: These flags are written to swap.state, so think very carefully
-     * about deleting or re-assigning!
-     */
-#if WORDS_BIGENDIAN
-    unsigned short entry_unused_15:1;
-    unsigned short entry_unused_14:1;
-    unsigned short entry_unused_13:1;
-    unsigned short entry_unused_12:1;
-    unsigned short entry_bad_length:1;
-    unsigned short entry_validated:1;
-    unsigned short entry_negcached:1;
-#ifndef PPNR_WIP
-    unsigned short entry_unused_08:1;
-#else
-    unsigned short entry_fwd_hdr_wait:1;
-#endif                         /* PPNR_WIP */
-    unsigned short key_private:1;
-    unsigned short entry_dispatched:1;
-    unsigned short entry_cachable:1;
-    unsigned short refresh_request:1;
-    unsigned short release_request:1;
-    unsigned short delay_sending:1;
-    unsigned short entry_revalidate:1;
-    unsigned short entry_special:1;
-#else                          /* ENDIAN */
-    unsigned short entry_special:1;
-    unsigned short entry_revalidate:1;
-    unsigned short delay_sending:1;
-    unsigned short release_request:1;
-    unsigned short refresh_request:1;
-    unsigned short entry_cachable:1;
-    unsigned short entry_dispatched:1;
-    unsigned short key_private:1;
-#ifndef PPNR_WIP
-    unsigned short entry_unused_08:1;
-#else
-    unsigned short entry_fwd_hdr_wait:1;
-#endif                         /* PPNR_WIP */
-    unsigned short entry_negcached:1;
-    unsigned short entry_validated:1;
-    unsigned short entry_bad_length:1;
-#endif                         /* ENDIAN */
-};
-
 struct _StoreEntry {
     /* first two items must be same as hash_link */
     const cache_key *key;
@@ -1273,7 +1226,7 @@ struct _StoreEntry {
     time_t lastmod;
     size_t swap_file_sz;
     u_short refcount;
-    store_flags flags;
+    u_short flags;
     int swap_file_number;
     dlink_node lru;
     u_short lock_count;                /* Assume < 65536! */
@@ -1551,7 +1504,7 @@ struct _storeSwapLogData {
     time_t lastmod;
     size_t swap_file_sz;
     u_short refcount;
-    store_flags flags;
+    u_short flags;
     unsigned char key[MD5_DIGEST_CHARS];
 };
 
index 24cf89f8cbf2c68f4b8d20c6e996fa7b78049c30..6d7a38a78441615e2fd9e3df5871d2bf85d8bfb9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: typedefs.h,v 1.77 1998/09/14 22:28:00 wessels Exp $
+ * $Id: typedefs.h,v 1.78 1998/09/19 17:06:18 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -132,7 +132,6 @@ typedef struct _MemObject MemObject;
 typedef struct _StoreEntry StoreEntry;
 typedef struct _SwapDir SwapDir;
 typedef struct _request_flags request_flags;
-typedef struct _store_flags store_flags;
 typedef struct _helper_flags helper_flags;
 typedef struct _http_state_flags http_state_flags;
 typedef struct _request_t request_t;
index 0a42a2881ca3fadd69fe298265505d46f281c6b7..ad61b2e94d02ef7a7b30fe0b5263e2d3fee3eef6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.119 1998/09/14 21:28:19 wessels Exp $
+ * $Id: wais.cc,v 1.120 1998/09/19 17:06:19 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -131,7 +131,7 @@ waisReadReply(int fd, void *data)
                waisReadReply, waisState, 0);
        } else {
            ErrorState *err;
-           entry->flags.entry_cachable = 0;
+           EBIT_CLR(entry->flags, ENTRY_CACHABLE);
            storeReleaseRequest(entry);
            err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR);
            err->xerrno = errno;
@@ -213,7 +213,7 @@ waisSendRequest(int fd, void *data)
     memBufPrintf(&mb, "\r\n");
     debug(24, 6) ("waisSendRequest: buf: %s\n", mb.buf);
     comm_write_mbuf(fd, mb, waisSendComplete, waisState);
-    if (waisState->entry->flags.entry_cachable)
+    if (EBIT_TEST(waisState->entry->flags, ENTRY_CACHABLE))
        storeSetPublicKey(waisState->entry);    /* Make it public */
 }