From: robertc <> Date: Sat, 6 Sep 2003 18:47:34 +0000 (+0000) Subject: Summary: Allow -DPURIFY to build. X-Git-Tag: SQUID_3_0_PRE4~1219 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4a67a801853cb8b1837e224dec8cd135442b7e9;p=thirdparty%2Fsquid.git Summary: Allow -DPURIFY to build. Keywords: Allow -DPURIFY to build. --- diff --git a/src/DelayId.cc b/src/DelayId.cc index 81369453c0..6f7464471f 100644 --- a/src/DelayId.cc +++ b/src/DelayId.cc @@ -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 @@ -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); diff --git a/src/client_side.cc b/src/client_side.cc index 5724f4c6eb..f972b1c871 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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(node->data.getRaw()); /* this is the assert discussed above */ - assert(context == NULL); + assert(NULL == dynamic_cast(node->data.getRaw())); /* We are only called when the client socket shutsdown. * Tell the prev pipeline member we're finished */ diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 565496a66e..26f77ce12a 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -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; diff --git a/src/comm.cc b/src/comm.cc index 08cf8c7ade..8e5096adfd 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -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); } diff --git a/src/errorpage.cc b/src/errorpage.cc index 6a4ee48883..46d5a33538 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -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) { diff --git a/src/fs/diskd/store_io_diskd.cc b/src/fs/diskd/store_io_diskd.cc index a4e6148119..810de5c864 100644 --- a/src/fs/diskd/store_io_diskd.cc +++ b/src/fs/diskd/store_io_diskd.cc @@ -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"); } /* diff --git a/src/peer_digest.cc b/src/peer_digest.cc index af69eccbc3..ca9bc14997 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -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 */ diff --git a/src/repl/heap/store_repl_heap.cc b/src/repl/heap/store_repl_heap.cc index 72e114b4cc..8af580b0f7 100644 --- a/src/repl/heap/store_repl_heap.cc +++ b/src/repl/heap/store_repl_heap.cc @@ -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); } diff --git a/src/repl/lru/store_repl_lru.cc b/src/repl/lru/store_repl_lru.cc index 751bc355ab..38b276ff04 100644 --- a/src/repl/lru/store_repl_lru.cc +++ b/src/repl/lru/store_repl_lru.cc @@ -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); } diff --git a/src/stmem.cc b/src/stmem.cc index 5a0713fe68..3998a2b2f8 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -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);