]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Allow -DPURIFY to build.
authorrobertc <>
Sat, 6 Sep 2003 18:47:34 +0000 (18:47 +0000)
committerrobertc <>
Sat, 6 Sep 2003 18:47:34 +0000 (18:47 +0000)
Keywords:

Allow -DPURIFY to build.

src/DelayId.cc
src/client_side.cc
src/client_side_request.cc
src/comm.cc
src/errorpage.cc
src/fs/diskd/store_io_diskd.cc
src/peer_digest.cc
src/repl/heap/store_repl_heap.cc
src/repl/lru/store_repl_lru.cc
src/stmem.cc

index 81369453c0bbe1b42f1008fe47ce25ddeccd4fec..6f7464471f73742dc72f750f7e4721689fa5b5d1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: DelayId.cc,v 1.13 2003/08/10 11:00:40 robertc Exp $
+ * $Id: DelayId.cc,v 1.14 2003/09/06 12:47:34 robertc Exp $
  *
  * DEBUG: section 77    Delay Pools
  * AUTHOR: Robert Collins <robertc@squid-cache.org>
@@ -171,9 +171,7 @@ DelayId::bytesIn(int qty)
     if (markedAsNoDelay)
         return;
 
-    unsigned short tempPool = pool() - 1;
-
-    assert (tempPool != 0xFFFF);
+    assert ((unsigned short)(pool() - 1) != 0xFFFF);
 
     if (compositeId.getRaw())
         compositeId->bytesIn(qty);
index 5724f4c6eb43caf916765e279c3db80962287a4f..f972b1c871f863f617ccddb50839cdaeca695a83 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.658 2003/09/01 03:49:38 robertc Exp $
+ * $Id: client_side.cc,v 1.659 2003/09/06 12:47:34 robertc Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -142,7 +142,9 @@ static void clientUpdateStatCounters(log_type logType);
 static void clientUpdateHierCounters(HierarchyLogEntry *);
 static bool clientPingHasFinished(ping_data const *aPing);
 static void clientPrepareLogWithRequestDetails(HttpRequest *, AccessLogEntry *);
+#ifndef PURIFY
 static int connIsUsable(ConnStateData::Pointer conn);
+#endif
 static int responseFinishedOrFailed(HttpReply * rep, StoreIOBuffer const &recievedData);
 static void ClientSocketContextPushDeferredIfNeeded(ClientSocketContext::Pointer deferredRequest, ConnStateData::Pointer & conn);
 static void clientUpdateSocketStats(log_type logType, size_t size);
@@ -692,6 +694,7 @@ clientIsRequestBodyTooLargeForPolicy(size_t bodyLength)
     return 0;
 }
 
+#ifndef PURIFY
 int
 connIsUsable(ConnStateData::Pointer conn)
 {
@@ -701,6 +704,8 @@ connIsUsable(ConnStateData::Pointer conn)
     return 1;
 }
 
+#endif
+
 ClientSocketContext::Pointer
 ConnStateData::getCurrentContext() const
 {
@@ -1243,9 +1248,8 @@ clientSocketDetach(clientStreamNode * node, clientHttpRequest * http)
     assert(cbdataReferenceValid(node));
     /* Set null by ContextFree */
     assert(node->node.next == NULL);
-    ClientSocketContext *context = dynamic_cast<ClientSocketContext *>(node->data.getRaw());
     /* this is the assert discussed above */
-    assert(context == NULL);
+    assert(NULL == dynamic_cast<ClientSocketContext *>(node->data.getRaw()));
     /* We are only called when the client socket shutsdown.
      * Tell the prev pipeline member we're finished
      */
index 565496a66e9b727c28bdd24c69eb46e38dcbaf1b..26f77ce12a7762c333285628ccc997665e55201d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_request.cc,v 1.33 2003/09/01 03:49:38 robertc Exp $
+ * $Id: client_side_request.cc,v 1.34 2003/09/06 12:47:34 robertc Exp $
  * 
  * DEBUG: section 85    Client-side Request Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -800,7 +800,11 @@ void
 ClientRequestContext::CheckNoCacheDone(int answer, void *data)
 {
     void *temp;
-    bool valid = cbdataReferenceValidDone(data, &temp);
+#ifndef PURIFY
+
+    bool valid =
+#endif
+        cbdataReferenceValidDone(data, &temp);
     /* acl NB calls cannot invalidate cbdata in the normal course of things */
     assert (valid);
     ClientRequestContext *context = (ClientRequestContext *)temp;
index 08cf8c7adeb5a173a4a9ed843a22255c5d79b0ce..8e5096adfdbc9c5c1e640c530293d31f038eb57d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.388 2003/08/31 01:22:05 robertc Exp $
+ * $Id: comm.cc,v 1.389 2003/09/06 12:47:34 robertc Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -713,9 +713,7 @@ comm_fill_read(int fd, char *buf, size_t len, comm_err_t flag, int xerrno, void
 
     fill->amountDone += len;
 
-    StoreIOBuffer *sb = &fdc_table[fd].fill.requestedData;
-
-    assert(fill->amountDone <= sb->length);
+    assert(fill->amountDone <= fdc_table[fd].fill.requestedData.length);
 
     comm_add_fill_callback(fd, fill->amountDone, COMM_OK, 0);
 }
index 6a4ee48883ae83a178ba1493144d08a138a6062f..46d5a33538cc44c743b32b4e807683134f3e7a37 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.191 2003/09/01 03:49:38 robertc Exp $
+ * $Id: errorpage.cc,v 1.192 2003/09/06 12:47:35 robertc Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -344,8 +344,7 @@ void
 errorAppendEntry(StoreEntry * entry, ErrorState * err)
 {
     HttpReply *rep;
-    MemObject *mem = entry->mem_obj;
-    assert(mem != NULL);
+    assert(entry->mem_obj != NULL);
     assert (entry->isEmpty());
 
     if (entry->store_status != STORE_PENDING) {
index a4e6148119fca107066e772012e17b14b27f56c6..810de5c8648d2af95056448b0e2b0f330b873ae8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_diskd.cc,v 1.38 2003/08/23 12:33:04 robertc Exp $
+ * $Id: store_io_diskd.cc,v 1.39 2003/09/06 12:47:36 robertc Exp $
  *
  * DEBUG: section 79    Squid-side DISKD I/O functions.
  * AUTHOR: Duane Wessels
@@ -334,8 +334,7 @@ DiskdFile::read(char *buf, off_t offset, size_t size)
 {
     assert (ioRequestor.getRaw() != NULL);
     off_t shm_offset;
-    char *rbuf = (char *)IO->shm.get(&shm_offset);
-    assert(rbuf);
+    IO->shm.get(&shm_offset);
     ioAway();
     int x = storeDiskdSend(_MQD_READ,
                            IO,
@@ -691,7 +690,10 @@ storeDiskdSend(int mtype, DiskdIO *IO, int id, DiskdFile *theFile, int size, int
     } else {
         debug(79, 1) ("storeDiskdSend: msgsnd: %s\n", xstrerror());
         cbdataReferenceDone(M.callback_data);
-        assert(++send_errors < 100);
+
+        if (++send_errors > 100)
+            fatal ("over 100 errors sending to the daemon - aborting\n");
+
         IO->shm.put (shm_offset);
     }
 
@@ -751,7 +753,9 @@ storeDiskdSend(int mtype, DiskdIO *IO, int id, StoreIOState::Pointer sio, int si
     } else {
         debug(79, 1) ("storeDiskdSend: msgsnd: %s\n", xstrerror());
         cbdataReferenceDone(M.callback_data);
-        assert(++send_errors < 100);
+
+        if (++send_errors > 100)
+            fatal ("over 100 errors sending to the daemon - aborting\n");
     }
 
     /*
index af69eccbc32cff53a85929448035a38087b90188..ca9bc1499709336ffc603a44dd18b0a75c088755 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_digest.cc,v 1.99 2003/08/10 11:00:44 robertc Exp $
+ * $Id: peer_digest.cc,v 1.100 2003/09/06 12:47:35 robertc Exp $
  *
  * DEBUG: section 72    Peer Digest Routines
  * AUTHOR: Alex Rousskov
@@ -400,12 +400,11 @@ static void
 peerDigestHandleReply(void *data, StoreIOBuffer recievedData)
 {
     DigestFetchState *fetch = (DigestFetchState *)data;
-    PeerDigest *pd = fetch->pd;
     int retsize = -1;
     digest_read_state_t prevstate;
     int newsize;
 
-    assert(pd && recievedData.data);
+    assert(fetch->pd && recievedData.data);
     /* The existing code assumes that the recieved pointer is
      * where we asked the data to be put
      */
@@ -649,9 +648,8 @@ peerDigestSwapInCBlock(void *data, char *buf, ssize_t size)
 
     if (size >= (ssize_t)StoreDigestCBlockSize) {
         PeerDigest *pd = fetch->pd;
-        HttpReply const *rep = fetch->entry->getReply();
 
-        assert(pd && rep);
+        assert(pd && fetch->entry->getReply());
 
         if (peerDigestSetCBlock(pd, buf)) {
             /* XXX: soon we will have variable header size */
index 72e114b4ccb72f02df691ef2aa763991540d5835..8af580b0f7c0c5306dcca3902c62deb9b4c680d3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_repl_heap.cc,v 1.13 2003/02/21 22:50:50 robertc Exp $
+ * $Id: store_repl_heap.cc,v 1.14 2003/09/06 12:47:36 robertc Exp $
  *
  * DEBUG: section ?     HEAP based removal policies
  * AUTHOR: Henrik Nordstrom
@@ -298,7 +298,7 @@ heap_free(RemovalPolicy * policy)
     assert(heap->nwalkers);
     assert(heap->count);
     /* Ok, time to destroy this policy */
-    safe_free(policy->_data);
+    safe_free(heap);
     memset(policy, 0, sizeof(*policy));
     cbdataFree(policy);
 }
index 751bc355abbf0c3a3feac9f96ef046273e2f04c4..38b276ff0485b684169d0bff063e62eee398e891 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_repl_lru.cc,v 1.14 2003/02/21 22:50:50 robertc Exp $
+ * $Id: store_repl_lru.cc,v 1.15 2003/09/06 12:47:39 robertc Exp $
  *
  * DEBUG: section ?     LRU Removal policy
  * AUTHOR: Henrik Nordstrom
@@ -317,7 +317,7 @@ lru_free(RemovalPolicy * policy)
     assert(lru->nwalkers);
     assert(lru->count);
     /* Ok, time to destroy this policy */
-    safe_free(policy->_data);
+    safe_free(lru);
     memset(policy, 0, sizeof(*policy));
     cbdataFree(policy);
 }
index 5a0713fe68d050a271cfdec886f141ae30bae0a1..3998a2b2f8eeb78fb8fe3c9b46f105007e412a72 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stmem.cc,v 1.80 2003/08/04 22:14:42 robertc Exp $
+ * $Id: stmem.cc,v 1.81 2003/09/06 12:47:35 robertc Exp $
  *
  * DEBUG: section 19    Store Memory Primitives
  * AUTHOR: Harvest Derived
@@ -112,8 +112,7 @@ mem_hdr::writeAvailable(mem_node *aNode, size_t location, size_t amount, char co
     assert (aNode->canAccept (location));
 
     /* these two can go I think */
-    size_t copyOffset = location - aNode->nodeBuffer.offset;
-    assert (copyOffset == aNode->nodeBuffer.length);
+    assert (location - aNode->nodeBuffer.offset == aNode->nodeBuffer.length);
     size_t copyLen = XMIN (amount, aNode->space());
 
     xmemcpy(aNode->nodeBuffer.data + aNode->nodeBuffer.length, source, copyLen);