]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
removed EBIT macros for StoreEntry->flag
authorwessels <>
Tue, 15 Sep 1998 03:28:00 +0000 (03:28 +0000)
committerwessels <>
Tue, 15 Sep 1998 03:28:00 +0000 (03:28 +0000)
23 files changed:
src/client_side.cc
src/enums.h
src/forward.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/protos.h
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 6755bdf402fa7976871740632c53fd90f7ebf96f..b169ffc9ca3ad2c70cea9ca5e119a84016b1a2cb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.393 1998/09/14 02:33:01 wessels Exp $
+ * $Id: client_side.cc,v 1.394 1998/09/14 21:28:00 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -485,7 +485,7 @@ clientPurgeRequest(clientHttpRequest * http)
 int
 checkNegativeHit(StoreEntry * e)
 {
-    if (!EBIT_TEST(e->flag, ENTRY_NEGCACHED))
+    if (!e->flags.entry_negcached)
        return 0;
     if (e->expires <= squid_curtime)
        return 0;
@@ -1524,7 +1524,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 (EBIT_TEST(entry->flag, ENTRY_BAD_LENGTH)) {
+       } else if (entry->flags.entry_bad_length) {
            debug(33, 5) ("clientWriteComplete: closing, ENTRY_BAD_LENGTH\n");
            comm_close(fd);
        } else if (http->request->flags.proxy_keepalive) {
@@ -1590,7 +1590,7 @@ clientProcessRequest2(clientHttpRequest * http)
     } else if (!storeEntryValidToSend(e)) {
        http->entry = NULL;
        return LOG_TCP_MISS;
-    } else if (EBIT_TEST(e->flag, ENTRY_SPECIAL)) {
+    } else if (e->flags.entry_special) {
        /* Special entries are always hits, no matter what the client says */
        http->entry = e;
        return LOG_TCP_HIT;
@@ -1692,7 +1692,7 @@ clientProcessMiss(clientHttpRequest * http)
      * or IMS request.
      */
     if (http->entry) {
-       if (EBIT_TEST(http->entry->flag, ENTRY_SPECIAL))
+       if (http->entry->flags.entry_special)
            debug(33, 0) ("clientProcessMiss: miss on a special object (%s).\n", url);
        storeUnregister(http->entry, http);
        storeUnlockObject(http->entry);
@@ -2256,7 +2256,7 @@ CheckQuickAbort2(const clientHttpRequest * http)
 
     if (!http->request->flags.cachable)
        return 1;
-    if (EBIT_TEST(http->entry->flag, KEY_PRIVATE))
+    if (http->entry->flags.key_private)
        return 1;
     if (http->entry->mem_obj == NULL)
        return 1;
index 075a62caf68b389879d131ba15c72e7792f4ffc8..15676fb02e0804554908d50e4d3b8264177d6091 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: enums.h,v 1.126 1998/08/30 05:21:40 wessels Exp $
+ * $Id: enums.h,v 1.127 1998/09/14 21:28:01 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -436,31 +436,6 @@ typedef enum {
     PD_INIT_PENDING
 } peer_cd_t;
 
-/*
- * 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 {
-    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
-};
-
 enum {
     HTTP_PROXYING,
     HTTP_KEEPALIVE
index 6d4f74399e2912763cdeab49a616cce750397177..3eecdc53ca757aec9b1c2a317111e350c871b88a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.26 1998/09/01 23:31:23 wessels Exp $
+ * $Id: forward.cc,v 1.27 1998/09/14 21:28:02 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(!EBIT_TEST(entry->flag, ENTRY_DISPATCHED)); */
+    /*assert(!entry->flags.entry_dispatched); */
     assert(entry->ping_status != PING_WAITING);
     assert(entry->lock_count);
-    EBIT_SET(entry->flag, ENTRY_DISPATCHED);
+    entry->flags.entry_dispatched = 1;
     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(EBIT_TEST(fwdState->entry->flag, ENTRY_FWD_HDR_WAIT));
+    assert(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 752fb91758bb15c0ca26868d7ab18dcd8abeb01a..3a34d57217bdd8d8aa385d32f21fa0cc66690565 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.250 1998/09/04 23:04:46 wessels Exp $
+ * $Id: ftp.cc,v 1.251 1998/09/14 21:28: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 (EBIT_TEST(e->flag, ENTRY_CACHABLE))
+    if (e->flags.entry_cachable)
        storeSetPublicKey(e);
 }
 
index 632b02927831b2d621eab5ff8ef0f971f566d195..81caaf10fa596e07b4cdab5e2482e96df30b7069 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: gopher.cc,v 1.137 1998/09/04 23:04:47 wessels Exp $
+ * $Id: gopher.cc,v 1.138 1998/09/14 21:28:04 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -763,7 +763,7 @@ gopherSendRequest(int fd, void *data)
        gopherSendComplete,
        data,
        memFree4K);
-    if (EBIT_TEST(gopherState->entry->flag, ENTRY_CACHABLE))
+    if (gopherState->entry->flags.entry_cachable)
        storeSetPublicKey(gopherState->entry);  /* Make it public */
 }
 
index 73b0bfd7e5b199338ca2f3e9de5a9a63cf572c4d..d6ef68c5ab80e45b4470c51f92b177b6e91a015f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.316 1998/09/10 19:48:55 wessels Exp $
+ * $Id: http.cc,v 1.317 1998/09/14 21:28: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 (EBIT_TEST(entry->flag, ENTRY_CACHABLE))
+    if (entry->flags.entry_cachable)
        storeSetPublicKey(entry);
 }
 
