+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
==============================================================================
+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.
errno.h \
fcntl.h \
getopt.h \
+ gnumalloc.h \
grp.h \
libc.h \
limits.h \
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*
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() {
; 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
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
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>
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
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>
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
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>
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
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
{ 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()
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
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
{ 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()
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
# 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
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__
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
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
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. */
; 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
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
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2069 "configure"
+#line 2070 "configure"
#include "confdefs.h"
find_stack_direction ()
{
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
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
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
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
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
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
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
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
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
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
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
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
;;
*)
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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]*//'`"
memcpy \
memmove \
mktime \
+ mstats \
poll \
random \
regcomp \
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. */
; 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
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
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. */
; 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
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
}
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
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>
}
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
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>
}
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
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>
}
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
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>
}
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
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>
}
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
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
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
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)
errno.h \
fcntl.h \
getopt.h \
+ gnumalloc.h \
grp.h \
libc.h \
limits.h \
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]]*//'`"
memcpy \
memmove \
mktime \
+ mstats \
poll \
random \
regcomp \
--- /dev/null
+#!/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"
+}
* 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
/* 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
/*
- * $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
*
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));
/*
- * $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
#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
#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
/*
- * $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
(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
--- /dev/null
+#!/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;
+}
/*
- * $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
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));
}
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);
/*
- * $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
printf("\n</PRE>\n");
print_trailer();
- (void) close(conn);
+ close(conn);
exit(0);
/* NOTREACHED */
return 0;
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
# 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
-
/*
- * $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
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);
}
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;
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 */
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);
/*
- * $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
{
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,
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;
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");
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 */
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 */
-
/*
- * $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
/*
- * $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
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;
#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
+
/*
- * $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
/*
- * $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
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;
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) {
/*
- * $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
{"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."},
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)
{
"<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"
"<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"
{
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\
<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>\
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 */
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;
/*
- * $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
request[0] = '\0';
} else {
/* convert %xx to char */
- (void) url_convert_hex(request, 0);
+ url_convert_hex(request, 0);
}
host[0] = '\0';
/*
- * $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
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 *));
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 */
}
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);
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);
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) {
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);
/*
- * $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
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;
/*
- * $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
return 0;
if (i->expires > squid_curtime)
return 0;
+ if (i->status == IP_CACHED)
+ if (squid_curtime - i->lastref < 60)
+ return 0;
return 1;
}
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")) {
/*
- * $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
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);
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)
int n; /* # of GC'd objects */
time_t loop_delay;
+ debug_log = stderr;
if (FD_SETSIZE < Squid_MaxFD)
Squid_MaxFD = FD_SETSIZE;
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();
fd_open(1, FD_LOG, "stdout");
fd_open(2, FD_LOG, "stderr");
- /* preinit for debug module */
- debug_log = stderr;
hash_init(0);
mainInitialize();
/*
- * $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
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)
{
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)
{
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)
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);
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);
}
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;
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));
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 *));
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 */
/* ----------------------------------------------------------------- */
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));
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 *,...));
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 *,
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));
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));
/*
- * $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
*
#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
/*
- * $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
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;
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);
COMM_SELECT_READ,
sslReadServer,
sslState, 0);
+ commSetTimeout(sslState->server.fd,
+ Config.Timeout.read,
+ NULL,
+ NULL);
} else {
sslClose(sslState);
}
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,
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,
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;
COMM_SELECT_READ,
sslReadServer,
sslState, 0);
+ commSetTimeout(sslState->server.fd,
+ Config.Timeout.read,
+ NULL,
+ NULL);
}
static void
/*
- * $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;
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
{
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);
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);
#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);
/*
- * $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
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 **));
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,
/* 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;
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;
}
{
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);
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,
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),
return (StoreEntry *) hash_lookup(store_table, url);
}
-unsigned int
+static unsigned int
getKeyCounter(void)
{
static unsigned int key_counter = 0;
}
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);
/* 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);
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;
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);
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));
+}
int anonymizer;
int client_db;
int query_icmp;
+ int icp_hit_stale;
} Options;
struct _acl *aclList;
struct {
int n_allocated;
int n_configured;
} cacheSwap;
+ char *fake_ua;
};
struct _SquidConfig2 {
ConnStateData *conn;
request_t *request; /* Parsed URL ... */
char *url;
+ char *log_url;
struct {
char *buf;
int offset;
int rr_count;
struct _peer *next;
int ip_lookup_pending;
+ int ck_conn_event_pend;
int test_fd;
};
STABH *callback;
void *data;
} abort;
+ char *log_url;
};
/* A cut down structure for store manager */
/*
- * $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
/* 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 *
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)
#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());
#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());
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
}
xmemcpy(&s.s_addr, hp->h_addr, sizeof(s.s_addr));
return s;
}
+
double
doubleAverage(double cur, double new, int n, int max)
{
if (cache_useragent_log)
fflush(cache_useragent_log);
}
+
+char *
+checkNullString(char *p)
+{
+ return p ? p : "(NULL)";
+}
/*
- * $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
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;
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);
COMM_SELECT_READ,
sslReadServer,
sslState, 0);
+ commSetTimeout(sslState->server.fd,
+ Config.Timeout.read,
+ NULL,
+ NULL);
} else {
sslClose(sslState);
}
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,
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,
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;
COMM_SELECT_READ,
sslReadServer,
sslState, 0);
+ commSetTimeout(sslState->server.fd,
+ Config.Timeout.read,
+ NULL,
+ NULL);
}
static void
/*
- * $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
/* 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
/*
- * $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
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)
{
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: