Revision: 14770
Author: adrian.chadd
Date: Tue Aug 31 09:02:21 2010
Log: Merge r14744:14769 from /branches/LUSCA_HEAD


http://code.google.com/p/lusca-cache/source/detail?r=14770

Added:
 /playpen/LUSCA_HEAD_ipv6/helpers/external_acl/regex
 /playpen/LUSCA_HEAD_ipv6/test-suite/Makefile.am
 /playpen/LUSCA_HEAD_ipv6/test-suite/Makefile.lcl
 /playpen/LUSCA_HEAD_ipv6/test-suite/atf/Makefile.am
Deleted:
 /playpen/LUSCA_HEAD_ipv6/test-suite/Makefile
 /playpen/LUSCA_HEAD_ipv6/test-suite/atf/Makefile
 /playpen/LUSCA_HEAD_ipv6/test-suite/atf/Makefile.inc
Modified:
 /playpen/LUSCA_HEAD_ipv6
 /playpen/LUSCA_HEAD_ipv6/Makefile.am
 /playpen/LUSCA_HEAD_ipv6/configure.in
 /playpen/LUSCA_HEAD_ipv6/include/Vector.h
 /playpen/LUSCA_HEAD_ipv6/libcb/cbdata.c
 /playpen/LUSCA_HEAD_ipv6/libcb/cbdata.h
 /playpen/LUSCA_HEAD_ipv6/libiapp/comm_kqueue.c
 /playpen/LUSCA_HEAD_ipv6/src/access_log.c
 /playpen/LUSCA_HEAD_ipv6/src/cbdata.c
 /playpen/LUSCA_HEAD_ipv6/src/cf.data.pre
 /playpen/LUSCA_HEAD_ipv6/src/client_side.c
 /playpen/LUSCA_HEAD_ipv6/src/client_side_body.c
 /playpen/LUSCA_HEAD_ipv6/src/client_side_conn.c
 /playpen/LUSCA_HEAD_ipv6/src/client_side_location_rewrite.c
 /playpen/LUSCA_HEAD_ipv6/src/errorpage.c
 /playpen/LUSCA_HEAD_ipv6/src/store.c
 /playpen/LUSCA_HEAD_ipv6/src/store_vary.c
 /playpen/LUSCA_HEAD_ipv6/src/structs.h
 /playpen/LUSCA_HEAD_ipv6/src/urn.c
Replaced:
 /playpen/LUSCA_HEAD_ipv6/helpers/external_acl/regex/regex.c

