From: wessels <> Date: Fri, 31 Jul 1998 06:15:19 +0000 (+0000) Subject: Luyers new DELAY_POOLS code X-Git-Tag: SQUID_3_0_PRE1~2948 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95e36d02e1eca338ecbf4ca7cafc4c46797c2d41;p=thirdparty%2Fsquid.git Luyers new DELAY_POOLS code --- diff --git a/ChangeLog b/ChangeLog index d4c6b2a190..cebe1f6fe4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ - Modified storeHashInsert() to insert PRIVATE objects at the tail of the LRU list, and PUBLIC objects at the head. Thus, PRIVATE objects get kicked out quicker. + - Added David Luyer's DELAY_POOLS code. Changes to squid-1.2.beta23 (June 22, 1998): diff --git a/configure b/configure index 9edca16ad5..2b0c8194a1 100755 --- a/configure +++ b/configure @@ -33,7 +33,7 @@ ac_help="$ac_help ac_help="$ac_help --enable-icmp Enable ICMP pinging" ac_help="$ac_help - --enable-delay-hack Enable delay hack to limit bandwith usage" + --enable-delay-pools Enable delay pools to limit bandwith usage" ac_help="$ac_help --enable-mem-gen-trace Do trace of memory stuff" ac_help="$ac_help @@ -568,7 +568,7 @@ fi -# From configure.in Revision: 1.134 +# From configure.in Revision: 1.135 ac_aux_dir= for ac_dir in cfgaux $srcdir/cfgaux; do if test -f $ac_dir/install-sh; then @@ -1085,13 +1085,14 @@ EOF fi -# Check whether --enable-delay_hack or --disable-delay_hack was given. -if test "${enable_delay_hack+set}" = set; then - enableval="$enable_delay_hack" +# Check whether --enable-delay_pools or --disable-delay_pools was given. +if test "${enable_delay_pools+set}" = set; then + enableval="$enable_delay_pools" if test "$enableval" = "yes" ; then - echo "Delay hack enabled" + echo "Delay pools enabled" + DELAY_OBJS='$(DELAY_OBJS)' cat >> confdefs.h <<\EOF -#define DELAY_HACK 1 +#define DELAY_POOLS 1 EOF fi @@ -1099,6 +1100,7 @@ EOF fi + # Check whether --enable-mem-gen-trace or --disable-mem-gen-trace was given. if test "${enable_mem_gen_trace+set}" = set; then enableval="$enable_mem_gen_trace" @@ -1300,7 +1302,7 @@ case "$host" in esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1304: checking how to run the C preprocessor" >&5 +echo "configure:1306: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1315,13 +1317,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1332,13 +1334,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1371,7 +1373,7 @@ echo "$ac_t""$CPP" 1>&6 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1375: checking for a BSD compatible install" >&5 +echo "configure:1377: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1423,7 +1425,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1427: checking for $ac_word" >&5 +echo "configure:1429: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1450,7 +1452,7 @@ else fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1454: checking whether ln -s works" >&5 +echo "configure:1456: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1473,7 +1475,7 @@ fi # Extract the first word of "sh", so it can be a program name with args. set dummy sh; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1477: checking for $ac_word" >&5 +echo "configure:1479: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1505,7 +1507,7 @@ fi # Extract the first word of "false", so it can be a program name with args. set dummy false; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1509: checking for $ac_word" >&5 +echo "configure:1511: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FALSE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1537,7 +1539,7 @@ fi # Extract the first word of "true", so it can be a program name with args. set dummy true; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1541: checking for $ac_word" >&5 +echo "configure:1543: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TRUE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1569,7 +1571,7 @@ fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1573: checking for $ac_word" >&5 +echo "configure:1575: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1601,7 +1603,7 @@ fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1605: checking for $ac_word" >&5 +echo "configure:1607: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1633,7 +1635,7 @@ fi # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1637: checking for $ac_word" >&5 +echo "configure:1639: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1665,7 +1667,7 @@ fi # Extract the first word of "ln", so it can be a program name with args. set dummy ln; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1669: checking for $ac_word" >&5 +echo "configure:1671: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1697,7 +1699,7 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1701: checking for $ac_word" >&5 +echo "configure:1703: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1729,7 +1731,7 @@ fi # Extract the first word of "makedepend", so it can be a program name with args. set dummy makedepend; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1733: checking for $ac_word" >&5 +echo "configure:1735: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MAKEDEPEND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1761,7 +1763,7 @@ fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1765: checking for $ac_word" >&5 +echo "configure:1767: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1811,12 +1813,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1815: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1817: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1824,7 +1826,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1849,7 +1851,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1853: checking for opendir in -ldir" >&5 +echo "configure:1855: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1857,7 +1859,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1890,7 +1892,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1894: checking for opendir in -lx" >&5 +echo "configure:1896: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1898,7 +1900,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1932,12 +1934,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1936: checking for ANSI C header files" >&5 +echo "configure:1938: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1945,7 +1947,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1962,7 +1964,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1980,7 +1982,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2001,7 +2003,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2012,7 +2014,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -2088,17 +2090,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2092: checking for $ac_hdr" >&5 +echo "configure:2094: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2126,12 +2128,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2130: checking for working const" >&5 +echo "configure:2132: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2201,14 +2203,14 @@ EOF fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2205: checking whether byte ordering is bigendian" >&5 +echo "configure:2207: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -2219,11 +2221,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -2234,7 +2236,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2254,7 +2256,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -2292,20 +2294,20 @@ fi echo $ac_n "checking if ANSI prototypes work""... $ac_c" 1>&6 -echo "configure:2296: checking if ANSI prototypes work" >&5 +echo "configure:2298: checking if ANSI prototypes work" >&5 if eval "test \"`echo '$''{'ac_cv_have_ansi_prototypes'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ansi_prototypes="yes" else @@ -2327,13 +2329,13 @@ EOF fi echo $ac_n "checking for tm->tm_gmtoff""... $ac_c" 1>&6 -echo "configure:2331: checking for tm->tm_gmtoff" >&5 +echo "configure:2333: checking for tm->tm_gmtoff" >&5 if eval "test \"`echo '$''{'ac_cv_have_tm_gmoff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2342,7 +2344,7 @@ struct tm foo; foo.tm_gmtoff = 0; ; return 0; } EOF -if { (eval echo configure:2346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_tm_gmoff="yes" else @@ -2364,13 +2366,13 @@ EOF fi echo $ac_n "checking for extended mallinfo""... $ac_c" 1>&6 -echo "configure:2368: checking for extended mallinfo" >&5 +echo "configure:2370: checking for extended mallinfo" >&5 if eval "test \"`echo '$''{'ac_cv_have_ext_mallinfo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2379,7 +2381,7 @@ struct mallinfo foo; foo.mxfast = 0; ; return 0; } EOF -if { (eval echo configure:2383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2385: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ext_mallinfo="yes" else @@ -2401,13 +2403,13 @@ EOF fi echo $ac_n "checking for struct rusage""... $ac_c" 1>&6 -echo "configure:2405: checking for struct rusage" >&5 +echo "configure:2407: checking for struct rusage" >&5 if eval "test \"`echo '$''{'ac_cv_have_struct_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_struct_rusage="yes" else @@ -2442,13 +2444,13 @@ EOF fi echo $ac_n "checking for ip->ip_hl""... $ac_c" 1>&6 -echo "configure:2446: checking for ip->ip_hl" >&5 +echo "configure:2448: checking for ip->ip_hl" >&5 if eval "test \"`echo '$''{'ac_cv_have_ip_hl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2465,7 +2467,7 @@ struct iphdr ip; ip.ip_hl= 0; ; return 0; } EOF -if { (eval echo configure:2469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ip_hl="yes" else @@ -2487,7 +2489,7 @@ EOF fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:2491: checking size of int" >&5 +echo "configure:2493: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2495,7 +2497,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2506,7 +2508,7 @@ main() exit(0); } EOF -if { (eval echo configure:2510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -2526,7 +2528,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:2530: checking size of long" >&5 +echo "configure:2532: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2534,7 +2536,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2545,7 +2547,7 @@ main() exit(0); } EOF -if { (eval echo configure:2549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -2568,19 +2570,19 @@ EOF # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2572: checking for working alloca.h" >&5 +echo "configure:2574: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2601,12 +2603,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2605: checking for alloca" >&5 +echo "configure:2607: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2661,12 +2663,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2665: checking whether alloca needs Cray hooks" >&5 +echo "configure:2667: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2695: checking for $ac_func" >&5 +echo "configure:2697: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2746,7 +2748,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2750: checking stack direction for C alloca" >&5 +echo "configure:2752: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2754,7 +2756,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2796,12 +2798,12 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2800: checking for pid_t" >&5 +echo "configure:2802: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2829,12 +2831,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2833: checking for size_t" >&5 +echo "configure:2835: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2862,12 +2864,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:2866: checking for ssize_t" >&5 +echo "configure:2868: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2895,12 +2897,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2899: checking for off_t" >&5 +echo "configure:2901: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2928,12 +2930,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:2932: checking for mode_t" >&5 +echo "configure:2934: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2962,7 +2964,7 @@ fi echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:2966: checking for main in -lnsl" >&5 +echo "configure:2968: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2970,14 +2972,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3005,7 +3007,7 @@ else fi echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:3009: checking for main in -lsocket" >&5 +echo "configure:3011: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3013,14 +3015,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3052,7 +3054,7 @@ if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then echo "skipping libmalloc check (--enable-dlmalloc specified)" else echo $ac_n "checking for main in -lgnumalloc""... $ac_c" 1>&6 -echo "configure:3056: checking for main in -lgnumalloc" >&5 +echo "configure:3058: checking for main in -lgnumalloc" >&5 ac_lib_var=`echo gnumalloc'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3060,14 +3062,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnumalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3110,7 +3112,7 @@ fi *) echo $ac_n "checking for main in -lmalloc""... $ac_c" 1>&6 -echo "configure:3114: checking for main in -lmalloc" >&5 +echo "configure:3116: checking for main in -lmalloc" >&5 ac_lib_var=`echo malloc'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3118,14 +3120,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lmalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3158,7 +3160,7 @@ fi fi echo $ac_n "checking for main in -lbsd""... $ac_c" 1>&6 -echo "configure:3162: checking for main in -lbsd" >&5 +echo "configure:3164: checking for main in -lbsd" >&5 ac_lib_var=`echo bsd'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3166,14 +3168,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3201,7 +3203,7 @@ else fi echo $ac_n "checking for main in -lregex""... $ac_c" 1>&6 -echo "configure:3205: checking for main in -lregex" >&5 +echo "configure:3207: checking for main in -lregex" >&5 ac_lib_var=`echo regex'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3209,14 +3211,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lregex $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3242,7 +3244,7 @@ case "$host" in ;; *) echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:3246: checking for inet_aton in -lresolv" >&5 +echo "configure:3248: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3250,7 +3252,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3277,7 +3279,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for inet_aton in -l44bsd""... $ac_c" 1>&6 -echo "configure:3281: checking for inet_aton in -l44bsd" >&5 +echo "configure:3283: checking for inet_aton in -l44bsd" >&5 ac_lib_var=`echo 44bsd'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3285,7 +3287,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l44bsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3328,7 +3330,7 @@ else fi echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6 -echo "configure:3332: checking for main in -lresolv" >&5 +echo "configure:3334: checking for main in -lresolv" >&5 ac_lib_var=`echo resolv'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3336,14 +3338,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3373,7 +3375,7 @@ fi ;; esac echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:3377: checking for main in -lm" >&5 +echo "configure:3379: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3381,14 +3383,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3417,7 +3419,7 @@ fi echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:3421: checking for crypt in -lcrypt" >&5 +echo "configure:3423: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3425,7 +3427,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3469,7 +3471,7 @@ fi echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 -echo "configure:3473: checking for main in -lpthread" >&5 +echo "configure:3475: checking for main in -lpthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3477,14 +3479,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3600,12 +3602,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3604: checking for $ac_func" >&5 +echo "configure:3606: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3668,12 +3670,12 @@ case "$host" in for ac_func in poll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3672: checking for $ac_func" >&5 +echo "configure:3674: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3724,7 +3726,7 @@ done esac echo $ac_n "checking if setresuid is implemented""... $ac_c" 1>&6 -echo "configure:3728: checking if setresuid is implemented" >&5 +echo "configure:3730: checking if setresuid is implemented" >&5 if eval "test \"`echo '$''{'ac_cv_func_setresuid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3732,7 +3734,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -3745,7 +3747,7 @@ else } EOF -if { (eval echo configure:3749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_setresuid="yes" else @@ -3779,13 +3781,13 @@ if test -z "$USE_GNUREGEX" ; then esac fi echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6 -echo "configure:3783: checking if GNUregex needs to be compiled" >&5 +echo "configure:3785: checking if GNUregex needs to be compiled" >&5 if test -z "$USE_GNUREGEX"; then if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then USE_GNUREGEX="yes" else cat > conftest.$ac_ext < #include @@ -3793,7 +3795,7 @@ int main() { regex_t t; regcomp(&t,"",0); ; return 0; } EOF -if { (eval echo configure:3797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* USE_GNUREGEX="no" else @@ -3823,12 +3825,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3827: checking for $ac_func" >&5 +echo "configure:3829: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3879,12 +3881,12 @@ done echo $ac_n "checking Default FD_SETSIZE value""... $ac_c" 1>&6 -echo "configure:3883: checking Default FD_SETSIZE value" >&5 +echo "configure:3885: checking Default FD_SETSIZE value" >&5 if test "$cross_compiling" = yes; then DEFAULT_FD_SETSIZE=256 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then DEFAULT_FD_SETSIZE=`cat conftestval` else @@ -3927,12 +3929,12 @@ EOF echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6 -echo "configure:3931: checking Maximum number of filedescriptors we can open" >&5 +echo "configure:3933: checking Maximum number of filedescriptors we can open" >&5 if test "$cross_compiling" = yes; then SQUID_MAXFD=256 else cat > conftest.$ac_ext < @@ -3991,7 +3993,7 @@ main() { } EOF -if { (eval echo configure:3995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_MAXFD=`cat conftestval` else @@ -4017,12 +4019,12 @@ if test "$SQUID_MAXFD" -lt 512 ; then fi echo $ac_n "checking Default UDP send buffer size""... $ac_c" 1>&6 -echo "configure:4021: checking Default UDP send buffer size" >&5 +echo "configure:4023: checking Default UDP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -4041,7 +4043,7 @@ main () } EOF -if { (eval echo configure:4045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_SNDBUF=`cat conftestval` else @@ -4060,12 +4062,12 @@ EOF echo $ac_n "checking Default UDP receive buffer size""... $ac_c" 1>&6 -echo "configure:4064: checking Default UDP receive buffer size" >&5 +echo "configure:4066: checking Default UDP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -4084,7 +4086,7 @@ main () } EOF -if { (eval echo configure:4088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_RCVBUF=`cat conftestval` else @@ -4103,12 +4105,12 @@ EOF echo $ac_n "checking Default TCP send buffer size""... $ac_c" 1>&6 -echo "configure:4107: checking Default TCP send buffer size" >&5 +echo "configure:4109: checking Default TCP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -4127,7 +4129,7 @@ main () } EOF -if { (eval echo configure:4131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_SNDBUF=`cat conftestval` else @@ -4146,12 +4148,12 @@ EOF echo $ac_n "checking Default TCP receive buffer size""... $ac_c" 1>&6 -echo "configure:4150: checking Default TCP receive buffer size" >&5 +echo "configure:4152: checking Default TCP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -4170,7 +4172,7 @@ main () } EOF -if { (eval echo configure:4174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_RCVBUF=`cat conftestval` else @@ -4189,19 +4191,19 @@ EOF echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6 -echo "configure:4193: checking if sys_errlist is already defined" >&5 +echo "configure:4195: checking if sys_errlist is already defined" >&5 if eval "test \"`echo '$''{'ac_cv_needs_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *s = sys_errlist0; ; return 0; } EOF -if { (eval echo configure:4205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_needs_sys_errlist="no" else @@ -4223,16 +4225,16 @@ EOF fi echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6 -echo "configure:4227: checking for libresolv _dns_ttl_ hack" >&5 +echo "configure:4229: checking for libresolv _dns_ttl_ hack" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -4427,6 +4429,7 @@ s%@LIBDLMALLOC@%$LIBDLMALLOC%g s%@LIB_MALLOC@%$LIB_MALLOC%g s%@ASYNC_OBJS@%$ASYNC_OBJS%g s%@SQUID_PTHREAD_LIB@%$SQUID_PTHREAD_LIB%g +s%@DELAY_OBJS@%$DELAY_OBJS%g s%@SNMPLIB@%$SNMPLIB%g s%@SNMP_OBJS@%$SNMP_OBJS%g s%@makesnmplib@%$makesnmplib%g diff --git a/configure.in b/configure.in index b608e3470e..8dfa0cbc3b 100644 --- a/configure.in +++ b/configure.in @@ -3,13 +3,13 @@ dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.135 1998/07/20 23:06:55 wessels Exp $ +dnl $Id: configure.in,v 1.136 1998/07/31 00:15:24 wessels Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.135 $)dnl +AC_REVISION($Revision: 1.136 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AC_CONFIG_AUX_DIR(cfgaux) @@ -269,13 +269,15 @@ AC_ARG_ENABLE(icmp, fi ]) -AC_ARG_ENABLE(delay_hack, -[ --enable-delay-hack Enable delay hack to limit bandwith usage], +AC_ARG_ENABLE(delay_pools, +[ --enable-delay-pools Enable delay pools to limit bandwith usage], [ if test "$enableval" = "yes" ; then - echo "Delay hack enabled" - AC_DEFINE(DELAY_HACK) + echo "Delay pools enabled" + DELAY_OBJS='$(DELAY_OBJS)' + AC_DEFINE(DELAY_POOLS) fi ]) +AC_SUBST(DELAY_OBJS) AC_ARG_ENABLE(mem-gen-trace, [ --enable-mem-gen-trace Do trace of memory stuff], diff --git a/include/autoconf.h.in b/include/autoconf.h.in index 287b1d159a..0b518e2cf8 100644 --- a/include/autoconf.h.in +++ b/include/autoconf.h.in @@ -104,9 +104,9 @@ #undef USE_ICMP /* - * David Luyer's Delay hack + * Traffic management via "delay pools". */ -#undef DELAY_HACK +#undef DELAY_POOLS /* * If you want to log User-Agent request header values, define this. diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index ec59d1a289..a2f446e8d2 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.cc,v 1.14 1998/07/22 20:36:50 wessels Exp $ + * $Id: HttpRequest.cc,v 1.15 1998/07/31 00:15:30 wessels Exp $ * * DEBUG: section 73 HTTP Request * AUTHOR: Duane Wessels @@ -45,6 +45,9 @@ requestCreate(method_t method, protocol_t protocol, const char *urlpath) stringReset(&req->urlpath, urlpath); req->max_age = -1; req->max_forwards = -1; +#if DELAY_POOLS + req->delay.class = 0; +#endif httpHeaderInit(&req->header, hoRequest); return req; } diff --git a/src/Makefile.in b/src/Makefile.in index d9d8a79b00..7c535a9217 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.156 1998/07/25 03:53:32 wessels Exp $ +# $Id: Makefile.in,v 1.157 1998/07/31 00:15:31 wessels Exp $ # # Uncomment and customize the following to suit your needs: # @@ -92,6 +92,7 @@ OBJS = \ comm.o \ comm_select.o \ debug.o \ + @DELAY_OBJS@ \ disk.o \ dns.o \ errorpage.o \ @@ -177,6 +178,8 @@ SNMP_OBJS = \ HTCP_OBJS = htcp.o +DELAY_OBJS = delay_pools.o + ASYNC_OBJS = \ aiops.o \ async_io.o diff --git a/src/acl.cc b/src/acl.cc index 63f679a473..99100c545a 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,6 +1,6 @@ /* - * $Id: acl.cc,v 1.173 1998/07/23 19:57:47 wessels Exp $ + * $Id: acl.cc,v 1.174 1998/07/31 00:15:33 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -1824,7 +1824,7 @@ aclReadProxyAuth(acl_proxy_auth * p) hashFreeItems(p->hash, aclFreeProxyAuthUser); hashFreeMemory(p->hash); } - p->hash = hash_create((HASHCMP*) strcmp, 7921, hash_string); + p->hash = hash_create((HASHCMP *) strcmp, 7921, hash_string); assert(NULL != p->hash); passwords = xmalloc((size_t) buf.st_size + 2); f = fopen(p->filename, "r"); diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 9bd988edfc..f31b4fad9d 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.293 1998/07/30 22:39:40 wessels Exp $ + * $Id: cache_cf.cc,v 1.294 1998/07/31 00:15:35 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -793,6 +793,10 @@ parse_peer(peer ** head) debug(3, 0) ("parse_peer: Ignoring carp-load-factor for non-parent %s/%d\n", p->host, p->http_port); else p->carp.load_factor = atof(token + 17); +#endif +#if DELAY_POOLS + } else if (!strcasecmp(token, "no-delay")) { + EBIT_SET(p->options, NEIGHBOR_NO_DELAY); #endif } else { debug(3, 0) ("parse_peer: token='%s'\n", token); diff --git a/src/cf.data.pre b/src/cf.data.pre index 8a2db184de..f3ad1d0ec8 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.92 1998/07/22 20:53:53 wessels Exp $ +# $Id: cf.data.pre,v 1.93 1998/07/31 00:15:36 wessels Exp $ # # # SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -210,6 +210,7 @@ DOC_START multicast-responder closest-only no-netdb-exchange + no-delay use 'proxy-only' to specify that objects fetched from this cache should not be saved locally. @@ -249,6 +250,9 @@ DOC_START 'no-netdb-exchange' disables requesting ICMP RTT database (NetDB) from the neighbor. + use 'no-delay' to prevent access to this neighbor + from influencing the delay pools. + NOTE: non-ICP neighbors must be specified as 'parent'. cache_peer hostname type 3128 3130 @@ -2230,4 +2234,189 @@ DOC_START WHOIS server to query for AS numbers. NOTE: AS numbers are queried only when Squid starts up, not for every request. DOC_END + +COMMENT_START + DELAY POOL PARAMETERS (all require DELAY_POOLS compilation option) + ----------------------------------------------------------------------------- + + A general note on delay pools - the first matched delay pool is used, + that is, if a request falls into class1 then it isn't checked for class2 + or class3 (and similarly a class2 request isn't checked for class3). +COMMENT_END + +NAME: delay_class1_access +TYPE: acl_access +DEFAULT: none +IFDEF: DELAY_POOLS +LOC: Config.Delay.class1.access +DOC_START + This is used to select what client requests are processed via + the first ("class 1") delay pool. In this delay pool only the + aggregate traffic allowance is configurable. +DOC_END + +NAME: delay_class2_access +TYPE: acl_access +DEFAULT: none +IFDEF: DELAY_POOLS +LOC: Config.Delay.class2.access +DOC_START + This is used to select what client requests are processed via + the first ("class 2") delay pool. In this delay pool both the + aggregate and per-host traffic allowance are configurable. + There are 254 individual delay pools based on the last 8 bits + of the client IP address (addresses ending in 0 and 255 are not + permitted). +DOC_END + +NAME: delay_class3_access +TYPE: acl_access +DEFAULT: none +IFDEF: DELAY_POOLS +LOC: Config.Delay.class3.access +DOC_START + This is used to select what client requests are processed via + the first ("class 3") delay pool. In this delay pool, the + aggregate, network and per-host traffic allowance are + configurable. There are 255 network delay pools based on the + 17th to 24th bit of the client IP address (network 255 is not + permitted), and individual delay pools based on the last 16 + bits of the client IP address (network 255 and hosts ending in + 0 and 255 are not permitted). +DOC_END + +NAME: delay_class1_aggregate_restore +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bps) +LOC: Config.Delay.class1.aggregate.restore_bps +DOC_START + The number of bytes per second added to the class 1 aggregate + delay pool traffic allowance (-1 to disable the delay pool). +DOC_END + +NAME: delay_class1_aggregate_max +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bytes) +LOC: Config.Delay.class1.aggregate.max_bytes +DOC_START + The maximum number of bytes which can be in the class 1 + aggregate delay pool traffic allowance. +DOC_END + +NAME: delay_class2_aggregate_restore +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bps) +LOC: Config.Delay.class2.aggregate.restore_bps +DOC_START + The number of bytes per second added to the class 2 aggregate + delay pool traffic allowance (-1 to disable the delay pool). +DOC_END + +NAME: delay_class2_aggregate_max +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bytes) +LOC: Config.Delay.class2.aggregate.max_bytes +DOC_START + The maximum number of bytes which can be in the class 2 + aggregate delay pool traffic allowance. +DOC_END + +NAME: delay_class2_individual_restore +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bps) +LOC: Config.Delay.class2.individual.restore_bps +DOC_START + The number of bytes per second added to the class 2 individual + host delay pool traffic allowances (-1 to disable these delay + pools). +DOC_END + +NAME: delay_class2_individual_max +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bytes) +LOC: Config.Delay.class2.individual.max_bytes +DOC_START + The maximum number of bytes which can be in the class 2 + individual host delay pool traffic allowances. +DOC_END + +NAME: delay_class3_aggregate_restore +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bps) +LOC: Config.Delay.class3.aggregate.restore_bps +DOC_START + The number of bytes per second added to the class 3 aggregate + delay pool traffic allowance (-1 to disable the delay pool). +DOC_END + +NAME: delay_class3_aggregate_max +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bytes) +LOC: Config.Delay.class3.aggregate.max_bytes +DOC_START + The maximum number of bytes which can be in the class 3 + aggregate delay pool traffic allowance. +DOC_END + +NAME: delay_class3_network_restore +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bps) +LOC: Config.Delay.class3.network.restore_bps +DOC_START + The number of bytes per second added to the class 3 8-bit + network delay pool traffic allowances (-1 to disable these + delay pools). +DOC_END + +NAME: delay_class3_network_max +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bytes) +LOC: Config.Delay.class3.network.max_bytes +DOC_START + The maximum number of bytes which can be in the class 3 8-bit + network delay pool traffic allowances. +DOC_END + +NAME: delay_class3_individual_restore +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bps) +LOC: Config.Delay.class3.individual.restore_bps +DOC_START + The number of bytes per second added to the class 3 individual + host delay pool traffic allowances (-1 to disable these delay + pools). +DOC_END + +NAME: delay_class3_individual_max +TYPE: int +DEFAULT: -1 +IFDEF: DELAY_POOLS +COMMENT: (bytes) +LOC: Config.Delay.class3.individual.max_bytes +DOC_START + The maximum number of bytes which can be in the class 3 + individual host delay pool traffic allowances. +DOC_END EOF diff --git a/src/client_side.cc b/src/client_side.cc index fa90e3413f..1895885576 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.370 1998/07/30 21:52:01 rousskov Exp $ + * $Id: client_side.cc,v 1.371 1998/07/31 00:15:38 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -723,6 +723,12 @@ clientInterpretRequestHeaders(clientHttpRequest * http) EBIT_SET(request->flags, REQ_CACHABLE); if (clientHierarchical(http)) EBIT_SET(request->flags, REQ_HIERARCHICAL); +#if DELAY_POOLS + if (delayClient(http)) { + debug(33, 5) ("clientInterpretRequestHeaders: delay request class %d position %d\n", + request->delay.class, request->delay.position); + } +#endif debug(33, 5) ("clientInterpretRequestHeaders: REQ_NOCACHE = %s\n", EBIT_TEST(request->flags, REQ_NOCACHE) ? "SET" : "NOT SET"); debug(33, 5) ("clientInterpretRequestHeaders: REQ_CACHABLE = %s\n", diff --git a/src/comm_select.cc b/src/comm_select.cc index d893c90d4b..65a617d69c 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -1,7 +1,7 @@ /* - * $Id: comm_select.cc,v 1.3 1998/07/25 00:16:25 wessels Exp $ + * $Id: comm_select.cc,v 1.4 1998/07/31 00:15:39 wessels Exp $ * * DEBUG: section 5 Socket Functions * @@ -276,6 +276,12 @@ comm_poll(int msec) comm_poll_icp_incoming(); if (commCheckHTTPIncoming) comm_poll_http_incoming(); +#if DELAY_POOLS + if (squid_curtime > delay_pools_last_update) { + delayPoolsUpdate(delay_pools_last_update - squid_curtime); + delay_pools_last_update = squid_curtime; + } +#endif callicp = callhttp = 0; nfds = 0; maxfd = Biggest_FD + 1; @@ -529,6 +535,12 @@ comm_select(int msec) comm_select_icp_incoming(); if (commCheckHTTPIncoming) comm_select_http_incoming(); +#if DELAY_POOLS + if (squid_curtime > delay_pools_last_update) { + delayPoolsUpdate(delay_pools_last_update - squid_curtime); + delay_pools_last_update = squid_curtime; + } +#endif callicp = callhttp = 0; nfds = 0; maxfd = Biggest_FD + 1; diff --git a/src/delay_pools.cc b/src/delay_pools.cc new file mode 100644 index 0000000000..f6128fb0f5 --- /dev/null +++ b/src/delay_pools.cc @@ -0,0 +1,276 @@ + +/* + * $Id: delay_pools.cc,v 1.1 1998/07/31 00:15:40 wessels Exp $ + * + * DEBUG: section 77 Delay Pools + * AUTHOR: David Luyer + * + * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from the + * Internet community. Development is led by Duane Wessels of the + * National Laboratory for Applied Network Research and funded by the + * National Science Foundation. Squid is Copyrighted (C) 1998 by + * Duane Wessels and the University of California San Diego. Please + * see the COPYRIGHT file for full details. Squid incorporates + * software developed and/or copyrighted by other sources. Please see + * the CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +#include "config.h" + +#if DELAY_POOLS +#include "squid.h" + +struct _delayData { + int class1_aggregate; + int class2_aggregate; + /* 254 entries + 1 terminator byte */ + unsigned char class2_individual_map[255]; + /* 254 entries */ + int class2_individual[254]; + int class3_aggregate; + /* 255 entries + 1 terminator byte */ + unsigned char class3_network_map[256]; + /* 255 entries */ + int class3_network[255]; + /* 255 sets of (254 entries + 1 terminator byte) */ + unsigned char class3_individual_map[255][255]; + /* largest entry = (254<<8)+253 = 65277 */ + int class3_individual[65278]; +}; + +static struct _delayData delay_data; +static OBJH delayPoolStats; + +int +delayClient(clientHttpRequest * http) +{ + aclCheck_t ch; + int i, j; + unsigned int host; + unsigned char net; + + memset(&ch, '\0', sizeof(ch)); + ch.src_addr = http->conn->peer.sin_addr; + ch.request = http->request; + if (aclCheckFast(Config.Delay.class1.access, &ch)) { + http->request->delay.class = 1; + return 1; + } + if (aclCheckFast(Config.Delay.class2.access, &ch)) { + http->request->delay.class = 2; + host = ntohl(ch.src_addr.s_addr) & 0xff; + if (host == 255 || !host) { + debug(77, 0) ("ARGH: Delay requested for host %s\n", inet_ntoa(ch.src_addr)); + http->request->delay.class = 0; + return 0; + } + for (i = 0;; i++) { + if (delay_data.class2_individual_map[i] == host) + break; + if (delay_data.class2_individual_map[i] == 255) { + delay_data.class2_individual_map[i] = host; + delay_data.class2_individual_map[i + 1] = 255; + delay_data.class2_individual[i] = Config.Delay.class2.individual.restore_bps; + break; + } + } + http->request->delay.position = i; + return 1; + } + if (aclCheckFast(Config.Delay.class3.access, &ch)) { + http->request->delay.class = 3; + host = ntohl(ch.src_addr.s_addr) & 0xffff; + net = host >> 8; + host &= 0xff; + if (host == 255 || !host || net == 255) { + debug(77, 0) ("ARGH: Delay requested for host %s\n", inet_ntoa(ch.src_addr)); + http->request->delay.class = 0; + return 0; + } + for (i = 0;; i++) { + if (delay_data.class3_network_map[i] == net) + break; + if (delay_data.class3_network_map[i] == 255) { + delay_data.class3_network_map[i] = net; + delay_data.class3_network_map[i + 1] = 255; + delay_data.class3_network[i] = Config.Delay.class3.network.restore_bps; + break; + } + } + http->request->delay.position = i << 8; + for (j = 0;; j++) { + if (delay_data.class3_individual_map[i][j] == host) { + http->request->delay.position |= j; + break; + } + if (delay_data.class3_individual_map[i][j] == 255) { + delay_data.class3_individual_map[i][j] = host; + delay_data.class3_individual_map[i][j + 1] = 255; + delay_data.class3_individual[http->request->delay.position |= j] = + Config.Delay.class3.individual.restore_bps; + break; + } + } + return 1; + } + http->request->delay.class = 0; + return 0; +} + + +void +delayPoolsUpdate(int incr) +{ + int i; + int j; + int mpos; + int individual_restore_bytes; + int network_restore_bytes; + /* Increment 3 aggregate pools */ + if (Config.Delay.class1.aggregate.restore_bps != -1 && + (delay_data.class1_aggregate += + Config.Delay.class1.aggregate.restore_bps * incr) > + Config.Delay.class1.aggregate.max_bytes) + delay_data.class1_aggregate = Config.Delay.class1.aggregate.max_bytes; + if (Config.Delay.class2.aggregate.restore_bps != -1 && + (delay_data.class2_aggregate += + Config.Delay.class2.aggregate.restore_bps * incr) > + Config.Delay.class2.aggregate.max_bytes) + delay_data.class2_aggregate = Config.Delay.class2.aggregate.max_bytes; + if (Config.Delay.class3.aggregate.restore_bps != -1 && + (delay_data.class3_aggregate += + Config.Delay.class3.aggregate.restore_bps * incr) > + Config.Delay.class3.aggregate.max_bytes) + delay_data.class3_aggregate = Config.Delay.class3.aggregate.max_bytes; + /* Increment class 2 individual pools */ + if ((individual_restore_bytes = Config.Delay.class2.individual.restore_bps) != -1) { + individual_restore_bytes *= incr; + for (i = 0;; i++) { + if (delay_data.class2_individual_map[i] == 255) + break; + if (delay_data.class2_individual[i] == Config.Delay.class2.individual.max_bytes) + continue; + if ((delay_data.class2_individual[i] += individual_restore_bytes) > + Config.Delay.class2.individual.max_bytes) + delay_data.class2_individual[i] = Config.Delay.class2.individual.max_bytes; + } + } + /* Increment class 3 individual and network pools */ + if ((network_restore_bytes = Config.Delay.class3.network.restore_bps) != -1 || + (individual_restore_bytes = Config.Delay.class3.individual.restore_bps) != -1) { + individual_restore_bytes *= incr; + network_restore_bytes *= incr; + for (i = 0;; i++) { + if (delay_data.class3_network_map[i] == 255) + break; + if (individual_restore_bytes != -incr) { + for (j = 0, mpos = (i << 8);; j++, mpos++) { + if (delay_data.class3_individual_map[i][j] == 255) + break; + if (delay_data.class3_individual[mpos] == Config.Delay.class3.individual.max_bytes) + continue; + if ((delay_data.class3_individual[mpos] += individual_restore_bytes) > + Config.Delay.class3.individual.max_bytes) + delay_data.class3_individual[mpos] = Config.Delay.class3.individual.max_bytes; + } + } + if (network_restore_bytes == -incr || + delay_data.class3_network[i] == Config.Delay.class3.network.max_bytes) + continue; + if ((delay_data.class3_network[i] += network_restore_bytes) > + Config.Delay.class3.network.max_bytes) + delay_data.class3_network[i] = Config.Delay.class3.network.max_bytes; + } + } +} + +static void +delayPoolStats(StoreEntry * sentry) +{ + int i; + int j; + storeAppendPrintf(sentry, "Class 1 Delay Pool Statistics:\n"); + storeAppendPrintf(sentry, "\n\tAggregate:\n"); + storeAppendPrintf(sentry, "\t\tMax: %d\n", Config.Delay.class1.aggregate.max_bytes); + storeAppendPrintf(sentry, "\t\tRate: %d\n", Config.Delay.class1.aggregate.restore_bps); + storeAppendPrintf(sentry, "\t\tCurrent: %d\n", delay_data.class1_aggregate); + storeAppendPrintf(sentry, "\nClass 2 Delay Pool Statistics:\n"); + storeAppendPrintf(sentry, "\n\tAggregate:\n"); + storeAppendPrintf(sentry, "\t\tMax: %d\n", Config.Delay.class2.aggregate.max_bytes); + storeAppendPrintf(sentry, "\t\tRate: %d\n", Config.Delay.class2.aggregate.restore_bps); + storeAppendPrintf(sentry, "\t\tCurrent: %d\n", delay_data.class2_aggregate); + storeAppendPrintf(sentry, "\n\tIndividual:\n"); + storeAppendPrintf(sentry, "\t\tMax: %d\n", Config.Delay.class2.individual.max_bytes); + storeAppendPrintf(sentry, "\t\tRate: %d\n", Config.Delay.class2.individual.restore_bps); + storeAppendPrintf(sentry, "\t\tCurrent: "); + for (i = 0;; i++) { + if (delay_data.class2_individual_map[i] == 255) + break; + storeAppendPrintf(sentry, "%d:%d ", delay_data.class2_individual_map[i], + delay_data.class2_individual[i]); + } + storeAppendPrintf(sentry, "\n\nClass 3 Delay Pool Statistics:\n"); + storeAppendPrintf(sentry, "\n\tAggregate:\n"); + storeAppendPrintf(sentry, "\t\tMax: %d\n", Config.Delay.class3.aggregate.max_bytes); + storeAppendPrintf(sentry, "\t\tRate: %d\n", Config.Delay.class3.aggregate.restore_bps); + storeAppendPrintf(sentry, "\t\tCurrent: %d\n", delay_data.class3_aggregate); + storeAppendPrintf(sentry, "\n\tNetwork:\n"); + storeAppendPrintf(sentry, "\t\tMax: %d\n", Config.Delay.class3.network.max_bytes); + storeAppendPrintf(sentry, "\t\tRate: %d\n", Config.Delay.class3.network.restore_bps); + storeAppendPrintf(sentry, "\t\tCurrent: "); + for (i = 0;; i++) { + if (delay_data.class3_network_map[i] == 255) + break; + storeAppendPrintf(sentry, "%d:%d ", delay_data.class3_network_map[i], + delay_data.class3_network[i]); + } + storeAppendPrintf(sentry, "\n\n\tIndividual:\n"); + storeAppendPrintf(sentry, "\t\tMax: %d\n", Config.Delay.class3.individual.max_bytes); + storeAppendPrintf(sentry, "\t\tRate: %d\n", Config.Delay.class3.individual.restore_bps); + for (i = 0;; i++) { + if (delay_data.class3_network_map[i] == 255) + break; + storeAppendPrintf(sentry, "\t\tCurrent [Network %d]: ", + delay_data.class3_network_map[i]); + for (j = 0;; j++) { + if (delay_data.class3_individual_map[i][j] == 255) + break; + storeAppendPrintf(sentry, "%d:%d ", delay_data.class3_individual_map[i][j], + delay_data.class3_individual[(i << 8) + j]); + } + storeAppendPrintf(sentry, "\n"); + } + storeAppendPrintf(sentry, "\n"); +} + +void +delayPoolsInit(void) +{ + delay_pools_last_update = getCurrentTime(); + delay_data.class1_aggregate = Config.Delay.class1.aggregate.restore_bps; + delay_data.class2_aggregate = Config.Delay.class2.aggregate.restore_bps; + delay_data.class2_individual_map[0] = 255; + delay_data.class3_aggregate = Config.Delay.class3.aggregate.restore_bps; + delay_data.class3_network_map[0] = 255; + cachemgrRegister("delay", "Delay Pool Levels", delayPoolStats, 0, 1); +} + +#endif diff --git a/src/disk.cc b/src/disk.cc index b4e3ff6b6a..e8a64caa28 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,6 +1,7 @@ + /* - * $Id: disk.cc,v 1.121 1998/07/22 20:37:13 wessels Exp $ + * $Id: disk.cc,v 1.122 1998/07/31 00:15:41 wessels Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived diff --git a/src/enums.h b/src/enums.h index fa17087adf..ee75d11ad8 100644 --- a/src/enums.h +++ b/src/enums.h @@ -1,6 +1,6 @@ /* - * $Id: enums.h,v 1.112 1998/07/30 22:05:42 wessels Exp $ + * $Id: enums.h,v 1.113 1998/07/31 00:15:42 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -495,6 +495,9 @@ enum { NEIGHBOR_HTCP, #endif NEIGHBOR_NO_NETDB_EXCHANGE, +#if DELAY_POOLS + NEIGHBOR_NO_DELAY, +#endif NEIGHBOR_END }; diff --git a/src/globals.h b/src/globals.h index 9860fdbfff..1d940f669c 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.62 1998/07/22 20:53:56 wessels Exp $ + * $Id: globals.h,v 1.63 1998/07/31 00:15:44 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -135,3 +135,6 @@ extern const char *StoreDigestMimeStr; /* "application/cache-digest" */ extern const Version CacheDigestVer; /* { 3, 3 } */ extern const char *MultipartMsgBoundaryStr; /* "Unique-Squid-Separator" */ extern icpUdpData *IcpQueueHead; /* NULL */ +#if DELAY_POOLS +extern time_t delay_pools_last_update; /* 0 */ +#endif diff --git a/src/http.cc b/src/http.cc index e0bcb1c744..73926e88f3 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.301 1998/07/30 22:04:46 wessels Exp $ + * $Id: http.cc,v 1.302 1998/07/31 00:15:45 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -722,6 +722,14 @@ httpStart(FwdState * fwdState, int fd) */ if (EBIT_TEST(httpState->peer->options, NEIGHBOR_PROXY_ONLY)) storeReleaseRequest(httpState->entry); +#if DELAY_POOLS + if (EBIT_TEST(httpState->peer->options, NEIGHBOR_NO_DELAY)) { + proxy_req->delay.class = 0; + } else { + proxy_req->delay.class = orig_req->delay.class; + proxy_req->delay.position = orig_req->delay.position; + } +#endif } else { httpState->request = requestLink(orig_req); httpState->orig_request = requestLink(orig_req); diff --git a/src/main.cc b/src/main.cc index bb6e6ea46e..c65c8546dd 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.263 1998/07/25 18:25:44 wessels Exp $ + * $Id: main.cc,v 1.264 1998/07/31 00:15:47 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -434,6 +434,7 @@ mainInitialize(void) pconnInit(); eventInit(); refreshInit(); + delayPoolsInit(); } serverConnectionsOpen(); if (theOutIcpConnection >= 0 && (!Config2.Accel.on || Config.onoff.accel_with_proxy)) diff --git a/src/neighbors.cc b/src/neighbors.cc index ef902d1e4e..c1c1da8544 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.230 1998/07/30 22:59:45 wessels Exp $ + * $Id: neighbors.cc,v 1.231 1998/07/31 00:15:49 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -1068,6 +1068,10 @@ dump_peer_options(StoreEntry * sentry, peer * p) #endif if (EBIT_TEST(p->options, NEIGHBOR_NO_NETDB_EXCHANGE)) storeAppendPrintf(sentry, " no-netdb-exchange"); +#if DELAY_POOLS + if (EBIT_TEST(p->options, NEIGHBOR_NO_DELAY)) + storeAppendPrintf(sentry, " no-delay"); +#endif if (p->mcast.ttl > 0) storeAppendPrintf(sentry, " ttl=%d", p->mcast.ttl); storeAppendPrintf(sentry, "\n"); diff --git a/src/protos.h b/src/protos.h index 2eb0983729..d4b072dfe9 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.243 1998/07/25 04:47:29 wessels Exp $ + * $Id: protos.h,v 1.244 1998/07/31 00:15:51 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -187,6 +187,9 @@ extern void _db_print(const char *,...); extern void _db_print(); #endif +/* packs, then prints an object using debug() */ +extern void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm); + extern int file_open(const char *path, int mode, FOCB *, void *callback_data, void *tag); extern void file_close(int fd); @@ -1054,8 +1057,11 @@ extern void carpInit(void); extern peer *carpSelectParent(request_t *); #endif -/* packs, then prints an object using debug() */ -extern void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm); +#if DELAY_POOLS +extern int delayClient(clientHttpRequest *); +extern void delayPoolsInit(void); +void delayPoolsUpdate(int); +#endif /* * prototypes for system functions missing from system includes diff --git a/src/snmp_agent.cc b/src/snmp_agent.cc index e29e2284e1..19ede7488b 100644 --- a/src/snmp_agent.cc +++ b/src/snmp_agent.cc @@ -1,6 +1,6 @@ /* - * $Id: snmp_agent.cc,v 1.53 1998/07/30 22:29:36 wessels Exp $ + * $Id: snmp_agent.cc,v 1.54 1998/07/31 00:15:52 wessels Exp $ * * DEBUG: section 49 SNMP Interface * AUTHOR: Kostas Anagnostakis @@ -58,7 +58,8 @@ snmp_basicFn(variable_list * Var, snint * ErrP) { variable_list *Answer; char *pp; - oid object_id[LEN_SQUID_OBJ_ID] = {SQUID_OBJ_ID}; + oid object_id[LEN_SQUID_OBJ_ID] = + {SQUID_OBJ_ID}; debug(49, 5) ("snmp_basicFn: Processing request with magic %d!\n", Var->name[7]); @@ -74,8 +75,8 @@ snmp_basicFn(variable_list * Var, snint * ErrP) break; case SYS_OBJECT_ID: Answer->type = ASN_OBJECT_ID; - Answer->val_len = sizeof(object_id); - Answer->val.objid = oiddup(object_id, LEN_SQUID_OBJ_ID); + Answer->val_len = sizeof(object_id); + Answer->val.objid = oiddup(object_id, LEN_SQUID_OBJ_ID); break; case SYS_UPTIME: Answer->val_len = sizeof(snint); @@ -512,7 +513,7 @@ snmp_prfSysFn(variable_list * Var, snint * ErrP) case PERF_SYS_NUMR: *(Answer->val.integer) = IOStats.Http.reads; break; - case PERF_SYS_DEFR: /* XXX unused, remove me */ + case PERF_SYS_DEFR: /* XXX unused, remove me */ *(Answer->val.integer) = 0; break; case PERF_SYS_MEMUSAGE: diff --git a/src/structs.h b/src/structs.h index a4ab5ba0bd..36bf9a2487 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.192 1998/07/24 00:55:04 wessels Exp $ + * $Id: structs.h,v 1.193 1998/07/31 00:15:54 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -201,6 +201,11 @@ struct _relist { relist *next; }; +struct _delay_spec { + int restore_bps; + int max_bytes; +}; + struct _SquidConfig { struct { size_t maxSize; @@ -388,6 +393,25 @@ struct _SquidConfig { struct { size_t limit; } MemPools; +#if DELAY_POOLS + struct { + struct { + struct _delay_spec aggregate; + acl_access *access; + } class1; + struct { + struct _delay_spec aggregate; + struct _delay_spec individual; + acl_access *access; + } class2; + struct { + struct _delay_spec aggregate; + struct _delay_spec individual; + struct _delay_spec network; + acl_access *access; + } class3; + } Delay; +#endif }; struct _SquidConfig2 { @@ -1178,6 +1202,12 @@ struct _request_t { size_t body_sz; HierarchyLogEntry hier; err_type err_type; +#if DELAY_POOLS + struct { + int position; + char class; + } delay; +#endif }; struct _cachemgr_passwd { diff --git a/src/urn.cc b/src/urn.cc index 5cc673ff94..ce626e6e61 100644 --- a/src/urn.cc +++ b/src/urn.cc @@ -1,7 +1,7 @@ /* * - * $Id: urn.cc,v 1.40 1998/07/22 20:38:05 wessels Exp $ + * $Id: urn.cc,v 1.41 1998/07/31 00:15:55 wessels Exp $ * * DEBUG: section 52 URN Parsing * AUTHOR: Kostas Anagnostakis @@ -138,6 +138,10 @@ urnStart(request_t * r, StoreEntry * e) errorAppendEntry(e, err); return; } +#if DELAY_POOLS + urlres_r->delay.class = r->delay.class; + urlres_r->delay.position = r->delay.position; +#endif httpHeaderPutStr(&urlres_r->header, HDR_ACCEPT, "text/plain"); if ((urlres_e = storeGet(k)) == NULL) { urlres_e = storeCreateEntry(urlres, urlres, 0, METHOD_GET);