/*
- * $Id: Array.h,v 1.16 2003/09/22 08:50:51 robertc Exp $
+ * $Id: Array.h,v 1.17 2004/11/07 23:29:50 hno Exp $
*
* AUTHOR: Alex Rousskov
*
#ifndef SQUID_ARRAY_H
#define SQUID_ARRAY_H
+#include "fatal.h"
+#include "util.h"
+
/* iterator support */
template <class C>
}
template<class E>
-Vector<E>::Vector<E> (Vector const &rhs)
+Vector<E>::Vector<E> (Vector<E> const &rhs)
{
items = NULL;
capacity = 0;
template<class E>
Vector<E> &
-Vector<E>::operator = (Vector const &old)
+Vector<E>::operator = (Vector<E> const &old)
{
clean();
reserve (old.size());
VectorIteratorBase<C>::VectorIteratorBase(size_t aPos, C &container) : pos(aPos), theVector(&container) {}
template<class C>
-bool VectorIteratorBase<C>:: operator != (VectorIteratorBase const &rhs)
+bool VectorIteratorBase<C>:: operator != (VectorIteratorBase<C> const &rhs)
{
assert (theVector);
return pos != rhs.pos;
}
template<class C>
-bool VectorIteratorBase<C>:: operator == (VectorIteratorBase const &rhs)
+bool VectorIteratorBase<C>:: operator == (VectorIteratorBase<C> const &rhs)
{
assert (theVector);
return pos == rhs.pos;
template<class C>
VectorIteratorBase<C>&
-VectorIteratorBase<C>::operator =(VectorIteratorBase const &old)
+VectorIteratorBase<C>::operator =(VectorIteratorBase<C> const &old)
{
pos = old.pos;
theVector = old.theVector;
template<class C>
ssize_t
-VectorIteratorBase<C>::operator - (VectorIteratorBase const &rhs) const
+VectorIteratorBase<C>::operator - (VectorIteratorBase<C> const &rhs) const
{
assert(theVector == rhs.theVector);
return pos - rhs.pos;
/*
- * $Id: Stack.h,v 1.15 2003/07/14 10:36:41 robertc Exp $
+ * $Id: Stack.h,v 1.16 2004/11/07 23:29:50 hno Exp $
*
* AUTHOR: Alex Rousskov
*
class Stack : public Vector<S>
{
-
public:
+ using Vector<S>::count;
+ using Vector<S>::items;
typedef typename Vector<S>::value_type value_type;
typedef typename Vector<S>::pointer pointer;
value_type pop()
if (!count)
return value_type();
- value_type result = items[--count];
+ value_type result = items[count];
- items[count] = value_type();
+ this->items[count] = value_type();
return result;
}
--- /dev/null
+#ifndef SQUID_FATAL_H
+#define SQUID_FATAL_H
+
+#include "config.h"
+
+SQUIDCEXTERN void fatal(const char *message);
+#if STDC_HEADERS
+SQUIDCEXTERN void
+fatalf(const char *fmt,...) PRINTF_FORMAT_ARG1;
+#else
+SQUIDCEXTERN void fatalf();
+#endif
+SQUIDCEXTERN void fatal_dump(const char *message);
+
+#endif
/*
- * $Id: ACLBrowser.cc,v 1.2 2003/10/20 12:33:01 robertc Exp $
+ * $Id: ACLBrowser.cc,v 1.3 2004/11/07 23:29:50 hno Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
*/
#include "squid.h"
-#include "ACLBrowser.h"
#include "ACLChecklist.h"
+#include "ACLBrowser.h"
#include "ACLRegexData.h"
/* explicit template instantiation required for some systems */
/*
- * $Id: ACLChecklist.cc,v 1.18 2004/10/18 12:12:54 hno Exp $
+ * $Id: ACLChecklist.cc,v 1.19 2004/11/07 23:29:50 hno Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
ACLChecklist *result = cbdataAlloc(ACLChecklist);
/* Mark result as being owned - we want the refcounter to do the delete
* call */
- cbdataReference(result);
- return result;
+ return cbdataReference(result);
}
void
/*
- * $Id: ACLDomainData.cc,v 1.6 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLDomainData.cc,v 1.7 2004/11/07 23:29:50 hno Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
/* general compare functions, these are used for tree search algorithms
* so they return <0, 0 or >0 */
+/* compare a host and a domain */
+
+static int
+aclHostDomainCompare( char *const &a, char * const &b)
+{
+ const char *h = (const char *)a;
+ const char *d = (const char *)b;
+ return matchDomainName(h, d);
+}
+
+
/* compare two domains */
template<class T>
return ret;
}
-/* compare a host and a domain */
-
-static int
-aclHostDomainCompare( char *const &a, char * const &b)
-{
- const char *h = (const char *)a;
- const char *d = (const char *)b;
- return matchDomainName(h, d);
-}
-
-
bool
ACLDomainData::match(char const *host)
{
/*
- * $Id: ACLReplyHeaderStrategy.h,v 1.5 2004/10/20 22:37:56 hno Exp $
+ * $Id: ACLReplyHeaderStrategy.h,v 1.6 2004/11/07 23:29:50 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
#include "ACL.h"
#include "ACLData.h"
#include "ACLStrategy.h"
+#include "ACLChecklist.h"
+#include "HttpReply.h"
template <http_hdr_type header>
/*
- * $Id: ACLRequestHeaderStrategy.h,v 1.7 2003/08/10 09:53:49 robertc Exp $
+ * $Id: ACLRequestHeaderStrategy.h,v 1.8 2004/11/07 23:29:50 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
#include "ACLData.h"
#include "ACLStrategy.h"
#include "HttpRequest.h"
+#include "ACLChecklist.h"
template <http_hdr_type header>
/*
- * $Id: clientStream.cc,v 1.8 2003/04/06 08:23:10 robertc Exp $
+ * $Id: clientStream.cc,v 1.9 2004/11/07 23:29:50 hno Exp $
*
* DEBUG: section 87 Client-side Stream routines.
* AUTHOR: Robert Collins
{
clientStreamNode *temp = clientStreamNew(func, NULL, rdetach, readstatus,
readdata);
- dlinkAdd(temp, &temp->node, list);
- cbdataReference(temp);
+ dlinkAdd(cbdataReference(temp), &temp->node, list);
temp->head = list;
clientStreamInsertHead(list, NULL, callback, cdetach, NULL, callbackdata);
temp = (clientStreamNode *)list->tail->data;
if (list->head->next)
temp->readBuffer = ((clientStreamNode *)list->head->next->data)->readBuffer;
- dlinkAddAfter(temp, &temp->node, list->head, list);
-
- cbdataReference(temp);
+ dlinkAddAfter(cbdataReference(temp), &temp->node, list->head, list);
}
/*
/*
- * $Id: client_side_request.cc,v 1.39 2004/10/20 22:48:52 hno Exp $
+ * $Id: client_side_request.cc,v 1.40 2004/11/07 23:29:50 hno Exp $
*
* DEBUG: section 85 Client-side Request Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
ClientRequestContext *result = cbdataAlloc(ClientRequestContext);
/* Mark result as being owned - we want the refcounter to do the delete
* call */
- cbdataReference(result);
- return result;
+ return cbdataReference(result);
}
void
ClientHttpRequest *result = cbdataAlloc(ClientHttpRequest);
/* Mark result as being owned - we want the refcounter to do the delete
* call */
- cbdataReference(result);
- return result;
+ return cbdataReference(result);
}
void
AUFSFile *result = cbdataAlloc(AUFSFile);
/* Mark result as being owned - we want the refcounter to do the delete
* call */
- cbdataReference(result);
- return result;
+ return cbdataReference(result);
}
void
/*
- * $Id: store_io_diskd.cc,v 1.39 2003/09/06 12:47:36 robertc Exp $
+ * $Id: store_io_diskd.cc,v 1.40 2004/11/07 23:29:51 hno Exp $
*
* DEBUG: section 79 Squid-side DISKD I/O functions.
* AUTHOR: Duane Wessels
{
CBDATA_INIT_TYPE(DiskdFile);
DiskdFile *result = cbdataAlloc(DiskdFile);
+ debug (79,3)("diskdFile with base %p allocating\n", result);
/* Mark result as being owned - we want the refcounter to do the delete
* call */
- cbdataReference(result);
- debug (79,3)("diskdFile with base %p allocating\n", result);
- return result;
+ return cbdataReference(result);
}
void
/*
- * $Id: StoreFSufs.h,v 1.1 2003/07/22 15:23:14 robertc Exp $
+ * $Id: StoreFSufs.h,v 1.2 2004/11/07 23:29:51 hno Exp $
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
* ----------------------------------------------------------
#include "squid.h"
-class IOModule;
+#include "fs/ufs/IOModule.h"
template <class TheSwapDir>
/*
- * $Id: store_io_ufs.cc,v 1.25 2004/11/07 14:03:18 hno Exp $
+ * $Id: store_io_ufs.cc,v 1.26 2004/11/07 23:29:51 hno Exp $
*
* DEBUG: section 79 Storage Manager UFS Interface
* AUTHOR: Duane Wessels
UFSFile *result = cbdataAlloc(UFSFile);
/* Mark result as being owned - we want the refcounter to do the delete
* call */
- cbdataReference(result);
- return result;
+ return cbdataReference(result);
}
void
/*
- * $Id: squid.h,v 1.238 2004/10/20 22:41:05 hno Exp $
+ * $Id: squid.h,v 1.239 2004/11/07 23:29:50 hno Exp $
*
* AUTHOR: Duane Wessels
*
#else
#define assert(EX) ((EX)?((void)0):xassert("EX", __FILE__, __LINE__))
#endif
+extern void xassert(const char *, const char *, int);
#if HAVE_UNISTD_H
#include <unistd.h>
/*
- * $Id: store_client.cc,v 1.135 2004/08/30 05:12:31 robertc Exp $
+ * $Id: store_client.cc,v 1.136 2004/11/07 23:29:50 hno Exp $
*
* DEBUG: section 90 Storage Manager Client-Side Interface
* AUTHOR: Duane Wessels
* everything we got before the abort condition occurred.
*/
/* Warning: doCopy may indirectly free itself in callbacks,
- * hence the cbdata reference to keep it active for the duration of
+ * hence the lock to keep it active for the duration of
* this function
*/
- cbdataReference(sc);
+ cbdataInternalLock(sc);
assert (sc->flags.store_copying == 0);
sc->doCopy(e);
assert (sc->flags.store_copying == 0);
- cbdataReferenceDone(sc);
+ cbdataInternalUnlock(sc);
}
void
/*
- * $Id: structs.h,v 1.494 2004/11/06 22:20:48 hno Exp $
+ * $Id: structs.h,v 1.495 2004/11/07 23:29:50 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
/* bah. remove this when HttpHeaderEntry is moved
* out
*/
-extern void xassert(const char *, const char *, int);
MEMPROXY_CLASS_INLINE(HttpHeaderEntry)
/* http surogate control header field */
/*
- * $Id: ufscommon.cc,v 1.11 2003/08/04 22:14:42 robertc Exp $
+ * $Id: ufscommon.cc,v 1.12 2004/11/07 23:29:50 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Robert Collins
RebuildState *result = cbdataAlloc(RebuildState);
/* Mark result as being owned - we want the refcounter to do the delete
* call */
- cbdataReference(result);
- return result;
+ return cbdataReference(result);
}
void