=======================================
--- /dev/null
+++ /playpen/LUSCA_HEAD_ipv6/test-suite/Makefile.am     Tue Aug 31 09:02:21 2010
@@ -0,0 +1,8 @@
+
+if ENABLE_ATF
+ATFDIR=        atf/
+else
+ATFDIR=
+endif
+
+SUBDIRS=       $(ATFDIR)
=======================================
--- /dev/null
+++ /playpen/LUSCA_HEAD_ipv6/test-suite/Makefile.lcl Tue Aug 31 09:02:21 2010
@@ -0,0 +1,29 @@
+CC     = gcc
+CFLAGS = -g -Wall -I../include -I../src
+OBJS   = membanger.o hash.o SizeToPool.o
+LIB    = -L. -lMem
+TARGLIB = libMem.a
+LIBOBJS = Mem.o \
+          Stack.o
+AR_R      = /usr/bin/ar r
+RM      = rm
+XTRA_LIBS = -lm  -lmalloc
+
+all:  membanger
+
+membanger: $(OBJS) $(TARGLIB)
+       $(CC) -o membanger $(OBJS) $(LIB)
+
+tcp-banger2: tcp-banger2.o
+       $(CC) -g -o $@ tcp-banger2.o
+
+tcp-banger2.o: tcp-banger2.c
+       $(CC) -c $(CFLAGS) tcp-banger2.c
+
+$(OBJS): Makefile
+
+$(TARGLIB): $(LIBOBJS)
+       $(AR_R) $(TARGLIB) $(LIBOBJS)
+
+clean:
+       rm $(OBJS) $(TARGLIB) $(LIBOBJS)
=======================================
--- /dev/null
+++ /playpen/LUSCA_HEAD_ipv6/test-suite/atf/Makefile.am Tue Aug 31 09:02:21 2010
@@ -0,0 +1,64 @@
+
+ATF_LIBDIR=$(ATF_PREFIX)/lib
+ATF_BINDIR=$(ATF_PREFIX)/bin
+ATF_INCLUDEDIR=$(ATF_PREFIX)/include
+
+INCLUDES=-I$(top_builddir) -I$(ATF_INCLUDEDIR)
+LDADD=-L$(top_builddir)/libcore \
+       -L$(top_builddir)/lib \
+       -L$(top_builddir)/libcore \
+       -L$(top_builddir)/libsqdebug \
+       -L$(top_builddir)/libmem \
+       -L$(top_builddir)/libcb \
+       -L$(top_builddir)/libmime \
+       -L$(top_builddir)/libhelper \
+       -L$(top_builddir)/libstmem \
+       -L$(top_builddir)/libiapp \
+       -L$(top_builddir)/libhttp \
+       -L$(top_builddir)/libsqurl \
+       -L$(top_builddir)/libstat \
+       -L$(top_builddir)/libsqdns \
+       -L$(top_builddir)/libsqident \
+       -L$(top_builddir)/libsqinet \
+       -L$(top_builddir)/libsqname \
+       -L$(top_builddir)/libasyncio \
+       -L$(top_builddir)/libsqtlv \
+       -L$(top_builddir)/libsqstore \
+       -L$(ATF_LIBDIR) \
+       -lsqstore \
+       -lsqtlv \
+       -lasyncio \
+       -lstmem \
+       -lsqdns \
+       -lsqident \
+       -lsqinet \
+       -lsqdebug \
+       -lsqname \
+       -lcb \
+       -lhelper \
+       -lmime \
+       -liapp \
+       -lhttp \
+       -lsqurl \
+       -lmem \
+       -lcore \
+       -lstat \
+       -lmiscutil \
+       -lpthread -lm \
+       -latf-c
+
+check_PROGRAMS=        libhttp lib_Vector libsqurl url_benchmark
+
+libhttp_SOURCES= libhttp.c core.c
+lib_Vector_SOURCES= lib_Vector.c core.c
+libsqurl_SOURCES= libsqurl.c core.c
+url_benchmark_SOURCES= url_benchmark.c core.c
+
+check-local: check-atf
+
+check-atf:
+ env PATH=$$PATH:$(ATF_BINDIR) $(ATF_BINDIR)/atf-run | $(ATF_BINDIR)/atf-report
+
+#check: libhttp lib_Vector libsqurl
+# @env PATH=$$PATH:$(ATF_BINDIR) $(ATF_BINDIR)/atf-run | $(ATF_BINDIR)/atf-report
+
=======================================
--- /playpen/LUSCA_HEAD_ipv6/test-suite/Makefile        Thu Aug 20 12:53:32 1998
+++ /dev/null
@@ -1,29 +0,0 @@
-CC     = gcc
-CFLAGS = -g -Wall -I../include -I../src
-OBJS   = membanger.o hash.o SizeToPool.o
-LIB    = -L. -lMem
-TARGLIB = libMem.a
-LIBOBJS = Mem.o \
-          Stack.o
-AR_R      = /usr/bin/ar r
-RM      = rm
-XTRA_LIBS = -lm  -lmalloc
-
-all:  membanger
-
-membanger: $(OBJS) $(TARGLIB)
-       $(CC) -o membanger $(OBJS) $(LIB)
-
-tcp-banger2: tcp-banger2.o
-       $(CC) -g -o $@ tcp-banger2.o
-
-tcp-banger2.o: tcp-banger2.c
-       $(CC) -c $(CFLAGS) tcp-banger2.c
-
-$(OBJS): Makefile
-
-$(TARGLIB): $(LIBOBJS)
-       $(AR_R) $(TARGLIB) $(LIBOBJS)
-
-clean:
-       rm $(OBJS) $(TARGLIB) $(LIBOBJS)
=======================================
--- /playpen/LUSCA_HEAD_ipv6/test-suite/atf/Makefile Sun Jul 4 06:56:53 2010
+++ /dev/null
@@ -1,70 +0,0 @@
-
-include ./Makefile.inc
-
-BASEDIR=../..
-
-LDADD=-L$(BASEDIR)/libcore \
-       -L$(BASEDIR)/lib \
-       -L$(BASEDIR)/libcore \
-       -L$(BASEDIR)/libsqdebug \
-       -L$(BASEDIR)/libmem \
-       -L$(BASEDIR)/libcb \
-       -L$(BASEDIR)/libmime \
-       -L$(BASEDIR)/libhelper \
-       -L$(BASEDIR)/libstmem \
-       -L$(BASEDIR)/libiapp \
-       -L$(BASEDIR)/libhttp \
-       -L$(BASEDIR)/libsqurl \
-       -L$(BASEDIR)/libstat \
-       -L$(BASEDIR)/libsqdns \
-       -L$(BASEDIR)/libsqident \
-       -L$(BASEDIR)/libsqinet \
-       -L$(BASEDIR)/libsqname \
-       -L$(BASEDIR)/libasyncio \
-       -L$(BASEDIR)/libsqtlv \
-       -L$(BASEDIR)/libsqstore \
-       -lsqstore \
-       -lsqtlv \
-       -lasyncio \
-       -lstmem \
-       -lsqdns \
-       -lsqident \
-       -lsqinet \
-       -lsqdebug \
-       -lsqname \
-       -lcb \
-       -lhelper \
-       -lmime \
-       -liapp \
-       -lhttp \
-       -lsqurl \
-       -lmem \
-       -lcore \
-       -lstat \
-       -lmiscutil \
-       -lpthread -lm \
-       -latf-c
-
-LDFLAGS=$(LDADD) -L$(ATF_LIBDIR)
-CFLAGS=-O -g -I$(BASEDIR) -I$(ATF_INCLUDEDIR)
-
-all: libhttp lib_Vector libsqurl url_benchmark
-
-libhttp: libhttp.o core.o
-       $(CC) core.o libhttp.o -o libhttp $(LDFLAGS)
-
-lib_Vector: lib_Vector.o core.o
-       $(CC) core.o lib_Vector.o -o lib_Vector $(LDFLAGS)
-
-libsqurl: libsqurl.o core.o
-       $(CC) core.o libsqurl.o -o libsqurl $(LDFLAGS)
-
-url_benchmark: url_benchmark.o core.o
-       $(CC) core.o url_benchmark.o -o url_benchmark $(LDFLAGS)
-
-check: libhttp lib_Vector libsqurl
- @env PATH=$$PATH:$(ATF_BINDIR) $(ATF_BINDIR)/atf-run | $(ATF_BINDIR)/atf-report
-
-clean:
-       rm -f libhttp lib_Vector libsqurl url_benchmark *.o
-
=======================================
--- /playpen/LUSCA_HEAD_ipv6/test-suite/atf/Makefile.inc Sun Jul 4 06:56:53 2010
+++ /dev/null
@@ -1,3 +0,0 @@
-ATF_INCLUDEDIR=/usr/local/atf-0.8/include
-ATF_LIBDIR=/usr/local/atf-0.8/lib
-ATF_BINDIR=/usr/local/atf-0.8/bin
=======================================
--- /playpen/LUSCA_HEAD_ipv6/Makefile.am        Sun Jul  4 06:56:53 2010
+++ /playpen/LUSCA_HEAD_ipv6/Makefile.am        Tue Aug 31 09:02:21 2010
@@ -4,8 +4,8 @@
 #

 AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects 1.5
-DIST_SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp libsqurl libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug libstmem libasyncio libsqtlv libsqstore snmplib scripts src icons errors contrib doc helpers tools app -SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp libsqurl libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug libstmem libasyncio libsqtlv libsqstore @makesnmplib@ scripts src icons errors doc helpers tools app +DIST_SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp libsqurl libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug libstmem libasyncio libsqtlv libsqstore snmplib scripts src icons errors contrib doc helpers tools app test-suite +SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp libsqurl libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug libstmem libasyncio libsqtlv libsqstore @makesnmplib@ scripts src icons errors doc helpers tools app test-suite

 DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]*
DEFAULT_PINGER = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'`
=======================================
--- /playpen/LUSCA_HEAD_ipv6/configure.in       Sun Jul  4 06:56:53 2010
+++ /playpen/LUSCA_HEAD_ipv6/configure.in       Tue Aug 31 09:02:21 2010
@@ -294,6 +294,26 @@
   fi
 ])

+AC_ARG_ENABLE(cbdata-debug,
+[ --enable-cbdata-debug Enable cbdata debugging (note slows proxy performance],
+[ case $enableval in
+  yes)
+       cbdata_debug=1
+       ;;
+  no)
+       cbdata_debug=
+       ;;
+  *)
+       cbdata_debug=
+       ;;
+  esac
+  if test $cbdata_debug; then
+       AC_DEFINE(CBDATA_DEBUG, 1, [callback data debugging support])
+ AC_DEFINE(HASHED_CBDATA, 1, [use hashed cbdata support (required for debugging)])
+       echo "Valgrind debug support enabled"
+  fi
+])
+
 AC_ARG_ENABLE(mempool-debug,
 [  --enable-mempool-debug  Include MemPool debug verifications])
 if test "$enable_mempool_debug" = yes; then
@@ -715,6 +735,32 @@
   esac
 ])

+dnl ATF may be installed in a different directory
+ATF_PREFIX=""
+AM_CONDITIONAL(ENABLE_ATF, false)
+AC_ARG_ENABLE(atf,
+[  --enable-atf[=prefix]
+                       Enable compilation of test cases using the NetBSD
+                       testing framework.],
+[
+  case "$enable_atf" in
+   yes)
+    AM_CONDITIONAL(ENABLE_ATF, true)
+    USE_ATF=1
+    ATF_PREFIX="/usr"
+    ;;
+   no)
+    USE ATF=0
+    ;;
+   *)
+    AM_CONDITIONAL(ENABLE_ATF, true)
+    USE_ATF=1
+    ATF_PREFIX="$enable_atf"
+   ;;
+  esac
+])
+AC_SUBST(ATF_PREFIX)
+
 dnl User may specify OpenSSL is needed from a non-standard location
 AC_ARG_WITH(openssl,
 [  --with-openssl[=prefix]
@@ -742,7 +788,7 @@
 if test -n "$USE_OPENSSL"; then
   echo "Using OpenSSL MD5 implementation"
AC_DEFINE(USE_OPENSSL, 1, [Define this to make use of the OpenSSL libraries for
-       MD5 calculation rather than Squid's own MD5 implementation
+       MD5 calculation rather than Squids own MD5 implementation
        or if building with SSL encryption (USE_SSL)])
   if test -z "$SSLLIB"; then
     SSLLIB="-lcrypto" # for MD5 routines
@@ -3352,5 +3398,7 @@
        helpers/external_acl/session/Makefile \
        helpers/external_acl/unix_group/Makefile \
        helpers/external_acl/wbinfo_group/Makefile \
+       test-suite/Makefile \
+       test-suite/atf/Makefile \
        tools/Makefile \
 ])
=======================================
--- /playpen/LUSCA_HEAD_ipv6/include/Vector.h   Sun Jul  4 06:56:53 2010
+++ /playpen/LUSCA_HEAD_ipv6/include/Vector.h   Tue Aug 31 09:02:21 2010
@@ -13,6 +13,8 @@
 void vector_init(vector_t *v, int obj_size, int obj_count);
 void vector_done(vector_t *v);
 void * vector_get(const vector_t *v, int offset);
+#define        vector_get      vector_get_real
+void * vector_get_real(const vector_t *v, int offset);
static inline void * vector_get_fast(const vector_t *v, int offset) { return ((char *) v->data + (v->obj_size * offset)); }
 void * vector_append(vector_t *v);
 void * vector_insert(vector_t *v, int position);
=======================================
--- /playpen/LUSCA_HEAD_ipv6/libcb/cbdata.c     Sun Jul  4 06:56:53 2010
+++ /playpen/LUSCA_HEAD_ipv6/libcb/cbdata.c     Tue Aug 31 09:02:21 2010
@@ -97,38 +97,14 @@

 int cbdataCount = 0;

-typedef struct _cbdata {
-#if HASHED_CBDATA
-    hash_link hash;
-#endif
-    int valid;
-    int locks;
-    int type;
-#if CBDATA_DEBUG
-    const char *file;
-    int line;
-#endif
-    void *y;                   /* cookie used while debugging */
-#if !HASHED_CBDATA
-    union {
-       void *pointer;
-       double double_float;
-       int integer;
-    } data;
-#endif
-} cbdata;
-
 #if HASHED_CBDATA
 static MemPool *cbdata_pool = NULL;
-static hash_table *cbdata_htable = NULL;
+hash_table *cbdata_htable = NULL;
 static HASHCMP cbdata_cmp;
 static HASHHASH cbdata_hash;
 #endif

-struct {
-    MemPool *pool;
-    FREE *free_func;
-}     *cbdata_index = NULL;
+struct cbdata_index_struct *cbdata_index = NULL;
 int cbdata_types = 0;

 #if HASHED_CBDATA
=======================================
--- /playpen/LUSCA_HEAD_ipv6/libcb/cbdata.h     Sat Mar 28 14:39:53 2009
+++ /playpen/LUSCA_HEAD_ipv6/libcb/cbdata.h     Tue Aug 31 09:02:21 2010
@@ -1,17 +1,9 @@
 #ifndef        __LIBCB_CBDATA_H__
 #define        __LIBCB_CBDATA_H__

-#define CREATE_CBDATA(type) cbdataInitType(CBDATA_##type, #type, sizeof(type), NULL) -#define CREATE_CBDATA_FREE(type, free_func) cbdataInitType(CBDATA_##type, #type, sizeof(type), free_func)
-#define CBDATA_COOKIE(p) ((void *)((unsigned long)(p) ^ 0xDEADBEEF))
-
-/* cbdata macros */
-#define cbdataAlloc(type) ((type *)cbdataInternalAlloc(CBDATA_##type))
-#define cbdataFree(var) (var = (var != NULL ? cbdataInternalFree(var): NULL))
-#define CBDATA_TYPE(type)       static cbdata_type CBDATA_##type = 0
-#define CBDATA_GLOBAL_TYPE(type)        cbdata_type CBDATA_##type
-#define CBDATA_INIT_TYPE(type) (CBDATA_##type ? 0 : (CBDATA_##type = cbdataAddType(CBDATA_##type, #type, sizeof(type), NULL))) -#define CBDATA_INIT_TYPE_FREECB(type, free_func) (CBDATA_##type ? 0 : (CBDATA_##type = cbdataAddType(CBDATA_##type, #type, sizeof(type), free_func)))
+#if CBDATA_DEBUG
+#include "../include/hash.h"
+#endif

 /*
  * cbdata types. similar to the MEM_* types above, but managed
@@ -26,15 +18,61 @@
     CBDATA_FIRST_CUSTOM_TYPE = 1000
 } cbdata_type;

+struct cbdata_index_struct {
+    MemPool *pool;
+    FREE *free_func;
+};
+
+typedef struct _cbdata {
+#if HASHED_CBDATA
+    hash_link hash;
+#endif
+    int valid;
+    int locks;
+    int type;
+#if CBDATA_DEBUG
+    const char *file;
+    int line;
+#endif
+    void *y;                    /* cookie used while debugging */
+#if !HASHED_CBDATA
+    union {
+        void *pointer;
+        double double_float;
+        int integer;
+    } data;
+#endif
+} cbdata;
+
+#define CREATE_CBDATA(type) cbdataInitType(CBDATA_##type, #type, sizeof(type), NULL) +#define CREATE_CBDATA_FREE(type, free_func) cbdataInitType(CBDATA_##type, #type, sizeof(type), free_func)
+#define CBDATA_COOKIE(p) ((void *)((unsigned long)(p) ^ 0xDEADBEEF))
+
+#if CBDATA_DEBUG
+#define cbdataAlloc(type) cbdataInternalAllocDbg(CBDATA_##type,__FILE__,__LINE__)
+#define cbdataLock(a)           cbdataLockDbg(a,__FILE__,__LINE__)
+#define cbdataUnlock(a)         cbdataUnlockDbg(a,__FILE__,__LINE__)
+#else
+#define cbdataAlloc(type) ((type *)cbdataInternalAlloc(CBDATA_##type))
+extern void cbdataLock(const void *p);
+extern void cbdataUnlock(const void *p);
+#endif
+
+#define cbdataFree(var) (var = (var != NULL ? cbdataInternalFree(var): NULL))
+#define CBDATA_TYPE(type)       static cbdata_type CBDATA_##type = 0
+#define CBDATA_GLOBAL_TYPE(type)        cbdata_type CBDATA_##type
+#define CBDATA_INIT_TYPE(type) (CBDATA_##type ? 0 : (CBDATA_##type = cbdataAddType(CBDATA_##type, #type, sizeof(type), NULL))) +#define CBDATA_INIT_TYPE_FREECB(type, free_func) (CBDATA_##type ? 0 : (CBDATA_##type = cbdataAddType(CBDATA_##type, #type, sizeof(type), free_func)))
+
+extern struct cbdata_index_struct *cbdata_index;
+
 extern void cbdataInit(void);
 #if CBDATA_DEBUG
-extern void *cbdataInternalAllocDbg(cbdata_type type, int, const char *);
+extern void *cbdataInternalAllocDbg(cbdata_type type, const char *, int);
 extern void cbdataLockDbg(const void *p, const char *, int);
 extern void cbdataUnlockDbg(const void *p, const char *, int);
 #else
 extern void *cbdataInternalAlloc(cbdata_type type);
-extern void cbdataLock(const void *p);
-extern void cbdataUnlock(const void *p);
 #endif
 /* Note: Allocations is done using the cbdataAlloc macro */
 extern void *cbdataInternalFree(void *p);
@@ -45,11 +83,8 @@
 extern int cbdataInUseCount(cbdata_type type);

 extern int cbdataCount;
-
-#if CBDATA_DEBUG
-#define cbdataAlloc(a,b)        cbdataAllocDbg(a,b,__FILE__,__LINE__)
-#define cbdataLock(a)           cbdataLockDbg(a,__FILE__,__LINE__)
-#define cbdataUnlock(a)         cbdataUnlockDbg(a,__FILE__,__LINE__)
+#if HASHED_CBDATA
+extern hash_table *cbdata_htable;
 #endif

 /* Generic cbdata stuff */
=======================================
--- /playpen/LUSCA_HEAD_ipv6/libiapp/comm_kqueue.c      Sat Jan 17 12:55:02 2009
+++ /playpen/LUSCA_HEAD_ipv6/libiapp/comm_kqueue.c      Tue Aug 31 09:02:21 2010
@@ -43,6 +43,7 @@
 #include <err.h>
 #include <sys/errno.h>
 #include <sys/socket.h>
+#include <sys/types.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>

=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/access_log.c   Wed Aug  4 22:24:11 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/access_log.c   Tue Aug 31 09:02:21 2010
@@ -323,6 +323,8 @@

     LFT_EXT_FRESHNESS,

+    LFT_CLIENT_TOS,
+
     LFT_PERCENT                        /* special string cases for escaped 
chars */

 } logformat_bcode_t;
@@ -436,6 +438,8 @@

     {"ef", LFT_EXT_FRESHNESS},

+    {"ct", LFT_CLIENT_TOS},
+
     {"%", LFT_PERCENT},

     {NULL, LFT_NONE}           /* this must be last */
@@ -727,6 +731,11 @@
            quote = 1;
            break;

+        case LFT_CLIENT_TOS:
+            outint = al->cache.client_tos;
+            doint = 1;
+            break;
+
        case LFT_PERCENT:
            out = "%";
            break;
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/cbdata.c       Tue May 27 05:49:29 2008
+++ /playpen/LUSCA_HEAD_ipv6/src/cbdata.c       Tue Aug 31 09:02:21 2010
@@ -66,7 +66,6 @@

 #include "squid.h"

-
 static OBJH cbdataDump;

 void
@@ -78,9 +77,30 @@
        cbdataDump, 0, 1);
 }

+#if HASHED_CBDATA
 static void
 cbdataDump(StoreEntry * sentry)
 {
+    cbdata *n;
+
+    hash_first(cbdata_htable);
+    while ((n = (cbdata *) hash_next(cbdata_htable))) {
+#if CBDATA_DEBUG
+ storeAppendPrintf(sentry, "cbdata=%p key=%p type=%s locks=%d valid=%d %s:%d\n", + n, n->hash.key, cbdata_index[n->type].pool->label, n->locks, n->valid, n->file, n->line);
+#else
+ storeAppendPrintf(sentry, "cbdata=%p key=%p type=%d locks=%d valid=%d\n",
+         n, n->hash.key, cbdata_index[n->type].pool->label, n->locks, 
n->valid);
+#endif
+    }
+
+    storeAppendPrintf(sentry, "%d cbdata entries\n", cbdataCount);
+}
+#else
+static void
+cbdataDump(StoreEntry * sentry)
+{
     storeAppendPrintf(sentry, "%d cbdata entries\n", cbdataCount);
     storeAppendPrintf(sentry, "see also memory pools section\n");
 }
+#endif
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/cf.data.pre    Sun Jul  4 06:56:53 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/cf.data.pre    Tue Aug 31 09:02:21 2010
@@ -2345,6 +2345,11 @@
                >st  Request size including HTTP headers
                st      Request+Reply size including HTTP headers
                sn      Unique sequence number per log line entry
+                ct      The client-facing TOS set by ZPH/TOS-map rules -
+                        _NOT_ the TOS of the incoming connection itself.
+                        This value is an integer, not a hex value.
+ It also defaults to "0" in the case where ZPH/TOS-map
+                        has not over-ridden the value.
                %       a literal % character

        The default formats available (which do not need re-defining) are:
@@ -5199,6 +5204,27 @@
        insert a %L tag in the error template file.
 DOC_END

+NAME: tcp_reset_on_all_errors
+TYPE: onoff
+LOC: Config.onoff.tcp_reset_on_all_errors
+DEFAULT: off
+DOC_START
+       This option forces a client-side connection to be forcibly
+       closed in all instances where an error page would be returned.
+
+       It defaults to "off".
+DOC_END
+
+NAME: blank_error_pages
+TYPE: onoff
+LOC: Config.onoff.blank_error_pages
+DEFAULT: off
+DOC_START
+       This option forces all error pages to simply be blank.
+
+       It defaults to "off".
+DOC_END
+
 NAME: deny_info
 TYPE: denyinfo
 LOC: Config.denyInfoList
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/client_side.c  Sun Jul 11 16:49:18 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/client_side.c  Tue Aug 31 09:02:21 2010
@@ -283,6 +283,7 @@
        http->al.cache.code = http->log_type;
        http->al.cache.msec = tvSubMsec(http->start, current_time);
        http->al.cache.rq_size = http->req_sz;
+       http->al.cache.client_tos = http->client_tos;
        if (request) {
            http->al.cache.rq_size += request->content_length;
            if (Config.onoff.log_mime_hdrs) {
@@ -1429,6 +1430,7 @@
                break;
            case ZPH_TOS:
                commSetTos(fd, tos);
+               http->client_tos = tos;
                break;
            case ZPH_PRIORITY:
                commSetSocketPriority(fd, tos);
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/client_side_body.c     Sun Jul  4 06:56:53 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/client_side_body.c     Tue Aug 31 09:02:21 2010
@@ -27,6 +27,27 @@
     }
 }

+/*!
+ * @function
+ *     clientEatRequestBody
+ *
+ * @abstract
+ *     Consume and discard request body data from the given
+ *     client connection.
+ *
+ * @discussion
+ *     This is called to eat all the request body data from a
+ *     client connection. This is used to begin aborting a
+ *     http request w/ a request body.
+ *
+ *     The eat body request handler will recursively call
+ *     itself until all incoming data is consumed. Subsequent
+ *     data which arrives on the client connection will be fed to
+ *     clientProcessBody() which will continue to consume
+ *     data until the end of the request.
+ *
+ * @param      http    client HTTP request to eat the request body of
+ */
 void
 clientEatRequestBody(clientHttpRequest * http)
 {
@@ -40,6 +61,30 @@
 }

 /* Called by clientReadRequest to process body content */
+/*!
+ * @function
+ *     clientProcessBody
+ *
+ * @abstract
+ *     Handle incoming request body data; call the request body
+ *     callback previously configured
+ *
+ * @discussion
+ *
+ *     clientProcessBody() assumes that conn->body.cbdata has been
+ *     set and has been cbdataRef()'ed. It will derefence the pointer
+ *     once the copying has completed and call the relevant callback
+ *     if needed.
+ *
+ *     clientProcessBody() assumes there is -some- data available.
+ *     It simply ignores processing if called with conn->in.offset == 0.
+ *     This means that conn->body.cbdata won't be unlocked. Calling
+ *     this function with conn.in.offset == 0 and not subsequently
+ *     deref'ing the cbdata will thus cause conn->body.cbdata
+ *     (likely a clientHttpRequest) to leak.
+ *
+ * @param      conn    The connection to handle request body data for
+ */
 void
 clientProcessBody(ConnStateData * conn)
 {
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/client_side_conn.c     Sun Jul 11 02:47:00 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/client_side_conn.c     Tue Aug 31 09:02:21 2010
@@ -35,6 +35,7 @@
     sqinet_done(&connState->me2);
     sqinet_done(&connState->peer2);
     sqinet_done(&connState->log_addr2);
+    cbdataUnlock(connState->port);
     cbdataFree(connState);
     clientside_num_conns--;
 #ifdef _SQUID_LINUX_
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/errorpage.c    Sun Jul 11 03:07:35 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/errorpage.c    Tue Aug 31 09:02:21 2010
@@ -328,6 +328,19 @@
            err->request->flags.reset_tcp = 1;
        }
     }
