/*
- * $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>
if (markedAsNoDelay)
return;
- unsigned short tempPool = pool() - 1;
-
- assert (tempPool != 0xFFFF);
+ assert ((unsigned short)(pool() - 1) != 0xFFFF);
if (compositeId.getRaw())
compositeId->bytesIn(qty);
/*
- * $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
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);
return 0;
}
+#ifndef PURIFY
int
connIsUsable(ConnStateData::Pointer conn)
{
return 1;
}
+#endif
+
ClientSocketContext::Pointer
ConnStateData::getCurrentContext() const
{
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
*/
/*
- * $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)
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;
/*
- * $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
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);
}
/*
- * $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
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) {
/*
- * $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
{
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,
} 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);
}
} 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");
}
/*
/*
- * $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
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
*/
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 */
/*
- * $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
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);
}
/*
- * $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
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);
}
/*
- * $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
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);