@@ -124,7 +124,7 @@ static void
 httpCacheNegatively(StoreEntry * entry)
 {
     storeNegativeCache(entry);
-    if (EBIT_TEST(entry->flag, ENTRY_CACHABLE))
+    if (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 (!EBIT_TEST(e->flag, KEY_PRIVATE))
+    if (!e->flags.key_private)
        return;
     switch (status) {
     case HTTP_OK:
@@ -319,9 +319,9 @@ httpProcessReplyHeader(HttpStateData * httpState, const char *buf, int size)
        }
        if (reply->cache_control) {
            if (EBIT_TEST(reply->cache_control->mask, CC_PROXY_REVALIDATE))
-               EBIT_SET(entry->flag, ENTRY_REVALIDATE);
+               entry->flags.entry_revalidate = 1;
            else if (EBIT_TEST(reply->cache_control->mask, CC_MUST_REVALIDATE))
-               EBIT_SET(entry->flag, ENTRY_REVALIDATE);
+               entry->flags.entry_revalidate = 1;
        }
        if (EBIT_TEST(httpState->flags, HTTP_KEEPALIVE))
            if (httpState->peer)
index 29935fe258e6b78fb42dffc804803daa3f648aaf..ba174fc27adb6130a5a45cbe9037f652d3499707 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: mime.cc,v 1.78 1998/08/21 03:15:18 wessels Exp $
+ * $Id: mime.cc,v 1.79 1998/09/14 21:28:05 wessels Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
@@ -415,7 +415,7 @@ mimeLoadIconFile(const char *icon)
     storeSetPublicKey(e);
     storeComplete(e);
     storeTimestampsSet(e);
-    EBIT_SET(e->flag, ENTRY_SPECIAL);
+    e->flags.entry_special = 1;
     debug(25, 3) ("Loaded icon %s\n", url);
     storeUnlockObject(e);
     memFree(MEM_4K_BUF, buf);
index bf5f70da3f703a76c0a63d23c1bca3fd0e5d7be8..701a386c8b401812e37da4391b3336aa8a1c1b17 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.245 1998/09/14 20:29:30 wessels Exp $
+ * $Id: neighbors.cc,v 1.246 1998/09/14 21:28:06 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -724,7 +724,7 @@ neighborsUdpAck(const cache_key * key, icp_common_t * header, const struct socka
        return;
     }
     /* check if someone is already fetching it */
-    if (EBIT_TEST(entry->flag, ENTRY_DISPATCHED)) {
+    if (entry->flags.entry_dispatched) {
        debug(15, 3) ("neighborsUdpAck: '%s' already being fetched.\n",
            storeKeyText(key));
        neighborCountIgnored(p);
@@ -1197,7 +1197,7 @@ neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const struct soc
        return;
     }
     /* check if someone is already fetching it */
-    if (EBIT_TEST(e->flag, ENTRY_DISPATCHED)) {
+    if (e->flags.entry_dispatched) {
        debug(15, 3) ("neighborsUdpAck: '%s' already being fetched.\n",
            storeKeyText(key));
        neighborCountIgnored(p);
index 161f5d9593e64c15976cd9c1c12a0c6688a13eaa..aee9fbfa7512ff33a7e0e3210f3ebc8e27412f58 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_digest.cc,v 1.47 1998/09/14 15:46:48 wessels Exp $
+ * $Id: peer_digest.cc,v 1.48 1998/09/14 21:28:07 wessels Exp $
  *
  * DEBUG: section 72    Peer Digest Routines
  * AUTHOR: Alex Rousskov
@@ -274,7 +274,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) EBIT_TEST(e->flag, KEY_PRIVATE));
+       (int) e->flags.key_private);
     storeClientListAdd(e, fetch);
     /* set lastmod to trigger IMS request if possible */
     if (old_e)
index 169b7dddb8db2609805d348371c3161d9d5e1edd..3af49ea12bd8db04e1d9fb5641db8edd051c955e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.79 1998/08/27 06:28:28 wessels Exp $
+ * $Id: peer_select.cc,v 1.80 1998/09/14 21:28:08 wessels Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -113,7 +113,7 @@ peerSelectIcpPing(request_t * request, int direct, StoreEntry * entry)
     assert(direct != DIRECT_YES);
     if (!request->flags.hierarchical && direct != DIRECT_NO)
        return 0;
-    if (EBIT_TEST(entry->flag, KEY_PRIVATE) && !neighbors_do_private_keys)
+    if (entry->flags.key_private && !neighbors_do_private_keys)
        if (direct != DIRECT_NO)
            return 0;
     n = neighborsCount(request);
index 0b8647f5a033caa1a4157102cb52b105a19686ac..f2032d31850341ee05e0ddd99d66764a0f12859e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.262 1998/09/11 17:07:46 wessels Exp $
+ * $Id: protos.h,v 1.263 1998/09/14 21:28:09 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -668,6 +668,7 @@ extern void pconnHistCount(int, int);
 extern int stat5minClientRequests(void);
 extern double stat5minCPUUsage(void);
 extern double statMedianSvc(int, int);
+extern const char *storeEntryFlags(const StoreEntry *);
 
 
 /* StatHist */
index 92e76257051d66d35234691f3e016c6fb2a3a148..615ca0669e074a0382fb05d9d8e34e071cf8f966 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: refresh.cc,v 1.34 1998/08/21 04:03:48 wessels Exp $
+ * $Id: refresh.cc,v 1.35 1998/09/14 21:28:10 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 (EBIT_TEST(entry->flag, ENTRY_REVALIDATE)) {
+    if (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 (EBIT_TEST(entry->flag, ENTRY_REVALIDATE)) {
+       if (entry->flags.entry_revalidate) {
            debug(22, 3) ("refreshWhen: NOW: Required Authorization\n");
            return refresh_time;
        }
index 795b3399e73381f6888d5b66ec7ec173d2d77ea4..45c435574c95c29e194fdb716d123f5129721986 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.286 1998/09/10 16:03:25 wessels Exp $
+ * $Id: stat.cc,v 1.287 1998/09/14 21:28:10 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -47,7 +47,6 @@ typedef struct {
 
 /* LOCALS */
 static const char *describeStatuses(const StoreEntry *);
-static const char *describeFlags(const StoreEntry *);
 static const char *describeTimestamps(const StoreEntry *);
 static void statAvgTick(void *notused);
 static void statAvgDump(StoreEntry *, int minutes, int hours);
@@ -196,34 +195,33 @@ describeStatuses(const StoreEntry * entry)
     return buf;
 }
 
-static const char *
-describeFlags(const StoreEntry * entry)
+const char *
+storeEntryFlags(const StoreEntry * entry)
 {
     LOCAL_ARRAY(char, buf, 256);
-    int flags = (int) entry->flag;
     char *t;
     buf[0] = '\0';
-    if (EBIT_TEST(flags, ENTRY_SPECIAL))
+    if (entry->flags.entry_special)
        strcat(buf, "SPECIAL,");
-    if (EBIT_TEST(flags, ENTRY_REVALIDATE))
+    if (entry->flags.entry_revalidate)
        strcat(buf, "REVALIDATE,");
-    if (EBIT_TEST(flags, DELAY_SENDING))
+    if (entry->flags.delay_sending)
        strcat(buf, "DELAY_SENDING,");
-    if (EBIT_TEST(flags, RELEASE_REQUEST))
+    if (entry->flags.release_request)
        strcat(buf, "RELEASE_REQUEST,");
-    if (EBIT_TEST(flags, REFRESH_REQUEST))
+    if (entry->flags.refresh_request)
        strcat(buf, "REFRESH_REQUEST,");
-    if (EBIT_TEST(flags, ENTRY_CACHABLE))
+    if (entry->flags.entry_cachable)
        strcat(buf, "CACHABLE,");
-    if (EBIT_TEST(flags, ENTRY_DISPATCHED))
+    if (entry->flags.entry_dispatched)
        strcat(buf, "DISPATCHED,");
-    if (EBIT_TEST(flags, KEY_PRIVATE))
+    if (entry->flags.key_private)
        strcat(buf, "PRIVATE,");
-    if (EBIT_TEST(flags, ENTRY_NEGCACHED))
+    if (entry->flags.entry_negcached)
        strcat(buf, "NEGCACHED,");
-    if (EBIT_TEST(flags, ENTRY_VALIDATED))
+    if (entry->flags.entry_validated)
        strcat(buf, "VALIDATED,");
-    if (EBIT_TEST(flags, ENTRY_BAD_LENGTH))
+    if (entry->flags.entry_bad_length)
        strcat(buf, "BAD_LENGTH,");
     if ((t = strrchr(buf, ',')))
        *t = '\0';
@@ -253,7 +251,7 @@ statStoreEntry(StoreEntry * s, StoreEntry * e)
        storeAppendPrintf(s, "\t%s %s\n",
            RequestMethodStr[mem->method], mem->log_url);
     storeAppendPrintf(s, "\t%s\n", describeStatuses(e));
-    storeAppendPrintf(s, "\t%s\n", describeFlags(e));
+    storeAppendPrintf(s, "\t%s\n", storeEntryFlags(e));
     storeAppendPrintf(s, "\t%s\n", describeTimestamps(e));
     storeAppendPrintf(s, "\t%d locks, %d clients, %d refs\n",
        (int) e->lock_count,
index 26a010587bb684f8953c58721e7169f5e7bed999..a14b1fe723edeb2ab84958bf8b9f8e27b85f6d31 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.457 1998/09/11 17:07:48 wessels Exp $
+ * $Id: store.cc,v 1.458 1998/09/14 21:28:12 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -225,17 +225,17 @@ storeLockObject(StoreEntry * e)
 void
 storeReleaseRequest(StoreEntry * e)
 {
-    if (EBIT_TEST(e->flag, RELEASE_REQUEST))
+    if (e->flags.release_request)
        return;
     assert(storeEntryLocked(e));
     debug(20, 3) ("storeReleaseRequest: '%s'\n", storeKeyText(e->key));
-    EBIT_SET(e->flag, RELEASE_REQUEST);
+    e->flags.release_request = 1;
     /*
      * 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(e->flag, ENTRY_CACHABLE);
+    e->flags.entry_cachable = 0;
     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(!EBIT_TEST(e->flag, ENTRY_DISPATCHED));
-       EBIT_SET(e->flag, RELEASE_REQUEST);
+       assert(!e->flags.entry_dispatched);
+       e->flags.release_request = 1;
     }
     assert(storePendingNClients(e) == 0);
-    if (EBIT_TEST(e->flag, RELEASE_REQUEST))
+    if (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 (EBIT_TEST(e->flag, KEY_PRIVATE)) {
+       if (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 && EBIT_TEST(e->flag, KEY_PRIVATE))
+    if (e->key && 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);
-    EBIT_SET(e->flag, KEY_PRIVATE);
+    e->flags.key_private = 1;
     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 && !EBIT_TEST(e->flag, KEY_PRIVATE))
+    if (e->key && !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(!EBIT_TEST(e->flag, RELEASE_REQUEST));
+    assert(!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);
-    EBIT_CLR(e->flag, KEY_PRIVATE);
+    e->flags.key_private = 0;
     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) {
-       EBIT_SET(e->flag, ENTRY_CACHABLE);
-       EBIT_CLR(e->flag, RELEASE_REQUEST);
+       e->flags.entry_cachable = 1;
+       e->flags.release_request = 0;
     } else {
-       EBIT_CLR(e->flag, ENTRY_CACHABLE);
+       e->flags.entry_cachable = 0;
        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;
-    EBIT_SET(e->flag, ENTRY_VALIDATED);
+    e->flags.entry_validated = 1;
 #ifdef PPNR_WIP
-    EBIT_SET(e->flag, ENTRY_FWD_HDR_WAIT);
+    e->flags.entry_fwd_hdr_wait = 1;
 #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 (EBIT_TEST(e->flag, DELAY_SENDING))
+    if (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 (!EBIT_TEST(e->flag, ENTRY_CACHABLE)) {
+    if (!e->flags.entry_cachable) {
        debug(20, 2) ("storeCheckCachable: NO: not cachable\n");
        store_check_cachable_hist.no.not_entry_cachable++;
-    } else if (EBIT_TEST(e->flag, RELEASE_REQUEST)) {
+    } else if (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 && EBIT_TEST(e->flag, ENTRY_BAD_LENGTH)) {
+    } else if (e->store_status == STORE_OK && e->flags.entry_bad_length) {
        debug(20, 2) ("storeCheckCachable: NO: wrong content-length\n");
        store_check_cachable_hist.no.wrong_content_length++;
-    } else if (EBIT_TEST(e->flag, ENTRY_NEGCACHED)) {
+    } else if (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 (EBIT_TEST(e->flag, KEY_PRIVATE)) {
+    } else if (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);
-    EBIT_CLR(e->flag, ENTRY_CACHABLE);
+    e->flags.entry_cachable = 0;
     return 0;
 }
 
@@ -553,7 +553,7 @@ storeComplete(StoreEntry * e)
     e->store_status = STORE_OK;
     assert(e->mem_status == NOT_IN_MEMORY);
     if (!storeEntryValidLength(e))
-       EBIT_SET(e->flag, ENTRY_BAD_LENGTH);
+       e->flags.entry_bad_length = 1;
 #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(EBIT_TEST(e->flag, ENTRY_FWD_HDR_WAIT));
-    EBIT_CLR(e->flag, ENTRY_FWD_HDR_WAIT);
+    assert(e->flags.entry_fwd_hdr_wait);
+    e->flags.entry_fwd_hdr_wait = 0;
 }
 #endif /* PPNR_WIP */
 
@@ -774,7 +774,7 @@ storeRelease(StoreEntry * e)
            storeUrl(e));
        storeExpireNow(e);
        storeSetPrivateKey(e);
-       EBIT_SET(e->flag, RELEASE_REQUEST);
+       e->flags.release_request = 1;
        return;
     }
 #endif
@@ -783,9 +783,9 @@ storeRelease(StoreEntry * e)
        storeUnlinkFileno(e->swap_file_number);
        storeDirMapBitReset(e->swap_file_number);
        if (e->swap_status == SWAPOUT_DONE)
-           if (EBIT_TEST(e->flag, ENTRY_VALIDATED))
+           if (e->flags.entry_validated)
                storeDirUpdateSwapSize(e->swap_file_number, e->swap_file_sz, -1);
-       if (!EBIT_TEST(e->flag, KEY_PRIVATE))
+       if (!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 (EBIT_TEST(e->flag, ENTRY_SPECIAL))
+    if (e->flags.entry_special)
        return 1;
     return 0;
 }
@@ -940,9 +940,9 @@ storeCheckExpired(const StoreEntry * e)
 {
     if (storeEntryLocked(e))
        return 0;
-    if (EBIT_TEST(e->flag, RELEASE_REQUEST))
+    if (e->flags.release_request)
        return 1;
-    if (EBIT_TEST(e->flag, ENTRY_NEGCACHED) && squid_curtime >= e->expires)
+    if (e->flags.entry_negcached && squid_curtime >= e->expires)
        return 1;
     if (squid_curtime - e->lastref > storeExpiredReferenceAge())
        return 1;
@@ -981,7 +981,7 @@ void
 storeNegativeCache(StoreEntry * e)
 {
     e->expires = squid_curtime + Config.negativeTtl;
-    EBIT_SET(e->flag, ENTRY_NEGCACHED);
+    e->flags.entry_negcached = 1;
 }
 
 void
@@ -1006,9 +1006,9 @@ expiresMoreThan(time_t expires, time_t when)
 int
 storeEntryValidToSend(StoreEntry * e)
 {
-    if (EBIT_TEST(e->flag, RELEASE_REQUEST))
+    if (e->flags.release_request)
        return 0;
-    if (EBIT_TEST(e->flag, ENTRY_NEGCACHED))
+    if (e->flags.entry_negcached)
        if (e->expires <= squid_curtime)
            return 0;
     if (e->store_status == STORE_ABORTED)
@@ -1090,7 +1090,7 @@ storeEntryDump(StoreEntry * e, int l)
     debug(20, l) ("StoreEntry->lastmod: %d\n", (int) e->lastmod);
     debug(20, l) ("StoreEntry->swap_file_sz: %d\n", (int) e->swap_file_sz);
     debug(20, l) ("StoreEntry->refcount: %d\n", e->refcount);
-    debug(20, l) ("StoreEntry->flag: %X\n", e->flag);
+    debug(20, l) ("StoreEntry->flags: %s\n", storeEntryFlags(e));
     debug(20, l) ("StoreEntry->swap_file_number: %d\n", (int) e->swap_file_number);
     debug(20, l) ("StoreEntry->lock_count: %d\n", (int) e->lock_count);
     debug(20, l) ("StoreEntry->mem_status: %d\n", (int) e->mem_status);
@@ -1141,14 +1141,14 @@ storeCreateMemObject(StoreEntry * e, const char *url, const char *log_url)
 void
 storeBuffer(StoreEntry * e)
 {
-    EBIT_SET(e->flag, DELAY_SENDING);
+    e->flags.delay_sending = 1;
 }
 
 /* this just clears DELAY_SENDING and Invokes the handlers */
 void
 storeBufferFlush(StoreEntry * e)
 {
-    EBIT_CLR(e->flag, DELAY_SENDING);
+    e->flags.delay_sending = 0;
     InvokeHandlers(e);
     storeCheckSwapOut(e);
 }
index c724a5bbeae44545aa89aa551f548d907130b2e9..f361d26b6d65ab4cd18485dec50e1350becb4ab9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_client.cc,v 1.40 1998/08/24 21:07:51 wessels Exp $
+ * $Id: store_client.cc,v 1.41 1998/09/14 21:28:13 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Client-Side Interface
  * AUTHOR: Duane Wessels
@@ -173,7 +173,7 @@ storeClientCopy2(StoreEntry * e, store_client * sc)
     if (sc->flags.copy_event_pending)
        return;
 #ifdef PPNR_WIP
-    if (EBIT_TEST(e->flag, ENTRY_FWD_HDR_WAIT))
+    if (e->flags.entry_fwd_hdr_wait)
        return;
 #endif /* PPNR_WIP */
     if (sc->flags.store_copying) {
index 864f6fbfc429bb58361126791fbfaa2ca988a29d..31d8800c5d96289f016a41eeeb3ab14217454e40 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: store_digest.cc,v 1.26 1998/08/21 03:15:25 wessels Exp $
+ * $Id: store_digest.cc,v 1.27 1998/09/14 21:28: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 (!EBIT_TEST(entry->flag, KEY_PRIVATE)) {
+    if (!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 (!EBIT_TEST(entry->flag, KEY_PRIVATE)) {
+    if (!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;
-    EBIT_SET(e->flag, ENTRY_SPECIAL);
+    e->flags.entry_special = 1;
     /* setting public key will purge old digest entry if any */
     storeSetPublicKey(e);
     /* fake reply */
index 8babbbe8ec1ea8366ca3157b25fd35688ffae640..c499c414543bf5c782e516248e5ceb50720bfda8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.75 1998/08/20 02:49:12 wessels Exp $
+ * $Id: store_dir.cc,v 1.76 1998/09/14 21:28:14 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -392,12 +392,12 @@ storeDirSwapLog(const StoreEntry * e, int op)
     int dirn;
     dirn = e->swap_file_number >> SWAP_DIR_SHIFT;
     assert(dirn < Config.cacheSwap.n_configured);
-    assert(!EBIT_TEST(e->flag, KEY_PRIVATE));
+    assert(!e->flags.key_private);
     assert(e->swap_file_number >= 0);
     /*
      * icons and such; don't write them to the swap log
      */
-    if (EBIT_TEST(e->flag, ENTRY_SPECIAL))
+    if (e->flags.entry_special)
        return;
     assert(op > SWAP_LOG_NOP && op < SWAP_LOG_MAX);
     debug(20, 3) ("storeDirSwapLog: %s %s %08X\n",
@@ -413,7 +413,7 @@ storeDirSwapLog(const StoreEntry * e, int op)
     s->lastmod = e->lastmod;
     s->swap_file_sz = e->swap_file_sz;
     s->refcount = e->refcount;
-    s->flags = e->flag;
+    s->flags = e->flags;
     xmemcpy(s->key, e->key, MD5_DIGEST_CHARS);
     file_write(Config.cacheSwap.swapDirs[dirn].swaplog_fd,
        -1,
@@ -676,11 +676,11 @@ storeDirWriteCleanLogs(int reopen)
            continue;
        if (e->swap_file_sz <= 0)
            continue;
-       if (EBIT_TEST(e->flag, RELEASE_REQUEST))
+       if (e->flags.release_request)
            continue;
-       if (EBIT_TEST(e->flag, KEY_PRIVATE))
+       if (e->flags.key_private)
            continue;
-       if (EBIT_TEST(e->flag, ENTRY_SPECIAL))
+       if (e->flags.entry_special)
            continue;
        dirn = storeDirNumber(e->swap_file_number);
        assert(dirn < N);
@@ -695,7 +695,7 @@ storeDirWriteCleanLogs(int reopen)
        s.lastmod = e->lastmod;
        s.swap_file_sz = e->swap_file_sz;
        s.refcount = e->refcount;
-       s.flags = e->flag;
+       s.flags = e->flags;
        xmemcpy(&s.key, e->key, MD5_DIGEST_CHARS);
        xmemcpy(outbuf[dirn] + outbufoffset[dirn], &s, ss);
        outbufoffset[dirn] += ss;
index 44162db74418e05d483d658cf2c9b02cfb154e75..fe519431790c3e74d1907b9d622a9fdcabdfa61e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_rebuild.cc,v 1.47 1998/09/04 23:05:03 wessels Exp $
+ * $Id: store_rebuild.cc,v 1.48 1998/09/14 21:28: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,
-    u_num32 flags,
+    store_flags flags,
     int clean);
 static AIOCB storeValidateComplete;
 
@@ -197,7 +197,7 @@ storeRebuildFromDirectory(rebuild_dir * d)
            storeUnlinkFileno(sfileno);
            continue;
        }
-       if (EBIT_TEST(tmpe.flag, KEY_PRIVATE)) {
+       if (tmpe.flags.key_private) {
            storeUnlinkFileno(sfileno);
            RebuildState.badflags++;
            continue;
@@ -224,7 +224,7 @@ storeRebuildFromDirectory(rebuild_dir * d)
            tmpe.lastref,
            tmpe.lastmod,
            tmpe.refcount,      /* refcount */
-           tmpe.flag         /* flags */
+           tmpe.flags,         /* flags */
            d->clean);
     }
     return count;
@@ -274,7 +274,7 @@ storeRebuildFromSwapLog(rebuild_dir * d)
                 */
                storeExpireNow(e);
                storeSetPrivateKey(e);
-               EBIT_SET(e->flag, RELEASE_REQUEST);
+               e->flags.release_request = 1;
                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 (EBIT_TEST(s.flags, KEY_PRIVATE)) {
+       if (s.flags.key_private) {
            RebuildState.badflags++;
            continue;
        }
@@ -314,13 +314,17 @@ storeRebuildFromSwapLog(rebuild_dir * d)
            continue;
        } else if (used && e && e->swap_file_number == s.swap_file_number) {
            /* swapfile taken, same URL, newer, update meta */
-           /* XXX what if e->store_status != STORE_OK? */
-           e->lastref = s.timestamp;
-           e->timestamp = s.timestamp;
-           e->expires = s.expires;
-           e->lastmod = s.lastmod;
-           e->flag |= s.flags;
-           e->refcount += s.refcount;
+           if (e->store_status == STORE_OK) {
+               e->lastref = s.timestamp;
+               e->timestamp = s.timestamp;
+               e->expires = s.expires;
+               e->lastmod = s.lastmod;
+               e->flags = s.flags;
+               e->refcount += s.refcount;
+           } else {
+               debug_trap("storeRebuildFromSwapLog: bad condition");
+               debug(20,1)("\tSee %s:%d\n", __FILE__, __LINE__);
+           }
            continue;
        } else if (used) {
            /* swapfile in use, not by this URL, log entry is newer */
@@ -352,7 +356,7 @@ storeRebuildFromSwapLog(rebuild_dir * d)
            /* junk old, load new */
            storeExpireNow(e);
            storeSetPrivateKey(e);
-           EBIT_SET(e->flag, RELEASE_REQUEST);
+           e->flags.release_request = 1;
            if (e->swap_file_number > -1) {
                storeDirMapBitReset(e->swap_file_number);
                e->swap_file_number = -1;
@@ -541,7 +545,7 @@ storeAddDiskRestore(const cache_key * key,
     time_t lastref,
     time_t lastmod,
     u_num32 refcount,
-    u_num32 flags,
+    store_flags flags,
     int clean)
 {
     StoreEntry *e = NULL;
@@ -561,12 +565,12 @@ storeAddDiskRestore(const cache_key * key,
     e->expires = expires;
     e->lastmod = lastmod;
     e->refcount = refcount;
-    e->flag = flags;
-    EBIT_SET(e->flag, ENTRY_CACHABLE);
-    EBIT_CLR(e->flag, RELEASE_REQUEST);
-    EBIT_CLR(e->flag, KEY_PRIVATE);
+    e->flags = flags;
+    e->flags.entry_cachable = 1;
+    e->flags.release_request = 0;
+    e->flags.key_private = 0;
     e->ping_status = PING_NONE;
-    EBIT_CLR(e->flag, ENTRY_VALIDATED);
+    e->flags.entry_validated = 0;
     storeDirMapBitSet(e->swap_file_number);
     storeHashInsert(e, key);   /* do it after we clear KEY_PRIVATE */
     return e;
@@ -596,7 +600,7 @@ storeCleanup(void *datanotused)
     while (NULL != (link_ptr = link_next)) {
        link_next = link_ptr->next;
        e = (StoreEntry *) link_ptr;
-       if (EBIT_TEST(e->flag, ENTRY_VALIDATED))
+       if (e->flags.entry_validated)
            continue;
        /*
         * Calling storeRelease() has no effect because we're
@@ -627,7 +631,7 @@ storeCleanup(void *datanotused)
                continue;
            }
        }
-       EBIT_SET(e->flag, ENTRY_VALIDATED);
+       e->flags.entry_validated = 1;
        /* 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);
@@ -646,9 +650,9 @@ storeValidate(StoreEntry * e, STVLDCB * callback, void *callback_data, void *tag
 #if !USE_ASYNC_IO
     int x;
 #endif
-    assert(!EBIT_TEST(e->flag, ENTRY_VALIDATED));
+    assert(!e->flags.entry_validated);
     if (e->swap_file_number < 0) {
-       EBIT_CLR(e->flag, ENTRY_VALIDATED);
+       e->flags.entry_validated = 0;
        callback(callback_data, 0, 0);
        return;
     }
@@ -692,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) {
-       EBIT_CLR(e->flag, ENTRY_VALIDATED);
+       e->flags.entry_validated = 0;
     } else {
-       EBIT_SET(e->flag, ENTRY_VALIDATED);
+       e->flags.entry_validated = 1;
        storeDirUpdateSwapSize(e->swap_file_number, e->swap_file_sz, 1);
     }
     errno = errcode;
index cadfe677c6545d0a77a01e4e2d375cf83c10607d..d3748d1cde22c09228969f1888e151ff7f6cc907 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapin.cc,v 1.12 1998/08/10 19:37:50 wessels Exp $
+ * $Id: store_swapin.cc,v 1.13 1998/09/14 21:28: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 (!EBIT_TEST(e->flag, ENTRY_VALIDATED)) {
+    if (!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 (EBIT_TEST(e->flag, ENTRY_VALIDATED))
+    if (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 (!EBIT_TEST(e->flag, ENTRY_VALIDATED)) {
+    if (!e->flags.entry_validated) {
        /* Invoke a store abort that should free the memory object */
        (ctrlp->callback) (-1, ctrlp->callback_data);
        xfree(ctrlp);
index 27dd27b1117089efc75c3f7b58037a8af5e27549..2e20f02be6399b5813bed24caaf2cffaa1427d31 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapout.cc,v 1.30 1998/09/10 19:50:58 wessels Exp $
+ * $Id: store_swapout.cc,v 1.31 1998/09/14 21:28: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(EBIT_TEST(e->flag, RELEASE_REQUEST));
+       assert(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(EBIT_TEST(e->flag, RELEASE_REQUEST));
+       assert(e->flags.release_request);
        storeSwapOutFileClose(e);
        return;
     }
@@ -376,5 +376,5 @@ storeSwapOutAble(const StoreEntry * e)
     if (e->mem_obj->inmem_lo > 0)
        return 0;
     /* swapout.fd == -1 && inmem_lo == 0 */
-    return EBIT_TEST(e->flag, ENTRY_CACHABLE);
+    return e->flags.entry_cachable;
 }
index 95db79c995422716016e3006ff50727d97e8a568..34071bba3793c112656a3cce87b468707cf31f96 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.220 1998/09/11 17:07:50 wessels Exp $
+ * $Id: structs.h,v 1.221 1998/09/14 21:28:17 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -1172,6 +1172,31 @@ 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!
+     */
+    int entry_special:1;
+    int entry_revalidate:1;
+    int delay_sending:1;
+    int release_request:1;
+    int refresh_request:1;
+    int entry_cachable:1;
+    int entry_dispatched:1;
+    int key_private:1;
+#ifndef PPNR_WIP
+    int entry_unused_08:1;
+#else
+    int entry_fwd_hdr_wait:1;
+#endif                         /* PPNR_WIP */
+    int entry_negcached:1;
+    int entry_validated:1;
+    int entry_bad_length:1;
+};
+
 struct _StoreEntry {
     /* first two items must be same as hash_link */
     const cache_key *key;
@@ -1183,7 +1208,7 @@ struct _StoreEntry {
     time_t lastmod;
     size_t swap_file_sz;
     u_short refcount;
-    u_short flag;
+    store_flags flags;
     int swap_file_number;
     dlink_node lru;
     u_short lock_count;                /* Assume < 65536! */
@@ -1459,7 +1484,7 @@ struct _storeSwapLogData {
     time_t lastmod;
     size_t swap_file_sz;
     u_short refcount;
-    u_short flags;
+    store_flags flags;
     unsigned char key[MD5_DIGEST_CHARS];
 };
 
index f055992920592bcc4e2c32ff3810f2653cb0bfb5..e03bc95269436cac179d75be78b5acdabef810e8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: typedefs.h,v 1.73 1998/08/27 06:28:59 wessels Exp $
+ * $Id: typedefs.h,v 1.74 1998/09/14 21:28:18 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -131,6 +131,7 @@ 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 _request_t request_t;
 typedef struct _AccessLogEntry AccessLogEntry;
 typedef struct _cachemgr_passwd cachemgr_passwd;
index 26ec83761836dcb47fb89d6425886cf2ba433e72..0a42a2881ca3fadd69fe298265505d46f281c6b7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.118 1998/09/04 23:05:06 wessels Exp $
+ * $Id: wais.cc,v 1.119 1998/09/14 21:28: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;
-           EBIT_CLR(entry->flag, ENTRY_CACHABLE);
+           entry->flags.entry_cachable = 0;
            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 (EBIT_TEST(waisState->entry->flag, ENTRY_CACHABLE))
+    if (waisState->entry->flags.entry_cachable)
        storeSetPublicKey(waisState->entry);    /* Make it public */
 }