+
+    /*
+     *  This is a temporary(!) hack. If we get here, an error page has
+     * been created for some error condition. This global option will
+     * set the reset_tcp flag for all requests.
+     */
+    if (Config.onoff.tcp_reset_on_all_errors) {
+       if (err->request) {
+           debug(4, 2) ("RSTing this reply: tcp_reset_on_all_errors was 
set!\n");
+           err->request->flags.reset_tcp = 1;
+        }
+    }
+
     storeLockObject(entry);
     storeBuffer(entry);
     rep = errorBuildReply(err);
@@ -655,7 +668,14 @@
httpHeaderPutStrf(&rep->header, HDR_X_SQUID_ERROR, "%d %s", err->http_status, "Access Denied");
     } else {
        MemBuf content = errorBuildContent(err);
- httpReplySetHeaders(rep, err->http_status, NULL, "text/html", content.size, -1, -1);
+       size_t content_length;
+
+       if (Config.onoff.blank_error_pages)
+               content_length = 0;
+       else
+               content_length = content.size;
+
+ httpReplySetHeaders(rep, err->http_status, NULL, "text/html", content_length, -1, -1);
        /*
         * include some information for downstream caches. Implicit
         * replaceable content. This isn't quite sufficient. xerrno is not
@@ -666,7 +686,12 @@
         */
        httpHeaderPutStrf(&rep->header, HDR_X_SQUID_ERROR, "%s %d",
            name, err->xerrno);
-       httpBodySet(&rep->body, &content);
+       /* Only append the body if we need to */
+       /* XXX this shouldn't be done here? */
+       if (Config.onoff.blank_error_pages)
+               memBufClean(&content);
+       else
+               httpBodySet(&rep->body, &content);
        /* do not memBufClean() the content, it was absorbed by httpBody */
     }
     return rep;
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/store.c        Sun Jul  4 06:56:53 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/store.c        Tue Aug 31 09:02:21 2010
@@ -846,6 +846,7 @@
 }

 /* Aborted transfer into the local cache. */
+/* This takes ownership of ErrorState *err */
 void
 storeRequestFailed(StoreEntry * e, ErrorState * err)
 {
@@ -860,10 +861,13 @@
     if (e->mem_obj->inmem_hi == 0) {
        assert(err);
        errorAppendEntry(e, err);
+       err = NULL;
     } else {
        EBIT_SET(e->flags, ENTRY_ABORTED);
        EBIT_CLR(e->flags, ENTRY_FWD_HDR_WAIT);
     }
+    if (err)
+       errorStateFree(err);
     e->store_status = STORE_OK;
     mem->object_sz = mem->inmem_hi;
     /* Notify the client side */
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/store_vary.c   Sun Jul 11 02:51:11 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/store_vary.c   Tue Aug 31 09:02:21 2010
@@ -1,5 +1,6 @@

 #include "squid.h"
+#include "store_vary.h"

 typedef struct {
     StoreEntry *oe;
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/structs.h      Mon Jul 12 01:12:05 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/structs.h      Tue Aug 31 09:02:21 2010
@@ -679,6 +679,8 @@
        int load_check_stcreate;
        int download_fastest_client_speed;
        int log_http_violations;
+       int tcp_reset_on_all_errors;
+       int blank_error_pages;
     } onoff;
     int collapsed_forwarding_timeout;
     acl *aclList;
@@ -950,6 +952,7 @@
 #if USE_SSL
        const char *ssluser;
 #endif
+       int client_tos;
     } cache;
     struct {
        char *request;
@@ -1016,6 +1019,7 @@
     ushort delayAssignedPool;
     mem_node_ref nr;
     int is_modified;
+    int client_tos;
 };

 struct _ConnStateData {
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/urn.c  Sat Jan 17 12:15:04 2009
+++ /playpen/LUSCA_HEAD_ipv6/src/urn.c  Tue Aug 31 09:02:21 2010
@@ -35,6 +35,8 @@

 #include "squid.h"

+#include "../libsqurl/url.h"
+
 typedef struct {
     StoreEntry *entry;
     store_client *sc;

--
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en.

Reply via email to