]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
successful compile after merging 1.1.10 thru 1.1.14
authorwessels <>
Thu, 17 Jul 1997 02:31:45 +0000 (02:31 +0000)
committerwessels <>
Thu, 17 Jul 1997 02:31:45 +0000 (02:31 +0000)
40 files changed:
ChangeLog
configure
configure.in
contrib/rredir.pl [new file with mode: 0755]
doc/HTTP-codes.txt
include/autoconf.h.in
include/util.h
lib/getfullhostname.c
lib/safe_inet_addr.c
lib/tempnam.c
lib/util.c
scripts/fileno-to-pathname.pl [new file with mode: 0755]
src/cache_cf.cc
src/cachemgr.cc
src/cf.data.pre
src/client.cc
src/client_side.cc
src/comm.cc
src/debug.cc
src/defines.h
src/dns.cc
src/dnsserver.cc
src/errorpage.cc
src/globals.h
src/gopher.cc
src/http.cc
src/icmp.cc
src/ipcache.cc
src/main.cc
src/neighbors.cc
src/protos.h
src/squid.h
src/ssl.cc
src/stat.cc
src/store.cc
src/structs.h
src/tools.cc
src/tunnel.cc
src/unlinkd.cc
src/url.cc

index fbf3b6a1426ad78bae669e471030781d1dee7620..898589463b96459950386afb2fa75d191d9c5956 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+Changes to squid-1.2.alpha5 ():
+
+       - New configuration system.  Everything is generated from
+         'cf.data.pre', including the main parser, setting defaults,
+         outputting current values, and freeing memory.  
+         This also involved moving some of the local data structures
+         (e.g. struct _acl *AclList in acl.c) to the Config
+         structure.  (Max Okumoto)
+       - No more '/i' for regular expressions.  Now insert a '-i'
+         to switch to case-insensitive.  Use '+i' for case-sensitive.
+       - When you have a variable named the same as its type, sizeof()
+         gets the wrong one (fde).
+       - Need to flush unbuffered logs before fork().
+       - Added two fields swap log: refcount and e->flag.
+       - Removed all the .h files for each .c file.  Now #include stuff
+         is in either: defines.h, enums.h, typedefs.h, structs.h,
+         or protos.h, globals.h.  This greatly reduces dependencies
+         between the various source files.
+       - globals.c is generated from globals.h by a Perl script.
+
 Changes to squid-1.2.alpha4 ():
 
        - New MIME configuration, regular expression based
@@ -61,6 +81,95 @@ Changes to squid-1.2.alpha1 ():
 
 ==============================================================================
 
+Changes to squid-1.1.14 (July 11, 1997):
+
+       - Another try at log_url crap.  Added icpState->log_url
+         member.  Set mem_obj->log_url in new_MemObject() which
+         means passing more args to storeCreateEntry().  Also added
+         urlClean() which calls urlParse(); needed for ICP logging.
+       - Clean URLs will be truncated at '?' if present.
+       - Give fd_note() the clean URL.
+
+Changes to squid-1.1.13 (July 9, 1997):
+
+       - Fixed storeLog() coredump on mem->log_url.
+       - Fixed string bounds bug if a redirector returns a short
+         hostname which require appending 'append_domain' (David
+         Lamkin).
+       - Added 'fake_user_agent' to configuration because HTTP
+         anonymizing strips the User-Agent which some servers require.
+
+Changes to squid-1.1.12 (July 5, 1997):
+
+       - Fixed dnsserver buffer overflow bug and other problems related
+         to long, bogus domain names.
+       - Fixed occasional incorrect ERR_DNS_FAIL errors caused when
+         an IP cache entry gets released about the same time an
+         ICP query timeout occurs.
+       - Fixed setrlimit() bugs seen on DUNIX 4.0; rl.rlim_max == 0.
+       - Only strip 'Proxy-authorization' header when USE_PROXY_AUTH
+         is defined and proxy_auth is configured (Ron Gomes).
+       - Added missing calls to reset socket timeouts for SSL
+         and passthrough requests.
+       - Fixed "Available number of file descriptors" value in
+         cachemgr info output.
+       - Fixed coredump in proxyAuthenticate() if password file
+         has an entry with only a user name (Jordan Hrycaj).
+       - Security patch for usernames and passwords in URLs.
+         + ftpget would insert a BASE URL including the username and
+           password for directory listings IF the original request did
+           NOT include the the trailing slash.  This could be disabled
+           with a command line option, but is enabled by default.  Now
+           its #ifdefd out.
+         + Usernames and passwords could be logged to access.log and
+           store.log.  Now a new element,
+           StoreEntry->MemObject->log_url, holds a copy of the requested
+           URL without the name and password.  This isn't 100% fixed yet
+           because log_url gets generated when the StoreEntry gets
+           created.  If the StoreEntry never gets created, then the URL
+           with name and password will get logged.  Also, the name and
+           password are not stripped from ICP requests.  Also, this
+           changes store.log.  Previously we logged StoreEntry->key
+           which would look different than the URL for private entries,
+           but now we'll always log the URL.
+         + Finally, we now set REQ_AUTH for any request that includes a
+           name or password.  This prevents the request from being
+           cached (!) and prevents it from being sent to neighbor
+           caches.  In other words, its treated just as if an
+           Authorization request header were present.
+       - Fixed Byte-Range handling so that valid, whole objects
+         are not released.
+
+Changes to squid-1.1.11 (June 14, 1997):
+
+       - Clean up NeXTStep compiler warnings (Karsten Heinze, Ed Knowles).
+       - Don't forward 'Proxy-Authorization' headers (Chris Pascoe).
+       - Fixed up Host: header parsing (Henrik Nordstrom).
+       - Changed DefaultObjectsPerBucket to 20 in cache_cf.c.
+       - Fixed parsePathname() bug for magic word "none".
+       - Fixed ipcache_release to rename entries which get stuck with locks.
+       - Fixed "eventDelete(peerCheckConnect, e);" bug when the DNS lookup
+         is pending.
+       - Add sys/types.h to lib/safe_inet_addr.c for NeXTSTEP (Timo
+         Hennerich).
+       - Fixed cur_len decrement bug in diskHandleRead()
+         (Michael O'Reilly).
+       - Added contrib/rredir.pl from Peter Eisenhauer.
+       - Always forward requests with 'Byte-Range' headers (Ron Gomes).
+       - Fixed StoreEntry client offset bug which could trigger a
+         fatal_dump().
+       - Fixed noticing that dnsservers have shut down during restart.
+       - Added contrib/nextstep installer package from Gerben Wierda.
+       - Modified storeDirClean() to remove swap files where the
+         number is being used, but the file is in the wrong directory.
+       - Allow PURGE method on all protocols.
+       - Added 'icp_hit_stale' option.
+       - Fixed proxy auth refresh bug (Chris Pascoe).
+       - Don't check for other filename extensions if an FTP URL
+         ends with .txt (Ed Knowles).
+       - Relocated ERR_NO_CLIENT_BIG_OBJ check to eliminate incorrect
+         (but harmless) error message.
+
 Changes to squid-1.1.10 (April 24, 1997):
 
        - Require 0 <= multicast ttl <= 128.
index 8a42903a34d9591655a18ea783eeb2ffb197b102..4af7d1a805e97a7eee623da7176d64571d48f087 100755 (executable)
--- a/configure
+++ b/configure
@@ -1531,6 +1531,7 @@ for ac_hdr in \
        errno.h \
        fcntl.h \
        getopt.h \
+       gnumalloc.h \
        grp.h \
        libc.h \
        limits.h \
@@ -1570,17 +1571,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:1574: checking for $ac_hdr" >&5
+echo "configure:1575: 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
-#line 1579 "configure"
+#line 1580 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1585: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1608,12 +1609,12 @@ done
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1612: checking for working const" >&5
+echo "configure:1613: 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 <<EOF
-#line 1617 "configure"
+#line 1618 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1662,7 +1663,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1684,16 +1685,16 @@ fi
 
 
 echo $ac_n "checking if ANSI prototypes work""... $ac_c" 1>&6
-echo "configure:1688: checking if ANSI prototypes work" >&5
+echo "configure:1689: checking if ANSI prototypes work" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1690 "configure"
+#line 1691 "configure"
 #include "confdefs.h"
 int foo(char *); int foo (char *bar) {return 1;}
 int main() {
 foo("bar")
 ; return 0; }
 EOF
-if { (eval echo configure:1697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_ANSI_PROTOTYPES 1
@@ -1709,9 +1710,9 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for tm->tm_gmtoff""... $ac_c" 1>&6
-echo "configure:1713: checking for tm->tm_gmtoff" >&5
+echo "configure:1714: checking for tm->tm_gmtoff" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1715 "configure"
+#line 1716 "configure"
 #include "confdefs.h"
 #include <time.h>
 #include <sys/time.h>
@@ -1720,7 +1721,7 @@ struct tm foo;
 foo.tm_gmtoff = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:1724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_TM_GMTOFF 1
@@ -1736,9 +1737,9 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for extended mallinfo""... $ac_c" 1>&6
-echo "configure:1740: checking for extended mallinfo" >&5
+echo "configure:1741: checking for extended mallinfo" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1742 "configure"
+#line 1743 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <malloc.h>
@@ -1747,7 +1748,7 @@ struct mallinfo foo;
 foo.mxfast = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:1751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_EXT_MALLINFO 1
@@ -1763,9 +1764,9 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for ip->ip_hl""... $ac_c" 1>&6
-echo "configure:1767: checking for ip->ip_hl" >&5
+echo "configure:1768: checking for ip->ip_hl" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1769 "configure"
+#line 1770 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <netinet/in.h>
@@ -1782,7 +1783,7 @@ struct iphdr ip;
 ip.ip_hl= 0;
 ; return 0; }
 EOF
-if { (eval echo configure:1786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_IP_HL 1
@@ -1798,7 +1799,7 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1802: checking size of int" >&5
+echo "configure:1803: 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
@@ -1806,7 +1807,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1810 "configure"
+#line 1811 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1817,7 +1818,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:1821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1822: \"$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
@@ -1837,7 +1838,7 @@ EOF
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1841: checking size of long" >&5
+echo "configure:1842: 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
@@ -1845,7 +1846,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1849 "configure"
+#line 1850 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1856,7 +1857,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:1860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1861: \"$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
@@ -1879,19 +1880,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:1883: checking for working alloca.h" >&5
+echo "configure:1884: 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 <<EOF
-#line 1888 "configure"
+#line 1889 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:1895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -1912,12 +1913,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1916: checking for alloca" >&5
+echo "configure:1917: 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 <<EOF
-#line 1921 "configure"
+#line 1922 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -1940,7 +1941,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:1944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -1972,12 +1973,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1976: checking whether alloca needs Cray hooks" >&5
+echo "configure:1977: 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 <<EOF
-#line 1981 "configure"
+#line 1982 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -2002,12 +2003,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&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:2006: checking for $ac_func" >&5
+echo "configure:2007: 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 <<EOF
-#line 2011 "configure"
+#line 2012 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2030,7 +2031,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2057,7 +2058,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2061: checking stack direction for C alloca" >&5
+echo "configure:2062: 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
@@ -2065,7 +2066,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2069 "configure"
+#line 2070 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -2084,7 +2085,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:2088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2089: \"$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
@@ -2107,12 +2108,12 @@ fi
 
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2111: checking for pid_t" >&5
+echo "configure:2112: 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 <<EOF
-#line 2116 "configure"
+#line 2117 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2140,12 +2141,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2144: checking for size_t" >&5
+echo "configure:2145: 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 <<EOF
-#line 2149 "configure"
+#line 2150 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2173,12 +2174,12 @@ EOF
 fi
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:2177: checking for ssize_t" >&5
+echo "configure:2178: 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 <<EOF
-#line 2182 "configure"
+#line 2183 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2206,12 +2207,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2210: checking for off_t" >&5
+echo "configure:2211: 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 <<EOF
-#line 2215 "configure"
+#line 2216 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2239,12 +2240,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:2243: checking for mode_t" >&5
+echo "configure:2244: 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 <<EOF
-#line 2248 "configure"
+#line 2249 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2273,7 +2274,7 @@ fi
 
 
 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:2277: checking for main in -lnsl" >&5
+echo "configure:2278: 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
@@ -2281,14 +2282,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2285 "configure"
+#line 2286 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2293: \"$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
@@ -2316,7 +2317,7 @@ else
 fi
 
 echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:2320: checking for main in -lsocket" >&5
+echo "configure:2321: 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
@@ -2324,14 +2325,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2328 "configure"
+#line 2329 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2336: \"$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
@@ -2359,7 +2360,7 @@ else
 fi
 
 echo $ac_n "checking for main in -lgnumalloc""... $ac_c" 1>&6
-echo "configure:2363: checking for main in -lgnumalloc" >&5
+echo "configure:2364: 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
@@ -2367,14 +2368,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgnumalloc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2371 "configure"
+#line 2372 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2379: \"$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
@@ -2411,7 +2412,7 @@ if test "$ac_cv_lib_gnumalloc_main" = "no"; then
                        ;;
                *)
                        echo $ac_n "checking for main in -lmalloc""... $ac_c" 1>&6
-echo "configure:2415: checking for main in -lmalloc" >&5
+echo "configure:2416: 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
@@ -2419,14 +2420,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmalloc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2423 "configure"
+#line 2424 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2431: \"$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
@@ -2457,7 +2458,7 @@ fi
        esac
 fi
 echo $ac_n "checking for main in -lbsd""... $ac_c" 1>&6
-echo "configure:2461: checking for main in -lbsd" >&5
+echo "configure:2462: 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
@@ -2465,14 +2466,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2469 "configure"
+#line 2470 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2477: \"$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
@@ -2500,7 +2501,7 @@ else
 fi
 
 echo $ac_n "checking for main in -lregex""... $ac_c" 1>&6
-echo "configure:2504: checking for main in -lregex" >&5
+echo "configure:2505: 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
@@ -2508,14 +2509,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lregex  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2512 "configure"
+#line 2513 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2520: \"$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
@@ -2536,7 +2537,7 @@ else
 fi
 
 echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:2540: checking for inet_aton in -lresolv" >&5
+echo "configure:2541: 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
@@ -2544,7 +2545,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2548 "configure"
+#line 2549 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2555,7 +2556,7 @@ int main() {
 inet_aton()
 ; return 0; }
 EOF
-if { (eval echo configure:2559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2560: \"$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
@@ -2571,7 +2572,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:2575: checking for inet_aton in -l44bsd" >&5
+echo "configure:2576: 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
@@ -2579,7 +2580,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l44bsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2583 "configure"
+#line 2584 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2590,7 +2591,7 @@ int main() {
 inet_aton()
 ; return 0; }
 EOF
-if { (eval echo configure:2594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2595: \"$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
@@ -2622,7 +2623,7 @@ else
 fi
 
 echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6
-echo "configure:2626: checking for main in -lresolv" >&5
+echo "configure:2627: 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
@@ -2630,14 +2631,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2634 "configure"
+#line 2635 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2642: \"$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
@@ -2665,7 +2666,7 @@ else
 fi
 
 echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:2669: checking for main in -lm" >&5
+echo "configure:2670: 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
@@ -2673,14 +2674,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2677 "configure"
+#line 2678 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2685: \"$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
@@ -2709,7 +2710,7 @@ fi
 
 
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:2713: checking for crypt in -lcrypt" >&5
+echo "configure:2714: 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
@@ -2717,7 +2718,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2721 "configure"
+#line 2722 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2728,7 +2729,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:2732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2733: \"$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
@@ -2751,7 +2752,7 @@ fi
 
 
 case "$host" in
-       i386-*-solaris2.?)
+       i386-*-solaris2.*)
                if test "$GCC" = "yes"; then
                        echo "Removing -O for gcc on $host"
                        CFLAGS="`echo $CFLAGS | sed -e 's/-O[0-9]*//'`"
@@ -2808,6 +2809,7 @@ for ac_func in \
        memcpy \
        memmove \
        mktime \
+       mstats \
        poll \
        random \
        regcomp \
@@ -2829,12 +2831,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2833: checking for $ac_func" >&5
+echo "configure:2835: 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 <<EOF
-#line 2838 "configure"
+#line 2840 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2857,7 +2859,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2883,7 +2885,7 @@ done
 
 
 echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6
-echo "configure:2887: checking if GNUregex needs to be compiled" >&5
+echo "configure:2889: checking if GNUregex needs to be compiled" >&5
 if test "$ac_cv_func_regcomp" = "no" ; then
        USE_GNUREGEX="yes"
 else
@@ -2916,12 +2918,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2920: checking for $ac_func" >&5
+echo "configure:2922: 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 <<EOF
-#line 2925 "configure"
+#line 2927 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2944,7 +2946,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2972,12 +2974,12 @@ done
 
 
 echo $ac_n "checking Default FD_SETSIZE value""... $ac_c" 1>&6
-echo "configure:2976: checking Default FD_SETSIZE value" >&5
+echo "configure:2978: checking Default FD_SETSIZE value" >&5
 if test "$cross_compiling" = yes; then
   DEFAULT_FD_SETSIZE=256
 else
   cat > conftest.$ac_ext <<EOF
-#line 2981 "configure"
+#line 2983 "configure"
 #include "confdefs.h"
 
 #if HAVE_STDIO_H
@@ -3001,7 +3003,7 @@ main() {
 }
 
 EOF
-if { (eval echo configure:3005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   DEFAULT_FD_SETSIZE=`cat conftestval`
 else
@@ -3020,12 +3022,12 @@ EOF
 
 
 echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6
-echo "configure:3024: checking Maximum number of filedescriptors we can open" >&5
+echo "configure:3026: checking Maximum number of filedescriptors we can open" >&5
 if test "$cross_compiling" = yes; then
   SQUID_MAXFD=256
 else
   cat > conftest.$ac_ext <<EOF
-#line 3029 "configure"
+#line 3031 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -3077,7 +3079,7 @@ main() {
 }
 
 EOF
-if { (eval echo configure:3081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_MAXFD=`cat conftestval`
 else
@@ -3096,12 +3098,12 @@ EOF
 
 
 echo $ac_n "checking Default UDP send buffer size""... $ac_c" 1>&6
-echo "configure:3100: checking Default UDP send buffer size" >&5
+echo "configure:3102: checking Default UDP send buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_UDP_SO_SNDBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 3105 "configure"
+#line 3107 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -3120,7 +3122,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:3124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3126: \"$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
@@ -3139,12 +3141,12 @@ EOF
 
 
 echo $ac_n "checking Default UDP receive buffer size""... $ac_c" 1>&6
-echo "configure:3143: checking Default UDP receive buffer size" >&5
+echo "configure:3145: checking Default UDP receive buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_UDP_SO_RCVBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 3148 "configure"
+#line 3150 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -3163,7 +3165,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:3167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3169: \"$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
@@ -3182,12 +3184,12 @@ EOF
 
 
 echo $ac_n "checking Default TCP send buffer size""... $ac_c" 1>&6
-echo "configure:3186: checking Default TCP send buffer size" >&5
+echo "configure:3188: checking Default TCP send buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_TCP_SO_SNDBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 3191 "configure"
+#line 3193 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -3206,7 +3208,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:3210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3212: \"$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
@@ -3225,12 +3227,12 @@ EOF
 
 
 echo $ac_n "checking Default TCP receive buffer size""... $ac_c" 1>&6
-echo "configure:3229: checking Default TCP receive buffer size" >&5
+echo "configure:3231: checking Default TCP receive buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_TCP_SO_RCVBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 3234 "configure"
+#line 3236 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -3249,7 +3251,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:3253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3255: \"$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
@@ -3268,16 +3270,16 @@ EOF
 
 
 echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6
-echo "configure:3272: checking if sys_errlist is already defined" >&5
+echo "configure:3274: checking if sys_errlist is already defined" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3274 "configure"
+#line 3276 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 char *s = sys_errlist[0];
 ; return 0; }
 EOF
-if { (eval echo configure:3281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -3293,16 +3295,16 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6
-echo "configure:3297: checking for libresolv _dns_ttl_ hack" >&5
+echo "configure:3299: checking for libresolv _dns_ttl_ hack" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3299 "configure"
+#line 3301 "configure"
 #include "confdefs.h"
 extern int _dns_ttl_;
 int main() {
 return _dns_ttl_;
 ; return 0; }
 EOF
-if { (eval echo configure:3306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3308: \"$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
index da5b6700611f7b74ed13b55000d162e6e08d9312..127fd01e0be2bc457bdc2e493d360e69bd2c1b98 100644 (file)
@@ -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.73 1997/06/20 00:03:25 wessels Exp $
+dnl  $Id: configure.in,v 1.74 1997/07/16 20:31:47 wessels Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.73 $)dnl
+AC_REVISION($Revision: 1.74 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(aux)
 
@@ -143,6 +143,7 @@ AC_CHECK_HEADERS( \
        errno.h \
        fcntl.h \
        getopt.h \
+       gnumalloc.h \
        grp.h \
        libc.h \
        limits.h \
@@ -268,7 +269,7 @@ AC_SUBST(CRYPTLIB)
 dnl System-specific library modifications
 dnl
 case "$host" in
-       i386-*-solaris2.?)
+       i386-*-solaris2.*)
                if test "$GCC" = "yes"; then
                        echo "Removing -O for gcc on $host"
                        CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
@@ -323,6 +324,7 @@ AC_CHECK_FUNCS(\
        memcpy \
        memmove \
        mktime \
+       mstats \
        poll \
        random \
        regcomp \
diff --git a/contrib/rredir.pl b/contrib/rredir.pl
new file mode 100755 (executable)
index 0000000..ec053a0
--- /dev/null
@@ -0,0 +1,60 @@
+#!/usr/bin/perl -T -w
+#
+# rredir.pl
+#
+# Author: Peter Eisenhauer <pe@pipetronix.de>
+# First Version: 26. May 1997
+#
+# Description: Direct all request to files who are in a local dir to
+# this directory
+# 
+use File::Basename;
+use URI::URL;
+
+# customization part
+
+# Local Domainame from which no redirects should be done
+$localdomain = 'pipetronix.de';
+# Local domainame qouted for regexps
+$regexlocaldomain = quotemeta($localdomain);
+# Path under which the scripts accesses the local dir (must end with /)
+$access_local_dir='/opt/utils/etc/httpd/htdocs/local-rredir/';
+# Information for the redirected URL (redirect_path must end with /)
+$redirect_scheme = 'http';
+$redirect_host = 'ws-server.pipetronix.de';
+$redirect_path = 'local-rredir/';
+
+# end of customization part
+
+# flush after every print
+$| = 1;
+
+# Process lines of the form 'URL ip-address/fqdn ident method'
+# See release notes of Squid 1.1 for details
+while ( <> ) {
+    ($url, $addr, $fqdn, $ident, $method) = m:(\S*) (\S*)/(\S*) (\S*) (\S*):;
+
+    $url = url $url;
+    $host = lc($url->host);
+
+    # do not process hosts in local domain or unqualified hostnames
+    if ( $host =~ /$regexlocaldomain/ || $host !~ /\./ ) {
+       next;
+    }
+
+    # just the file, without any host or path parts
+    # and just in case: lowercase the file name, so you should make sure
+    # all the files in the local dir are only lowercase !!
+    $file = lc(basename($url->path));
+
+    # look if in local dir, if yes redirect
+    if ( $file && -r $access_local_dir . $file
+       && $file ne '.' && $file ne '..' ) {
+       $url->scheme($redirect_scheme);
+       $url->host($redirect_host);
+       $url->path($redirect_path . $file);
+    }
+
+} continue {
+    print "$url $addr/$fqdn $ident $method\n"
+}
index 887d69e316989857f754afeff9f4d506bb90c3f5..502cb14aa26ce074280eba522a2e0a298f288292 100644 (file)
@@ -43,7 +43,7 @@ Notes:
 * HTTP 1.1
 c Cached unless a query response without expiry information
 C Cached
-E Negatively cached if no expiry headers.
+E Negatively cached if no expiry headers
 t Cached only if expiry information
 - Not cached
 
index c22ec3225c7fb33799aaaee45a7749da3daa042b..aa78804ff35d4ed752594533d36cea16e36a7c77 100644 (file)
 /* Define if you have the mktime function.  */
 #undef HAVE_MKTIME
 
+/* Define if you have the mstats function.  */
+#undef HAVE_MSTATS
+
 /* Define if you have the poll function.  */
 #undef HAVE_POLL
 
 /* Define if you have the <getopt.h> header file.  */
 #undef HAVE_GETOPT_H
 
+/* Define if you have the <gnumalloc.h> header file.  */
+#undef HAVE_GNUMALLOC_H
+
 /* Define if you have the <grp.h> header file.  */
 #undef HAVE_GRP_H
 
index 96a4f91803777f2a7f716476daee2f2a744bebd2..f77044283abba5d3d3433d5944ae7aaea1d70281 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: util.h,v 1.30 1997/05/26 04:04:52 wessels Exp $
+ * $Id: util.h,v 1.31 1997/07/16 20:31:53 wessels Exp $
  *
  * AUTHOR: Harvest Derived
  *
@@ -134,6 +134,7 @@ extern char *uudecode _PARAMS((const char *));
 extern char *xstrdup _PARAMS((const char *));
 extern const char *xstrerror _PARAMS((void));
 extern int tvSubMsec _PARAMS((struct timeval, struct timeval));
+extern int tvSubUsec _PARAMS((struct timeval, struct timeval));
 extern char *xstrncpy _PARAMS((char *, const char *, size_t));
 extern time_t parse_rfc1123 _PARAMS((const char *str));
 extern void *xcalloc _PARAMS((int, size_t));
index 045108304ad67c01a0b8fdf54b99256e0b9e3cb0..51a68cd4f59813fa35e98754672c295f5b9cfa2d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: getfullhostname.c,v 1.13 1997/04/28 04:30:04 wessels Exp $
+ * $Id: getfullhostname.c,v 1.14 1997/07/16 20:31:53 wessels Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
 
 #include "config.h"
 
+#if HAVE_LIBC_H
+#include <libc.h>
+#endif
 #if HAVE_STDIO_H
 #include <stdio.h>
 #endif
index ce29c0f3729ed0bcf551bec76120efaa264ebcd1..156c0f72f45558285e60abb16d39e81c3937f577 100644 (file)
@@ -9,6 +9,12 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
index 082787ad855107e25cd6fdecfcd4c3b147b7b02e..1529d4fbd69a4db01451d520077508d14915d338 100644 (file)
 
 #include "config.h"
 
+#if HAVE_LIBC_H
+#include <libc.h>
+#endif
 #if HAVE_STDIO_H
 #include <stdio.h>
 #endif
+#if HAVE_TYPES_H
+#include <sys/types.h>
+#endif
 #if HAVE_LIMITS_H
 #include <limits.h>
 #endif
index 60a6e40d0c17d2c6d512d281b415241fa937b158..f0b38eb4329e09734814949cc9baad0585eccdb9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: util.c,v 1.29 1997/02/21 16:28:36 wessels Exp $
+ * $Id: util.c,v 1.30 1997/07/16 20:31:55 wessels Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_)
+#if HAVE_GNUMALLLOC_H
+#include <gnumalloc.h>
+#elif HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_)
 #include <malloc.h>
 #endif
 #if HAVE_ERRNO_H
@@ -459,6 +461,13 @@ tvSubMsec(struct timeval t1, struct timeval t2)
        (t2.tv_usec - t1.tv_usec) / 1000;
 }
 
+int
+tvSubUsec(struct timeval t1, struct timeval t2)
+{
+    return (t2.tv_sec - t1.tv_sec) * 1000000 +
+       (t2.tv_usec - t1.tv_usec);
+}
+
 /*
  *  xstrncpy() - similar to strncpy(3) but terminates string
  *  always with '\0' if n != 0, and doesn't do padding
diff --git a/scripts/fileno-to-pathname.pl b/scripts/fileno-to-pathname.pl
new file mode 100755 (executable)
index 0000000..7d2f328
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/local/bin/perl
+
+# $Id: fileno-to-pathname.pl,v 1.2 1997/07/16 20:31:55 wessels Exp $
+# Convert hexadecimal cache file numbers (from swap log) into full pathnames.  
+# Duane Wessels 6/30/97
+
+require 'getopts.pl';
+
+&Getopts('c:');
+$L1 = 16;
+$L2 = 256;
+
+$CF = $opt_c || '/usr/local/squid/etc/squid.conf';
+&usage unless (open (CF));
+$ncache_dirs = 0;
+while (<CF>) {
+       $CD[$ncache_dirs++] = $1 if (/^cache_dir\s+(\S+)/);
+       $L1 = $1 if (/^swap_level1_dirs\s+(\d+)/);
+       $L2 = $1 if (/^swap_level2_dirs\s+(\d+)/);
+}
+close(CF);
+unless ($ncache_dirs) {
+       $CD[$ncache_dirs++] = '/usr/local/squid/cache';
+}
+
+
+while (<>) {
+       chop;
+       print &storeSwapFullPath(hex($_)), "\n";
+}
+
+sub storeSwapFullPath {
+       local($fn) = @_;
+       sprintf "%s/%02X/%02X/%08X",
+               $CD[$fn % $ncache_dirs],
+               ($fn / $ncache_dirs) % $L1,
+               ($fn / $ncache_dirs) / $L1 % $L2,
+               $fn;
+}
+
+sub usage {
+       print STDERR "usage: $0 -c config\n";
+       print STDERR "hexadecimal file numbers are read from stdin\n";
+       exit 1;
+}
index dae1df5e4e09b14ecf9ca23e37bebf29e294b5c5..9f8016b3d29ce028768b7b56d297a87a044490f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cache_cf.cc,v 1.209 1997/07/16 05:25:04 wessels Exp $
+ * $Id: cache_cf.cc,v 1.210 1997/07/16 20:31:57 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -55,7 +55,6 @@ static void configDoConfigure _PARAMS((void));
 static void parse_refreshpattern _PARAMS((refresh_t **));
 static int parseTimeUnits _PARAMS((const char *unit));
 static void parseTimeLine _PARAMS((time_t * tptr, const char *units));
-
 static void parse_string _PARAMS((char **));
 static void parse_wordlist _PARAMS((wordlist **));
 static void default_all _PARAMS((void));
@@ -502,7 +501,7 @@ debug(0,0)("token = %p\n", token);
     }
     p->host = xstrdup(token);
     if ((token = strtok(NULL, w_space)) == NULL) {
-       debug(0,0)("bad type\n");
+       debug(0, 0) ("bad type\n");
        self_destruct();
     }
     p->type = parseNeighborType(token);
index 418dad062f5108522843df15903e2d48059e4998..be0ac59237c54c0fc73e49f650e3de86ace868ca 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: cachemgr.cc,v 1.55 1997/07/15 23:23:16 wessels Exp $
+ * $Id: cachemgr.cc,v 1.56 1997/07/16 20:31:58 wessels Exp $
  *
  * DEBUG: section 0     CGI Cache Manager
  * AUTHOR: Harvest Derived
 #if HAVE_GRP_H
 #include <grp.h>
 #endif
-#if HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_)
+#if HAVE_GNUMALLOC_H
+#include <gnumalloc.h>
+#elif HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_)
 #include <malloc.h>
 #endif
 #if HAVE_MEMORY_H
@@ -984,7 +986,7 @@ main(int argc, char *argv[])
 
     printf("\n</PRE>\n");
     print_trailer();
-    (void) close(conn);
+    close(conn);
     exit(0);
     /* NOTREACHED */
     return 0;
index 266fd97188436e139521479b6212d24f2ea49de4..194b6275d1ce3efe4fdf3a6b7cacd0d6f61e6c79 100644 (file)
@@ -1595,6 +1595,21 @@ DOC_START
 log_icp_queries on
 DOC_END
 
+NAME: icp_hit_stale
+COMMENT: on|off
+TYPE: onoff
+DEFAULT: off
+LOC: Config.Options.icp_hit_stale
+DOC_START
+       If you want to return ICP_HIT for stale cache objects, set this
+       option to 'on'.  If you have sibling relationships with caches
+       in other administrative domains, this should be 'off'.  If you only
+       have sibling relationships with caches under your control, then
+       it is probably okay to set this to 'on'.
+
+icp_hit_stale off
+DOC_END
+
 
 NAME: minimum_direct_hops
 TYPE: int
@@ -1803,4 +1818,21 @@ DOC_END
 #      XXX need docs
 #DOC_END
 
+NAME: fake_user_agent
+TYPE: eol
+LOC: Config.fake_ua
+DEFAULT: none
+DOC_START
+       If you use the paranoid http_anonymizer setting, Squid will strip
+       your User-agent string from the request.  Some Web servers will
+       refuse your request without a User-agent string.  Use this to
+       fake one up.  For example:
+
+       fake_user_agent Nutscrape/1.0 (CP/M; 8-bit)
+       (credit to Paul Southworth pauls@etext.org for this one!)
+
+fake_user_agent none
+DOC_END
+
+
 EOF
index cbd163b9cc6e08ceeef430865d0eb6f8f9d8cc0c..ffc874a7dbc82c33022d974d7fdf1ae58b737699 100644 (file)
@@ -1,8 +1,7 @@
 
 
-
 /*
- * $Id: client.cc,v 1.19 1997/07/15 23:23:18 wessels Exp $
+ * $Id: client.cc,v 1.20 1997/07/16 20:31:59 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
@@ -120,14 +119,16 @@ static void
 usage(const char *progname)
 {
     fprintf(stderr,
-       "Usage: %s [-rs] [-i IMS_time] [-h host] [-p port] [-m method] url\n"
+       "Usage: %s [-ars] [-i IMS] [-h host] [-p port] [-m method] [-t count] url\n"
        "Options:\n"
+       "    -a         Do NOT include Accept: header.\n"
        "    -r         Force cache to reload URL.\n"
        "    -s         Silent.  Do not print data to stdout.\n"
        "    -i IMS     If-Modified-Since time (in Epoch seconds).\n"
        "    -h host    Retrieve URL from cache on hostname.  Default is localhost.\n"
        "    -p port    Port number of cache.  Default is %d.\n"
-       "    -m method  Request method, default is GET.\n",
+       "    -m method  Request method, default is GET.\n"
+       "    -t count   Trace count cache-hops\n",
        progname, CACHE_HTTP_PORT);
     exit(1);
 }
@@ -138,6 +139,7 @@ main(int argc, char *argv[])
     int conn, c, len, bytesWritten;
     int port, to_stdout, reload;
     int keep_alive = 0;
+    int opt_noaccept = 0;
     char url[BUFSIZ], msg[BUFSIZ], buf[BUFSIZ], hostname[BUFSIZ];
     const char *method = "GET";
     extern char *optarg;
@@ -156,15 +158,16 @@ main(int argc, char *argv[])
        strcpy(url, argv[argc - 1]);
        if (url[0] == '-')
            usage(argv[0]);
-       while ((c = getopt(argc, argv, "fsrnkp:c:h:i:m:t:?")) != -1)
+       while ((c = getopt(argc, argv, "ah:i:km:p:rst:?")) != -1)
            switch (c) {
+           case 'a':
+               opt_noaccept = 1;
+               break;
            case 'h':           /* host:arg */
-           case 'c':           /* backward compat */
                if (optarg != NULL)
                    strcpy(hostname, optarg);
                break;
            case 's':           /* silent */
-           case 'n':           /* backward compat */
                to_stdout = 0;
                break;
            case 'k':           /* backward compat */
@@ -216,8 +219,10 @@ main(int argc, char *argv[])
        sprintf(buf, "Pragma: no-cache\r\n");
        strcat(msg, buf);
     }
-    sprintf(buf, "Accept: */*\r\n");
-    strcat(msg, buf);
+    if (opt_noaccept == 0) {
+       sprintf(buf, "Accept: */*\r\n");
+       strcat(msg, buf);
+    }
     if (ims) {
        sprintf(buf, "If-Modified-Since: %s\r\n", mkrfc1123(ims));
        strcat(msg, buf);
index 3b0917d6417041aef6ceeb83489bad2bee9ef0ff..0da37e3414eadba65f09a1707b934e11eeb03d64 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.117 1997/07/15 23:23:19 wessels Exp $
+ * $Id: client_side.cc,v 1.118 1997/07/16 20:32:00 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -165,6 +165,7 @@ clientRedirectDone(void *data, char *result)
 {
     clientHttpRequest *http = data;
     int fd = http->conn->fd;
+    size_t l;
     request_t *new_request = NULL;
     request_t *old_request = http->request;
     debug(33, 5) ("clientRedirectDone: '%s' result=%s\n", http->url,
@@ -176,7 +177,12 @@ clientRedirectDone(void *data, char *result)
        new_request = urlParse(old_request->method, result);
     if (new_request) {
        safe_free(http->url);
-       http->url = xstrdup(result);
+       /* need to malloc because the URL returned by the redirector might
+        * not be big enough to append the local domain
+        * -- David Lamkin drl@net-tel.co.uk */
+       l = strlen(result) + Config.appendDomainLen + 5;
+       http->url = xcalloc(l, 1);
+       xstrncpy(http->url, result, l);
        new_request->http_ver = old_request->http_ver;
        new_request->headers = old_request->headers;
        new_request->headers_sz = old_request->headers_sz;
@@ -275,9 +281,9 @@ proxyAuthenticate(const char *headers)
 
                debug(33, 5) ("proxyAuthenticate: adding new passwords to hash table\n");
                while (user != NULL) {
-                   if (strlen(user) > 1 && strlen(passwd) > 1) {
+                   if (strlen(user) > 1 && passwd && strlen(passwd) > 1) {
                        debug(33, 6) ("proxyAuthenticate: adding %s, %s to hash table\n", user, passwd);
-                       hash_insert(validated, xstrdup(user), xstrdup(passwd));
+                       hash_insert(validated, xstrdup(user), (void *) xstrdup(passwd));
                    }
                    user = strtok(NULL, ":");
                    passwd = strtok(NULL, "\n");
@@ -291,9 +297,8 @@ proxyAuthenticate(const char *headers)
            Config.proxyAuth.File = NULL;
            return (dash_str);
        }
+       last_time = squid_curtime;
     }
-    last_time = squid_curtime;
-
     hashr = hash_lookup(validated, sent_user);
     if (hashr == NULL) {
        /* User doesn't exist; deny them */
@@ -337,6 +342,7 @@ icpProcessExpired(int fd, void *data)
     BIT_SET(http->request->flags, REQ_REFRESH);
     http->old_entry = http->entry;
     entry = storeCreateEntry(url,
+       http->log_url,
        http->request->flags,
        http->request->method);
     /* NOTE, don't call storeLockObject(), storeCreateEntry() does it */
index c335cf56b7cbc10e8678ff4ef3cd4ccca33c2fc6..32490b23756edc73a89f184363b9465ea2a5aeee 100644 (file)
@@ -1,6 +1,5 @@
-
 /*
- * $Id: comm.cc,v 1.179 1997/07/15 23:23:21 wessels Exp $
+ * $Id: comm.cc,v 1.180 1997/07/16 20:32:01 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
index 3e4eadb1d5cdb724105e30475d1ac34ef5f17a5b..f29494b8e215bef8a444023eea04c4611503dcd9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: debug.cc,v 1.48 1997/07/14 23:44:58 wessels Exp $
+ * $Id: debug.cc,v 1.49 1997/07/16 20:32:02 wessels Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -233,7 +233,9 @@ _db_rotate_log(void)
     int i;
     LOCAL_ARRAY(char, from, MAXPATHLEN);
     LOCAL_ARRAY(char, to, MAXPATHLEN);
+#ifdef S_ISREG
     struct stat sb;
+#endif
 
     if (debug_log_file == NULL)
        return;
index d519d4ea3904fab0cea17ac87391a18ef14cee1e..6222423b0e75547ac3213aaa7fa3dca7fda5a011 100644 (file)
 #define MAX_LOGIN_SZ  128
 
 /* bitfields for the flags member */
-#define REQ_UNUSED1            0x01
+#define REQ_RANGE              0x01
 #define REQ_NOCACHE            0x02
 #define REQ_IMS                        0x04
 #define REQ_AUTH               0x08
index f028a315df3fa819706fe8237d8d1581abaee5e8..d51cb57641fbe1aa8eb53fbdc13931d8e4fc9d7c 100644 (file)
@@ -1,5 +1,6 @@
+
 /*
- * $Id: dns.cc,v 1.37 1997/07/15 05:34:08 wessels Exp $
+ * $Id: dns.cc,v 1.38 1997/07/16 20:32:03 wessels Exp $
  *
  * DEBUG: section 34    Dnsserver interface
  * AUTHOR: Harvest Derived
index ed0aa931231d9ffb4c5e735c21acab304a5c7ba3..5048fc47197cf08de67ca16570223b30e877bee8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dnsserver.cc,v 1.33 1997/04/28 04:23:05 wessels Exp $
+ * $Id: dnsserver.cc,v 1.34 1997/07/16 20:32:03 wessels Exp $
  *
  * DEBUG: section 0     DNS Resolver
  * AUTHOR: Harvest Derived
 #if HAVE_GRP_H
 #include <grp.h>
 #endif
-#if HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_)
+#if HAVE_GNUMALLOC_H
+#include <gnumalloc.h>
+#elif HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_)
 #include <malloc.h>
 #endif
 #if HAVE_MEMORY_H
@@ -245,11 +247,13 @@ my_h_msgs(int x)
        return "Unknown DNS problem";
 }
 
+#define REQ_SZ 512
+
 int
 main(int argc, char *argv[])
 {
-    char request[256];
-    char msg[256];
+    char request[512];
+    char msg[1024];
     const struct hostent *result = NULL;
     FILE *logfile = NULL;
     long start;
@@ -302,13 +306,15 @@ main(int argc, char *argv[])
     for (;;) {
        int retry_count = 0;
        struct in_addr ip;
-       memset(request, '\0', 256);
+       memset(request, '\0', REQ_SZ);
 
        /* read from ipcache */
-       if (fgets(request, 255, stdin) == NULL)
+       if (fgets(request, REQ_SZ, stdin) == NULL)
            exit(1);
-       if ((t = strrchr(request, '\n')) != NULL)
-           *t = '\0';          /* strip NL */
+       t = strrchr(request, '\n');
+       if (t == NULL)          /* Ignore if no newline */
+           continue;
+       *t = '\0';              /* strip NL */
        if ((t = strrchr(request, '\r')) != NULL)
            *t = '\0';          /* strip CR */
        if (strcmp(request, "$shutdown") == 0) {
index 32ca17e8dc204036dffb4ab2e5e0cf1f526b977d..0cb30e855a2b7598fe49d66fa87749c3ae6dd2f0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.58 1997/07/14 03:33:37 wessels Exp $
+ * $Id: errorpage.cc,v 1.59 1997/07/16 20:32:04 wessels Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -80,9 +80,9 @@ static error_data ErrorData[] =
     {"ERR_LIFETIME_EXP",
        "Transaction Timeout",
        "The network or remote site may be down or too slow.  Try again later."},
-    {"ERR_NO_CLIENTS_BIG_OBJ",
+    {"ERR_NO_CLIENTS",
        "No Client",
-       "All Clients went away before tranmission completed and the object is too big to cache."},
+       "All Clients went away before tranmission completed and the object would not be cached."},
     {"ERR_READ_ERROR",
        "Read Error",
        "The remote site or network may be down.  Please try again."},
@@ -152,6 +152,7 @@ errorInitialize(void)
     meta_data.misc += MAX_URL * 3;
 }
 
+
 char *
 squid_error_url(const char *url, int method, int type, const char *address, int code, const char *msg)
 {
@@ -233,9 +234,9 @@ access_denied_msg(int code, int method, const char *url, const char *client)
        "<BODY><H1>Error</H1>\n"
        "<H2>Access Denied</H2>\n"
        "<P>\n"
-       "Sorry, you are not currently allowed to request\n"
+       "Sorry, you are not currently allowed to request:\n"
        "<PRE>    %s</PRE>\n"
-       "From this cache.  Please check with the\n"
+       "from this cache.  Please check with the\n"
        "<A HREF=\"mailto:%s\">cache administrator</A>\n"
        "if you believe this is incorrect.\n"
        "<P>\n"
@@ -271,7 +272,7 @@ access_denied_redirect(int code, int method, const char *url, const char *client
        "<BODY><H1>Error</H1>\n"
        "<H2>Access Denied</H2>\n"
        "<P>\n"
-       "Sorry, you are not currently allowed to request\n"
+       "Sorry, you are not currently allowed to request:\n"
        "<PRE>    %s</PRE>\n"
        "from this cache.\n"
        "<P>\n"
@@ -305,7 +306,7 @@ authorization_needed_msg(const request_t * request, const char *realm)
 {
     sprintf(auth_msg, "<HTML><HEAD><TITLE>Authorization needed</TITLE>\n\
 </HEAD><BODY><H1>Authorization needed</H1>\n\
-<P>Sorry, you have to authorize yourself to request\n\
+<P>Sorry, you have to authorize yourself to request:\n\
 <PRE>    ftp://%s@%s%s</PRE>\n\
 <P>from this cache.  Please check with the\n\
 <A HREF=\"mailto:%s\">cache administrator</A>\n\
@@ -349,7 +350,7 @@ Content-type: text/html\r\n\
 <TITLE>Cache Access Denied</TITLE>\n\
 <H2>Cache Access Denied</H2>\n\
 <P>\n\
-Sorry, you are not currently allowed to request\n\
+Sorry, you are not currently allowed to request:\n\
 <PRE>    %s</PRE>\n\
 from this cache until you have authenticated yourself.\n\
 \n<p>\
index 00b8b10d28d22b270da9b39d1274e21b519e8050..811e05f04ab023a6ceff02b4e63630630858839e 100644 (file)
@@ -36,6 +36,7 @@ extern const char *swapStatusStr[];
 extern dnsStatData DnsStats;
 extern fde *fd_table;          /* NULL */
 extern int Biggest_FD;         /* -1 */
+extern int Number_FD;          /* 0 */
 extern int HttpSockets[MAXHTTPPORTS];
 extern int NDnsServersAlloc;   /* 0 */
 extern int NHttpSockets;       /* 0 */
@@ -86,6 +87,10 @@ extern volatile unsigned long nudpconn;              /* 0 */
 extern volatile unsigned long ntcpconn;                /* 0 */
 extern int unlinkd_count;      /* 0 */
 extern int fileno_stack_count; /* 0 */
+extern int store_rebuilding;   /* 1 */
+extern int store_swap_size;    /* 0 */
+extern int client_info_sz;     /* 0 */
+extern unsigned long store_mem_size;   /* 0 */
 
 #ifdef HAVE_SYSLOG
 extern int _db_level;
index 8657e59a1344757417d66b36a6ce3b75ec82f9ad..255f3911427e9c42d1e211b21c951bc4834490ed 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: gopher.cc,v 1.90 1997/07/15 23:23:23 wessels Exp $
+ * $Id: gopher.cc,v 1.91 1997/07/16 20:32:06 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -289,7 +289,7 @@ gopher_url_parser(const char *url, char *host, int *port, char *type_id, char *r
        request[0] = '\0';
     } else {
        /* convert %xx to char */
-       (void) url_convert_hex(request, 0);
+       url_convert_hex(request, 0);
     }
 
     host[0] = '\0';
index 4db89fde8e5bd031d16e189ca7bee8269fb613ff..995a2b09a819c6b894508e7d16b4d79e0ed10c48 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.177 1997/07/14 23:45:01 wessels Exp $
+ * $Id: http.cc,v 1.178 1997/07/16 20:32:07 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -204,7 +204,7 @@ static PF httpReadReply;
 static PF httpSendRequest;
 static PF httpStateFree;
 static PF httpTimeout;
-static void httpAppendRequestHeader _PARAMS((char *hdr, const char *line, size_t * sz, size_t max));
+static void httpAppendRequestHeader _PARAMS((char *hdr, const char *line, size_t * sz, size_t max, int));
 static void httpCacheNegatively _PARAMS((StoreEntry *));
 static void httpMakePrivate _PARAMS((StoreEntry *));
 static void httpMakePublic _PARAMS((StoreEntry *));
@@ -477,6 +477,7 @@ httpCheckPublic(struct _http_reply *reply, HttpStateData * httpState)
        return -1;
        break;
        /* Some responses can never be cached */
+    case 206:                  /* Partial Content -- Not yet supported */
     case 303:                  /* See Other */
     case 304:                  /* Not Modified */
     case 401:                  /* Unauthorized */
@@ -665,17 +666,19 @@ httpSendComplete(int fd, char *buf, int size, int errflag, void *data)
 }
 
 static void
-httpAppendRequestHeader(char *hdr, const char *line, size_t * sz, size_t max)
+httpAppendRequestHeader(char *hdr, const char *line, size_t * sz, size_t max, int check)
 {
     size_t n = *sz + strlen(line) + 2;
     if (n >= max)
        return;
-    if (Config.Options.anonymizer == ANONYMIZER_PARANOID) {
-       if (!httpAnonAllowed(line))
-           return;
-    } else if (Config.Options.anonymizer == ANONYMIZER_STANDARD) {
-       if (httpAnonDenied(line))
-           return;
+    if (check) {
+       if (Config.Options.anonymizer == ANONYMIZER_PARANOID) {
+           if (!httpAnonAllowed(line))
+               return;
+       } else if (Config.Options.anonymizer == ANONYMIZER_STANDARD) {
+           if (httpAnonDenied(line))
+               return;
+       }
     }
     /* allowed header, explicitly known to be not dangerous */
     debug(11, 5) ("httpAppendRequestHeader: %s\n", line);
@@ -716,11 +719,11 @@ httpBuildRequestHeader(request_t * request,
     sprintf(ybuf, "%s %s HTTP/1.0",
        RequestMethodStr[request->method],
        *request->urlpath ? request->urlpath : "/");
-    httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz);
+    httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz, 1);
     /* Add IMS header */
     if (entry && entry->lastmod && request->method == METHOD_GET) {
        sprintf(ybuf, "If-Modified-Since: %s", mkrfc1123(entry->lastmod));
-       httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz);
+       httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz, 1);
        EBIT_SET(hdr_flags, HDR_IMS);
     }
     end = mime_headers_end(hdr_in);
@@ -733,6 +736,11 @@ httpBuildRequestHeader(request_t * request,
        debug(11, 5) ("httpBuildRequestHeader: %s\n", xbuf);
        if (strncasecmp(xbuf, "Proxy-Connection:", 17) == 0)
            continue;
+#if USE_PROXY_AUTH
+       if (strncasecmp(xbuf, "Proxy-authorization:", 20) == 0)
+           if (Config.proxyAuth.File)
+               continue;
+#endif
        if (strncasecmp(xbuf, "Connection:", 11) == 0)
            continue;
        if (strncasecmp(xbuf, "Host:", 5) == 0) {
@@ -763,29 +771,33 @@ httpBuildRequestHeader(request_t * request,
                sprintf(xbuf, "Max-Forwards: %d", n - 1);
            }
        }
-       httpAppendRequestHeader(hdr_out, xbuf, &len, out_sz - 512);
+       httpAppendRequestHeader(hdr_out, xbuf, &len, out_sz - 512, 1);
+    }
+    hdr_len = t - hdr_in;
+    if (Config.fake_ua && strstr(hdr_out, "User-Agent") == NULL) {
+       sprintf(ybuf, "User-Agent: %s", Config.fake_ua);
+       httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz, 0);
     }
-    hdr_len = end - hdr_in;
     /* Append Via: */
     sprintf(ybuf, "%3.1f %s", orig_request->http_ver, ThisCache);
     strcat(viabuf, ybuf);
-    httpAppendRequestHeader(hdr_out, viabuf, &len, out_sz);
+    httpAppendRequestHeader(hdr_out, viabuf, &len, out_sz, 1);
     /* Append to X-Forwarded-For: */
     strcat(fwdbuf, cfd < 0 ? "unknown" : fd_table[cfd].ipaddr);
-    httpAppendRequestHeader(hdr_out, fwdbuf, &len, out_sz);
+    httpAppendRequestHeader(hdr_out, fwdbuf, &len, out_sz, 1);
     if (!EBIT_TEST(hdr_flags, HDR_HOST)) {
        sprintf(ybuf, "Host: %s", orig_request->host);
-       httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz);
+       httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz, 1);
     }
     if (!EBIT_TEST(cc_flags, CCC_MAXAGE)) {
        url = entry ? entry->url : urlCanonical(orig_request, NULL);
        sprintf(ybuf, "Cache-control: Max-age=%d", (int) getMaxAge(url));
-       httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz);
+       httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz, 1);
        if (request->urlpath) {
            assert(strstr(url, request->urlpath));
        }
     }
-    httpAppendRequestHeader(hdr_out, null_string, &len, out_sz);
+    httpAppendRequestHeader(hdr_out, null_string, &len, out_sz, 1);
     put_free_4k_page(xbuf);
     put_free_4k_page(viabuf);
     put_free_4k_page(fwdbuf);
index 6d9c14c85bd64b6dd186a1cf0db794c38f1c899c..b11946b2a5e3164d47f0c6654dd5996b840946c2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icmp.cc,v 1.40 1997/07/15 05:34:10 wessels Exp $
+ * $Id: icmp.cc,v 1.41 1997/07/16 20:32:08 wessels Exp $
  *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels
@@ -305,8 +305,6 @@ icmpClose(void)
        return;
     debug(29, 0) ("Closing ICMP socket on FD %d\n", icmp_sock);
     comm_close(icmp_sock);
-    commSetSelect(icmp_sock, COMM_SELECT_READ, NULL, NULL, 0);
-    commSetSelect(icmp_sock, COMM_SELECT_WRITE, NULL, NULL, 0);
     icmp_sock = -1;
     while ((queue = IcmpQueueHead)) {
        IcmpQueueHead = queue->next;
index e400a5931cff008a9fcca3cdb6437aa49af83d81..625f99a9767a009482bb67a6425f01249b62ac6e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipcache.cc,v 1.127 1997/07/14 23:48:29 wessels Exp $
+ * $Id: ipcache.cc,v 1.128 1997/07/16 20:32:11 wessels Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -328,6 +328,9 @@ ipcacheExpiredEntry(ipcache_entry * i)
        return 0;
     if (i->expires > squid_curtime)
        return 0;
+    if (i->status == IP_CACHED)
+       if (squid_curtime - i->lastref < 60)
+           return 0;
     return 1;
 }
 
@@ -592,6 +595,10 @@ ipcache_dnsHandleRead(int fd, void *data)
     dnsData->offset += len;
     dnsData->ip_inbuf[dnsData->offset] = '\0';
     i = dnsData->data;
+    if (i == NULL) {
+       debug_trap("NULL ipcache_entry");
+       return;
+    }
     if (i->status != IP_DISPATCHED)
        fatal_dump("ipcache_dnsHandleRead: bad status");
     if (strstr(dnsData->ip_inbuf, "$end\n")) {
index dff3a9650d3e1b4d1d5ca0efafcebac29b64357e..1e5088b177b2245e2dfd87d9f44633b33f6e8c67 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.164 1997/07/16 04:48:29 wessels Exp $
+ * $Id: main.cc,v 1.165 1997/07/16 20:32:11 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -292,8 +292,13 @@ shut_down(int sig)
     debug(1, 1) ("Waiting %d seconds for active connections to finish\n",
        shutdown_pending > 0 ? Config.shutdownLifetime : 0);
 #ifdef KILL_PARENT_OPT
-    debug(1, 1) ("Killing RunCache, pid %d\n", getppid());
-    kill(getppid(), sig);
+    {
+       pid_t ppid = getppid();
+       if (ppid > 1) {
+           debug(1, 1, "Killing RunCache, pid %d\n", ppid);
+           kill(ppid, sig);
+       }
+    }
 #endif
 #if SA_RESETHAND == 0
     signal(SIGTERM, SIG_DFL);
@@ -414,15 +419,12 @@ serverConnectionsClose(void)
            theInIcpConnection);
        if (theInIcpConnection != theOutIcpConnection)
            comm_close(theInIcpConnection);
-       commSetSelect(theInIcpConnection,
-           COMM_SELECT_READ,
-           NULL,
-           NULL, 0);
-       if (theInIcpConnection != theOutIcpConnection)
-           commSetSelect(theOutIcpConnection,
+       else
+           commSetSelect(theInIcpConnection,
                COMM_SELECT_READ,
                NULL,
-               NULL, 0);
+               NULL,
+               0);
        theInIcpConnection = -1;
     }
     if (icmp_sock > -1)
@@ -552,6 +554,7 @@ main(int argc, char **argv)
     int n;                     /* # of GC'd objects */
     time_t loop_delay;
 
+    debug_log = stderr;
     if (FD_SETSIZE < Squid_MaxFD)
        Squid_MaxFD = FD_SETSIZE;
 
@@ -577,15 +580,7 @@ main(int argc, char **argv)
     safe_inet_addr("0.0.0.0", &any_addr);
     memset(&no_addr, '\0', sizeof(struct in_addr));
     safe_inet_addr("255.255.255.255", &no_addr);
-
-#if HAVE_SRANDOM
-    srandom(time(NULL));
-#elif HAVE_SRAND48
-    srand48(time(NULL));
-#else
-    srand(time(NULL));
-#endif
-
+    squid_srandom(time(NULL));
     errorInitialize();
 
     squid_starttime = getCurrentTime();
@@ -613,8 +608,6 @@ main(int argc, char **argv)
     fd_open(1, FD_LOG, "stdout");
     fd_open(2, FD_LOG, "stderr");
 
-    /* preinit for debug module */
-    debug_log = stderr;
     hash_init(0);
 
     mainInitialize();
index 3ad34416215ed81033210aac4e659c2f5db0c230..364b0d08092a49d082d46c0fa4fcc66c6db93e09 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: neighbors.cc,v 1.152 1997/07/16 04:48:29 wessels Exp $
+ * $Id: neighbors.cc,v 1.153 1997/07/16 20:32:12 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -331,6 +331,31 @@ getDefaultParent(request_t * request)
     return NULL;
 }
 
+#ifdef HIER_EXPERIMENT
+peer *
+getRandomParent(request_t * request)
+{
+    peer *e;
+    static peer *f = NULL;
+    peer *next = f;
+    int n = squid_random() % Peers.n;
+    int x = n << 1;
+    while (n && x--) {
+       e = next ? next : Peers.peers_head;
+       next = e->next;
+       if (neighborType(e, request) != PEER_PARENT)
+           continue;
+       if (!peerHTTPOkay(e, request))
+           continue;
+       f = e;
+       n--;
+    }
+    if (f && !peerHTTPOkay(f, request))
+       return NULL;
+    return f;
+}
+#endif
+
 peer *
 getNextPeer(peer * p)
 {
@@ -715,7 +740,7 @@ peerDestroy(peer * p)
     struct _domain_ping *nl = NULL;
     if (p == NULL)
        return;
-    if (!p->tcp_up)
+    if (p->ck_conn_event_pend)
        eventDelete(peerCheckConnect, p);
     if (p->type == PEER_MULTICAST) {
        if (p->mcast.flags & PEER_COUNT_EVENT_PENDING)
@@ -791,6 +816,9 @@ peerCheckConnect(void *data)
 {
     peer *p = data;
     int fd;
+    if (p->ck_conn_event_pend != 1)
+       debug_trap("bad ck_conn_event_pend counter");
+    p->ck_conn_event_pend--;
     fd = comm_open(SOCK_STREAM, 0, Config.Addrs.tcp_outgoing,
        0, COMM_NONBLOCKING, p->host);
     if (fd < 0)
@@ -821,6 +849,7 @@ peerCheckConnectDone(int fd, int status, void *data)
        debug(15, 0) ("TCP connection to %s/%d succeeded\n",
            p->host, p->http_port);
     } else {
+       p->ck_conn_event_pend++;
        eventAdd("peerCheckConnect", peerCheckConnect, p, 80);
     }
     comm_close(fd);
@@ -835,6 +864,7 @@ peerCheckConnectStart(peer * p)
     debug(15, 0) ("TCP connection to %s/%d failed\n", p->host, p->http_port);
     p->tcp_up = 0;
     p->last_fail_time = squid_curtime;
+    p->ck_conn_event_pend++;
     eventAdd("peerCheckConnect", peerCheckConnect, p, 80);
 }
 
@@ -863,7 +893,7 @@ peerCountMcastPeersStart(void *data)
        fatal_dump("peerCountMcastPeersStart: non-multicast peer");
     p->mcast.flags &= ~PEER_COUNT_EVENT_PENDING;
     sprintf(url, "http://%s/", inet_ntoa(p->in_addr.sin_addr));
-    fake = storeCreateEntry(url, 0, METHOD_GET);
+    fake = storeCreateEntry(url, url, 0, METHOD_GET);
     psstate->request = requestLink(urlParse(METHOD_GET, url));
     psstate->entry = fake;
     psstate->callback = NULL;
index 2e538d69b102af7459be3452911b3d946dcd9df7..cc096492e2419042f5142131f7315b8841c3a0a7 100644 (file)
@@ -36,7 +36,7 @@ extern int aio_close _PARAMS((int, aio_result_t *));
 extern int aio_stat _PARAMS((const char *, struct stat *, aio_result_t *));
 extern int aio_unlink _PARAMS((const char *, aio_result_t *));
 extern int aio_opendir _PARAMS((void));
-extern aio_result_t *aio_poll_done();
+extern aio_result_t *aio_poll_done _PARAMS((void));
 
 
 extern void aioCancel _PARAMS((int));
@@ -64,11 +64,10 @@ extern void cbdataUnlock _PARAMS((void *p));
 extern int cbdataValid _PARAMS((void *p));
 extern void cbdataDump _PARAMS((StoreEntry *));
 
-void clientdbInit _PARAMS((void));
-void clientdbUpdate _PARAMS((struct in_addr, log_type, protocol_t));
-int clientdbDeniedPercent _PARAMS((struct in_addr));
-void clientdbDump _PARAMS((StoreEntry *));
-extern int client_info_sz;
+extern void clientdbInit _PARAMS((void));
+extern void clientdbUpdate _PARAMS((struct in_addr, log_type, protocol_t));
+extern int clientdbDeniedPercent _PARAMS((struct in_addr));
+extern void clientdbDump _PARAMS((StoreEntry *));
 
 extern void clientAccessCheck _PARAMS((void *));
 extern void clientAccessCheckDone _PARAMS((int, void *));
@@ -78,7 +77,7 @@ extern char *clientConstructTraceEcho _PARAMS((clientHttpRequest *));
 extern void clientPurgeRequest _PARAMS((clientHttpRequest *));
 
 #if USE_PROXY_AUTH
-const char *proxyAuthenticate(const char *headers);
+extern const char *proxyAuthenticate(const char *headers);
 #endif /* USE_PROXY_AUTH */
 
 
@@ -441,7 +440,7 @@ extern void memFreeData _PARAMS((mem_hdr *));
 /* ----------------------------------------------------------------- */
 
 extern StoreEntry *storeGet _PARAMS((const char *));
-extern StoreEntry *storeCreateEntry _PARAMS((const char *, int, method_t));
+extern StoreEntry *storeCreateEntry _PARAMS((const char *, const char *, int, method_t));
 extern void storeSetPublicKey _PARAMS((StoreEntry *));
 extern StoreEntry *storeGetFirst _PARAMS((void));
 extern StoreEntry *storeGetNext _PARAMS((void));
@@ -493,6 +492,7 @@ extern unsigned int storeReqnum _PARAMS((StoreEntry * entry, method_t));
 extern time_t storeExpiredReferenceAge _PARAMS((void));
 extern void storeRegisterAbort _PARAMS((StoreEntry * e, STABH * cb, void *));
 extern void storeUnregisterAbort _PARAMS((StoreEntry * e));
+extern void storeMemObjectDump _PARAMS((MemObject * mem));
 
 #ifdef __STDC__
 extern void storeAppendPrintf _PARAMS((StoreEntry *, const char *,...));
@@ -500,10 +500,6 @@ extern void storeAppendPrintf _PARAMS((StoreEntry *, const char *,...));
 extern void storeAppendPrintf _PARAMS(());
 #endif
 
-extern int store_rebuilding;
-extern int store_swap_size;
-extern unsigned long store_mem_size;
-
 extern char *storeSwapFullPath _PARAMS((int, char *));
 extern char *storeSwapSubSubDir _PARAMS((int, char *));
 extern int storeAddSwapDisk _PARAMS((const char *,
@@ -560,7 +556,7 @@ extern int intAverage _PARAMS((int, int, int, int));
 extern double doubleAverage _PARAMS((double, double, int, int));
 extern void debug_trap _PARAMS((const char *));
 extern void logsFlush _PARAMS((void));
-
+extern char *checkNullString _PARAMS((char *p));
 
 extern void unlinkdInit _PARAMS((void));
 extern void unlinkdClose _PARAMS((void));
@@ -578,6 +574,8 @@ extern void requestUnlink _PARAMS((request_t *));
 extern int matchDomainName _PARAMS((const char *d, const char *h));
 extern int urlCheckRequest _PARAMS((const request_t *));
 extern int urlDefaultPort _PARAMS((protocol_t p));
+extern char *urlClean _PARAMS((char *));
+
 
 extern void useragentOpenLog _PARAMS((void));
 extern void useragentRotateLog _PARAMS((void));
index 129cea745523ba92482092b3b578a5dba52c7ff4..8b687525240d8b45eb9c289dbc2b1dd26a48e1e1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.128 1997/07/14 23:45:03 wessels Exp $
+ * $Id: squid.h,v 1.129 1997/07/16 20:32:16 wessels Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -88,7 +88,9 @@
 #if HAVE_GRP_H
 #include <grp.h>
 #endif
-#if HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_)
+#if HAVE_GNUMALLOC_H
+#include <gnumalloc.h>
+#elif HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_)
 #include <malloc.h>
 #endif
 #if HAVE_MEMORY_H
index 733794cd408d80cf42fa7b4ba5c8c58b1c457296..44b55bcf12b5e607773f531b19264e01dbd5e474 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.cc,v 1.57 1997/07/16 04:48:31 wessels Exp $
+ * $Id: ssl.cc,v 1.58 1997/07/16 20:32:17 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -42,8 +42,7 @@ typedef struct {
        int offset;
        char *buf;
     } client, server;
-    time_t timeout;
-    int *size_ptr;             /* pointer to size in an ConnStateData for logging */
+    size_t *size_ptr;          /* pointer to size in an ConnStateData for logging */
     int proxying;
 } SslStateData;
 
@@ -102,12 +101,6 @@ sslStateFree(int fd, void *data)
        return;
     if (fd != sslState->server.fd)
        fatal_dump("sslStateFree: FD mismatch!\n");
-    if (sslState->client.fd > -1) {
-       commSetSelect(sslState->client.fd,
-           COMM_SELECT_READ,
-           NULL,
-           NULL, 0);
-    }
     safe_free(sslState->server.buf);
     safe_free(sslState->client.buf);
     xfree(sslState->url);
@@ -135,6 +128,10 @@ sslReadServer(int fd, void *data)
                COMM_SELECT_READ,
                sslReadServer,
                sslState, 0);
+           commSetTimeout(sslState->server.fd,
+               Config.Timeout.read,
+               NULL,
+               NULL);
        } else {
            sslClose(sslState);
        }
@@ -219,6 +216,10 @@ sslWriteServer(int fd, void *data)
            COMM_SELECT_READ,
            sslReadClient,
            sslState, 0);
+       commSetTimeout(sslState->server.fd,
+           Config.Timeout.read,
+           NULL,
+           NULL);
     } else {
        /* still have more to write */
        commSetSelect(sslState->server.fd,
@@ -264,6 +265,10 @@ sslWriteClient(int fd, void *data)
            COMM_SELECT_READ,
            sslReadServer,
            sslState, 0);
+       commSetTimeout(sslState->server.fd,
+           Config.Timeout.read,
+           NULL,
+           NULL);
     } else {
        /* still have more to write */
        commSetSelect(sslState->client.fd,
@@ -390,7 +395,6 @@ sslStart(int fd, const char *url, request_t * request, int *size_ptr)
     cbdataAdd(sslState);
     sslState->url = xstrdup(url);
     sslState->request = requestLink(request);
-    sslState->timeout = Config.Timeout.read;
     sslState->size_ptr = size_ptr;
     sslState->client.fd = fd;
     sslState->server.fd = sock;
@@ -431,6 +435,10 @@ sslProxyConnected(int fd, void *data)
        COMM_SELECT_READ,
        sslReadServer,
        sslState, 0);
+    commSetTimeout(sslState->server.fd,
+       Config.Timeout.read,
+       NULL,
+       NULL);
 }
 
 static void
index 3247872aee45245d8a4c68424dd2b185500e52e2..d667c96472e9ee6bab6a709365ac5cf73a6c22aa 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.148 1997/07/15 03:29:05 wessels Exp $
+ * $Id: stat.cc,v 1.149 1997/07/16 20:32:17 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
 #define MAX_LINELEN (4096)
 #define max(a,b)  ((a)>(b)? (a): (b))
 
+#ifdef HIER_EXPERIMENT
+static FILE *hierexplog = NULL;
+#endif
+
 typedef struct _log_read_data_t {
     StoreEntry *sentry;
 } log_read_data_t;
@@ -281,10 +285,6 @@ describeFlags(const StoreEntry * entry)
     int flags = (int) entry->flag;
     char *t;
     buf[0] = '\0';
-#ifdef OLD_CODE
-    if (BIT_TEST(flags, IP_LOOKUP_PENDING))
-       strcat(buf, "IP,");
-#endif
     if (BIT_TEST(flags, DELETE_BEHIND))
        strcat(buf, "DB,");
 #ifdef OLD_CODE
@@ -533,16 +533,14 @@ info_get(StoreEntry * sentry)
 {
     const char *tod = NULL;
     float f;
-#if HAVE_MALLINFO
-    int t;
-#endif
-
 #if defined(HAVE_GETRUSAGE) && defined(RUSAGE_SELF)
     struct rusage rusage;
 #endif
-
-#if HAVE_MALLINFO
+#if HAVE_MSTATS && HAVE_GNUMALLOC_H
+    struct mstats ms;
+#elif HAVE_MALLINFO
     struct mallinfo mp;
+    int t;
 #endif
 
     storeAppendPrintf(sentry, open_bracket);
@@ -607,7 +605,15 @@ info_get(StoreEntry * sentry)
        rusage.ru_majflt);
 #endif
 
-#if HAVE_MALLINFO
+#if HAVE_MSTATS && HAVE_GNUMALLOC_H
+    ms = mstats();
+    storeAppendPrintf(sentry, "{Memory usage for %s via mstats():}\n",
+       appname);
+    storeAppendPrintf(sentry, "{\tTotal space in arena:  %6d KB}\n",
+       ms.bytes_total >> 10);
+    storeAppendPrintf(sentry, "{\tTotal free:            %6d KB %d%%}\n",
+       ms.bytes_free >> 10, percent(ms.bytes_free, ms.bytes_total));
+#elif HAVE_MALLINFO
     mp = mallinfo();
     storeAppendPrintf(sentry, "{Memory usage for %s via mallinfo():}\n",
        appname);
@@ -644,12 +650,14 @@ info_get(StoreEntry * sentry)
 #endif /* HAVE_MALLINFO */
 
     storeAppendPrintf(sentry, "{File descriptor usage for %s:}\n", appname);
-    storeAppendPrintf(sentry, "{\tMax number of file desc available:    %4d}\n",
+    storeAppendPrintf(sentry, "{\tMaximum number of file descriptors:   %4d}\n",
        Squid_MaxFD);
     storeAppendPrintf(sentry, "{\tLargest file desc currently in use:   %4d}\n",
        Biggest_FD);
+    storeAppendPrintf(sentry, "{\tNumber of file desc currently in use: %4d}\n",
+       Number_FD);
     storeAppendPrintf(sentry, "{\tAvailable number of file descriptors: %4d}\n",
-       fdstat_are_n_free_fd(0));
+       Squid_MaxFD - Number_FD);
     storeAppendPrintf(sentry, "{\tReserved number of file descriptors:  %4d}\n",
        RESERVED_FD);
 
index be0fec01b8e74251bd039a30d8fbc483b48670f7..ea59cc6e1f2eb1648d38384b0ae72087cc4cdc07 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.273 1997/07/15 23:23:34 wessels Exp $
+ * $Id: store.cc,v 1.274 1997/07/16 20:32:19 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -243,9 +243,6 @@ typedef struct swapout_ctrl_t {
     StoreEntry *e;
 } swapout_ctrl_t;
 
-/* initializtion flag */
-int store_rebuilding = 1;
-
 /* Static Functions */
 static void storeCreateHashTable _PARAMS((int (*)_PARAMS((const char *, const char *))));
 static int compareLastRef _PARAMS((StoreEntry **, StoreEntry **));
@@ -265,8 +262,8 @@ static VCB storeSwapInValidateComplete;
 static void storeSwapInStartComplete _PARAMS((void *, int));
 static int swapInError _PARAMS((int, StoreEntry *));
 static mem_hdr *new_MemObjectData _PARAMS((void));
-static MemObject *new_MemObject _PARAMS((void));
-static StoreEntry *new_StoreEntry _PARAMS((int));
+static MemObject *new_MemObject _PARAMS((const char *));
+static StoreEntry *new_StoreEntry _PARAMS((int, const char *));
 static StoreEntry *storeAddDiskRestore _PARAMS((const char *,
        int,
        int,
@@ -308,15 +305,11 @@ static hash_table *store_table = NULL;
 /* hash table for in-memory-only objects */
 static hash_table *in_mem_table = NULL;
 
-/* current memory storage size */
-unsigned long store_mem_size = 0;
-
 static int store_pages_max = 0;
 static int store_pages_high = 0;
 static int store_pages_low = 0;
 
 /* current file name, swap file, use number as a filename */
-int store_swap_size = 0;       /* kilobytes !! */
 static int store_swap_high = 0;
 static int store_swap_low = 0;
 static int storelog_fd = -1;
@@ -332,29 +325,30 @@ static int scan_revolutions;
 static struct _bucketOrder *MaintBucketsOrder = NULL;
 
 static MemObject *
-new_MemObject(void)
+new_MemObject(const char *log_url)
 {
     MemObject *mem = get_free_mem_obj();
     mem->reply = xcalloc(1, sizeof(struct _http_reply));
     mem->reply->date = -2;
     mem->reply->expires = -2;
     mem->reply->last_modified = -2;
-    mem->request = NULL;
+    mem->log_url = xstrdup(log_url);
     meta_data.mem_obj_count++;
     meta_data.misc += sizeof(struct _http_reply);
+    meta_data.url_strings += strlen(log_url);
     debug(20, 3) ("new_MemObject: returning %p\n", mem);
     return mem;
 }
 
 static StoreEntry *
-new_StoreEntry(int mem_obj_flag)
+new_StoreEntry(int mem_obj_flag, const char *log_url)
 {
     StoreEntry *e = NULL;
 
     e = xcalloc(1, sizeof(StoreEntry));
     meta_data.store_entries++;
     if (mem_obj_flag)
-       e->mem_obj = new_MemObject();
+       e->mem_obj = new_MemObject(log_url);
     debug(20, 3) ("new_StoreEntry: returning %p\n", e);
     return e;
 }
@@ -364,9 +358,11 @@ destroy_MemObject(MemObject * mem)
 {
     debug(20, 3) ("destroy_MemObject: destroying %p\n", mem);
     destroy_MemObjectData(mem);
+    meta_data.url_strings -= strlen(mem->log_url);
     safe_free(mem->clients);
     safe_free(mem->reply);
     safe_free(mem->e_abort_msg);
+    safe_free(mem->log_url);
     requestUnlink(mem->request);
     mem->request = NULL;
     put_free_mem_obj(mem);
@@ -492,6 +488,11 @@ storeLog(int tag, const StoreEntry * e)
        return;
     if (mem == NULL)
        return;
+    if (mem->log_url == NULL) {
+       debug(20, 1) ("storeLog: NULL log_url for %s\n", e->url);
+       storeMemObjectDump(mem);
+       mem->log_url = xstrdup(e->url);
+    }
     reply = mem->reply;
     sprintf(logmsg, "%9d.%03d %-7s %08X %4d %9d %9d %9d %s %d/%d %s %s\n",
        (int) current_time.tv_sec,
@@ -506,7 +507,7 @@ storeLog(int tag, const StoreEntry * e)
        reply->content_length,
        mem->e_current_len - mem->reply->hdr_sz,
        RequestMethodStr[e->method],
-       e->key);
+       mem->log_url);
     file_write(storelog_fd,
        xstrdup(logmsg),
        strlen(logmsg),
@@ -595,7 +596,7 @@ storeGet(const char *url)
     return (StoreEntry *) hash_lookup(store_table, url);
 }
 
-unsigned int
+static unsigned int
 getKeyCounter(void)
 {
     static unsigned int key_counter = 0;
@@ -715,13 +716,13 @@ storeSetPublicKey(StoreEntry * e)
 }
 
 StoreEntry *
-storeCreateEntry(const char *url, int flags, method_t method)
+storeCreateEntry(const char *url, const char *log_url, int flags, method_t method)
 {
     StoreEntry *e = NULL;
     MemObject *mem = NULL;
     debug(20, 3) ("storeCreateEntry: '%s' icp flags=%x\n", url, flags);
 
-    e = new_StoreEntry(WITH_MEMOBJ);
+    e = new_StoreEntry(WITH_MEMOBJ, log_url);
     e->lock_count = 1;         /* Note lock here w/o calling storeLock() */
     mem = e->mem_obj;
     e->url = xstrdup(url);
@@ -770,7 +771,7 @@ storeAddDiskRestore(const char *url, int file_number, int size, time_t expires,
     /* if you call this you'd better be sure file_number is not 
      * already in use! */
     meta_data.url_strings += strlen(url);
-    e = new_StoreEntry(WITHOUT_MEMOBJ);
+    e = new_StoreEntry(WITHOUT_MEMOBJ, NULL);
     e->url = xstrdup(url);
     e->method = METHOD_GET;
     storeSetPublicKey(e);
@@ -1035,7 +1036,7 @@ storeSwapInStart(StoreEntry * e, SIH * callback, void *callback_data)
     assert(e->swap_status == SWAP_OK);
     assert(e->swap_file_number >= 0);
     assert(e->mem_obj == NULL);
-    e->mem_obj = new_MemObject();
+    e->mem_obj = new_MemObject(urlClean(e->url));
     ctrlp = xmalloc(sizeof(swapin_ctrl_t));
     ctrlp->e = e;
     ctrlp->callback = callback;
@@ -2529,7 +2530,9 @@ storeRotateLog(void)
     int i;
     LOCAL_ARRAY(char, from, MAXPATHLEN);
     LOCAL_ARRAY(char, to, MAXPATHLEN);
+#ifdef S_ISREG
     struct stat sb;
+#endif
 
     if (storelog_fd > -1) {
        file_close(storelog_fd);
@@ -2754,3 +2757,50 @@ storeUnregisterAbort(StoreEntry * e)
     assert(mem);
     mem->abort.callback = NULL;
 }
+
+void
+storeMemObjectDump(MemObject * mem)
+{
+    debug(20, 1) ("MemObject->data: %p\n",
+       mem->data);
+    debug(20, 1) ("MemObject->e_swap_buf: %p %s\n",
+       mem->e_swap_buf,
+       checkNullString(mem->e_swap_buf));
+    debug(20, 1) ("MemObject->w_rtt: %d\n",
+       mem->w_rtt);
+    debug(20, 1) ("MemObject->e_pings_closest_parent: %p\n",
+       mem->e_pings_closest_parent);
+    debug(20, 1) ("MemObject->p_rtt: %d\n",
+       mem->p_rtt);
+    debug(20, 1) ("MemObject->start_ping: %d.%06d\n",
+       mem->start_ping.tv_sec,
+       mem->start_ping.tv_usec);
+    debug(20, 1) ("MemObject->e_swap_buf_len: %d\n",
+       mem->e_swap_buf_len);
+    debug(20, 1) ("MemObject->pending_list_size: %d\n",
+       mem->pending_list_size);
+    debug(20, 1) ("MemObject->e_abort_msg: %p %s\n",
+       mem->e_abort_msg,
+       checkNullString(mem->e_abort_msg));
+    debug(20, 1) ("MemObject->abort_code: %d %s\n",
+       mem->abort_code, log_tags[mem->abort_code]);
+    debug(20, 1) ("MemObject->e_current_len: %d\n",
+       mem->e_current_len);
+    debug(20, 1) ("MemObject->e_lowest_offset: %d\n",
+       mem->e_lowest_offset);
+    debug(20, 1) ("MemObject->clients: %p\n",
+       mem->clients);
+    debug(20, 1) ("MemObject->nclients: %d\n",
+       mem->nclients);
+    debug(20, 1) ("MemObject->swapin_fd: %d\n",
+       mem->swapin_fd);
+    debug(20, 1) ("MemObject->swapout_fd: %d\n",
+       mem->swapout_fd);
+    debug(20, 1) ("MemObject->reply: %p\n",
+       mem->reply);
+    debug(20, 1) ("MemObject->request: %p\n",
+       mem->request);
+    debug(20, 1) ("MemObject->log_url: %p %s\n",
+       mem->log_url,
+       checkNullString(mem->log_url));
+}
index 1d8561f372424e56c11e0eca338f69096b5face9..7470c0c273b7ddde41d56832956939b03ff4e88e 100644 (file)
@@ -207,6 +207,7 @@ struct _SquidConfig {
        int anonymizer;
        int client_db;
        int query_icmp;
+       int icp_hit_stale;
     } Options;
     struct _acl *aclList;
     struct {
@@ -230,6 +231,7 @@ struct _SquidConfig {
        int n_allocated;
        int n_configured;
     } cacheSwap;
+    char *fake_ua;
 };
 
 struct _SquidConfig2 {
@@ -435,6 +437,7 @@ struct _clientHttpRequest {
     ConnStateData *conn;
     request_t *request;                /* Parsed URL ... */
     char *url;
+    char *log_url;
     struct {
        char *buf;
        int offset;
@@ -550,6 +553,7 @@ struct _peer {
     int rr_count;
     struct _peer *next;
     int ip_lookup_pending;
+    int ck_conn_event_pend;
     int test_fd;
 };
 
@@ -741,6 +745,7 @@ struct _MemObject {
        STABH *callback;
        void *data;
     } abort;
+    char *log_url;
 };
 
 /* A cut down structure for store manager */
index 0a4ccbf2f18df4d030da7004464e25bdf556cb31..f0a8bc5f9e875652113902b5bc74c89d1e9b9748 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.116 1997/07/15 23:23:37 wessels Exp $
+ * $Id: tools.cc,v 1.117 1997/07/16 20:32:21 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -137,12 +137,12 @@ releaseServerSockets(void)
     /* Release the main ports as early as possible */
     for (i = 0; i < NHttpSockets; i++) {
        if (HttpSockets[i] >= 0)
-           (void) close(HttpSockets[i]);
+           close(HttpSockets[i]);
     }
     if (theInIcpConnection >= 0)
-       (void) close(theInIcpConnection);
+       close(theInIcpConnection);
     if (theOutIcpConnection >= 0 && theOutIcpConnection != theInIcpConnection)
-       (void) close(theOutIcpConnection);
+       close(theOutIcpConnection);
 }
 
 static char *
@@ -175,7 +175,14 @@ mail_warranty(void)
 static void
 dumpMallocStats()
 {
-#if HAVE_MALLINFO
+#if HAVE_MSTATS && HAVE_GNUMALLOC_H
+    struct mstats ms = mstats();
+    fprintf(debug_log, "\ttotal space in arena:  %6d KB\n",
+       ms.bytes_total >> 10);
+    fprintf(debug_log, "\tTotal free:            %6d KB %d%%\n",
+       ms.bytes_free >> 10,
+       percent(ms.bytes_free, ms.bytes_total));
+#elif HAVE_MALLINFO
     struct mallinfo mp;
     int t;
     if (!do_mallinfo)
@@ -675,7 +682,7 @@ setMaxFD(void)
 #if HAVE_SETRLIMIT && defined(RLIMIT_DATA)
     if (getrlimit(RLIMIT_DATA, &rl) < 0) {
        debug(50, 0) ("getrlimit: RLIMIT_DATA: %s\n", xstrerror());
-    } else {
+    } else if (rl.rlim_max > rl.rlim_cur) {
        rl.rlim_cur = rl.rlim_max;      /* set it to the max */
        if (setrlimit(RLIMIT_DATA, &rl) < 0) {
            sprintf(tmp_error_buf, "setrlimit: RLIMIT_DATA: %s", xstrerror());
@@ -686,7 +693,7 @@ setMaxFD(void)
 #if HAVE_SETRLIMIT && defined(RLIMIT_VMEM)
     if (getrlimit(RLIMIT_VMEM, &rl) < 0) {
        debug(50, 0) ("getrlimit: RLIMIT_VMEM: %s\n", xstrerror());
-    } else {
+    } else if (rl.rlim_max > rl.rlim_cur) {
        rl.rlim_cur = rl.rlim_max;      /* set it to the max */
        if (setrlimit(RLIMIT_VMEM, &rl) < 0) {
            sprintf(tmp_error_buf, "setrlimit: RLIMIT_VMEM: %s", xstrerror());
@@ -724,7 +731,7 @@ squid_signal(int sig, void (*func) _PARAMS((int)), int flags)
     if (sigaction(sig, &sa, NULL) < 0)
        debug(50, 0) ("sigaction: sig=%d func=%p: %s\n", sig, func, xstrerror());
 #else
-    (void) signal(sig, func);
+    signal(sig, func);
 #endif
 }
 
@@ -735,6 +742,7 @@ inaddrFromHostent(const struct hostent *hp)
     xmemcpy(&s.s_addr, hp->h_addr, sizeof(s.s_addr));
     return s;
 }
+
 double
 doubleAverage(double cur, double new, int n, int max)
 {
@@ -759,3 +767,9 @@ logsFlush(void)
     if (cache_useragent_log)
        fflush(cache_useragent_log);
 }
+
+char *
+checkNullString(char *p)
+{
+    return p ? p : "(NULL)";
+}
index 911eef8ab7be3259df9b6923bd538c243a27a487..10bf072700f9a8289c76733809f363609e1817be 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.57 1997/07/16 04:48:31 wessels Exp $
+ * $Id: tunnel.cc,v 1.58 1997/07/16 20:32:17 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -42,8 +42,7 @@ typedef struct {
        int offset;
        char *buf;
     } client, server;
-    time_t timeout;
-    int *size_ptr;             /* pointer to size in an ConnStateData for logging */
+    size_t *size_ptr;          /* pointer to size in an ConnStateData for logging */
     int proxying;
 } SslStateData;
 
@@ -102,12 +101,6 @@ sslStateFree(int fd, void *data)
        return;
     if (fd != sslState->server.fd)
        fatal_dump("sslStateFree: FD mismatch!\n");
-    if (sslState->client.fd > -1) {
-       commSetSelect(sslState->client.fd,
-           COMM_SELECT_READ,
-           NULL,
-           NULL, 0);
-    }
     safe_free(sslState->server.buf);
     safe_free(sslState->client.buf);
     xfree(sslState->url);
@@ -135,6 +128,10 @@ sslReadServer(int fd, void *data)
                COMM_SELECT_READ,
                sslReadServer,
                sslState, 0);
+           commSetTimeout(sslState->server.fd,
+               Config.Timeout.read,
+               NULL,
+               NULL);
        } else {
            sslClose(sslState);
        }
@@ -219,6 +216,10 @@ sslWriteServer(int fd, void *data)
            COMM_SELECT_READ,
            sslReadClient,
            sslState, 0);
+       commSetTimeout(sslState->server.fd,
+           Config.Timeout.read,
+           NULL,
+           NULL);
     } else {
        /* still have more to write */
        commSetSelect(sslState->server.fd,
@@ -264,6 +265,10 @@ sslWriteClient(int fd, void *data)
            COMM_SELECT_READ,
            sslReadServer,
            sslState, 0);
+       commSetTimeout(sslState->server.fd,
+           Config.Timeout.read,
+           NULL,
+           NULL);
     } else {
        /* still have more to write */
        commSetSelect(sslState->client.fd,
@@ -390,7 +395,6 @@ sslStart(int fd, const char *url, request_t * request, int *size_ptr)
     cbdataAdd(sslState);
     sslState->url = xstrdup(url);
     sslState->request = requestLink(request);
-    sslState->timeout = Config.Timeout.read;
     sslState->size_ptr = size_ptr;
     sslState->client.fd = fd;
     sslState->server.fd = sock;
@@ -431,6 +435,10 @@ sslProxyConnected(int fd, void *data)
        COMM_SELECT_READ,
        sslReadServer,
        sslState, 0);
+    commSetTimeout(sslState->server.fd,
+       Config.Timeout.read,
+       NULL,
+       NULL);
 }
 
 static void
index 9cf268c8a47ff1ca11bb688f48a0f4604897ab09..8ad480251955c4efee57896d04c55b0a8a8ed0d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unlinkd.cc,v 1.8 1997/07/15 05:34:14 wessels Exp $
+ * $Id: unlinkd.cc,v 1.9 1997/07/16 20:32:21 wessels Exp $
  *
  * DEBUG: section 43    Unlink Daemon
  * AUTHOR: Duane Wessels
@@ -35,6 +35,10 @@ static char hello_string[] = "hi there\n";
 /* This is the external unlinkd process */
 
 #include "config.h"
+
+#if HAVE_LIBC_H
+#include <libc.h>
+#endif
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
index beb7f972c853e1e9ae6bc9ba494efb1e86a9e5cb..1f12b09e1c77699d780e94d7f4e4d344b0f54ec4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: url.cc,v 1.59 1997/06/21 02:38:19 wessels Exp $
+ * $Id: url.cc,v 1.60 1997/07/16 20:32:22 wessels Exp $
  *
  * DEBUG: section 23    URL Parsing
  * AUTHOR: Duane Wessels
@@ -298,6 +298,45 @@ urlCanonical(const request_t * request, char *buf)
     return buf;
 }
 
+char *
+urlCanonicalClean(const request_t * request)
+{
+    LOCAL_ARRAY(char, buf, MAX_URL);
+    LOCAL_ARRAY(char, portbuf, 32);
+    char *t;
+    switch (request->method) {
+    case METHOD_CONNECT:
+       sprintf(buf, "%s:%d", request->host, request->port);
+       break;
+    default:
+       portbuf[0] = '\0';
+       if (request->port != urlDefaultPort(request->protocol))
+           sprintf(portbuf, ":%d", request->port);
+       sprintf(buf, "%s://%s%s%s",
+           ProtocolStr[request->protocol],
+           request->host,
+           portbuf,
+           request->urlpath);
+       if ((t = strchr(buf, '?')))
+           *t = '\0';
+       break;
+    }
+    return buf;
+}
+
+char *
+urlClean(char *dirty)
+{
+    char *clean;
+    request_t *r = urlParse(METHOD_GET, dirty);
+    if (r == NULL)
+       return dirty;
+    clean = urlCanonicalClean(r);
+    put_free_request_t(r);
+    return clean;
+}
+
+
 request_t *
 requestLink(request_t * request)
 {
@@ -342,6 +381,8 @@ urlCheckRequest(const request_t * r)
        return 1;
     if (r->method == METHOD_TRACE)
        return 1;
+    if (r->method == METHOD_PURGE)
+       return 1;
     switch (r->protocol) {
     case PROTO_HTTP:
     case PROTO_CACHEOBJ: