- Added the EINTR error response to handle badly interrupted
system calls (Stewart Forster).
+==============================================================================
-Changes to squid-1.1.7 (February 25 1997):
+Changes to squid-1.1.8 (March 3, 1997):
+
+ - Fixed neighborsUdpAck() coredump bug for source-ping and
+ non-peer ICP replies.
+ - Prevent ipcache_gethostbyname from changing an IP_DISPATCHED
+ entry to IP_CACHED; fqdncache too.
+ - Made send_announce non-blocking.
+ - Force release of negative-cached objects upon receipt of
+ no-cache request.
+ - Ignore ACLs which fail to parse.
+ - Added 'proxy_auth_ignore' regular expression list (Andreas
+ Lamprecht).
+ - Changed how failed TCP connections affects peer up/down
+ status. Now retry TCP connections at regular intervals in the
+ background and don't mark the peer as 'up' until a connection
+ succeeds.
+ - Okay to increase FD_SETSIZE on FreeBSD 2.2.x (Peter Wemm).
+ - Fixed HTTP anonymizer bug in 'standard' mode.
+ - Fixed aclMatchDomainList() coredump for unresolvable addresses.
+ - Changed default disk low/high water marks to 90/95%.
+ - Prevent ftpget buffer overflow (Riku Saikkonen).
+
+Changes to squid-1.1.7 (February 25, 1997):
- Fixed urlParse to leave trailing slashes on FTP URLs. Although
stripping the slashes offers a slight hit rate increase, it
-# From configure.in Revision: 1.68
+# From configure.in Revision: 1.69.2.2
ac_aux_dir=
for ac_dir in aux $srcdir/aux; do
if test -f $ac_dir/install-sh; then
pwd.h \
regex.h \
resolv.h \
- shadow.h \
signal.h \
stdarg.h \
stddef.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1528: checking for $ac_hdr" >&5
+echo "configure:1527: 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 1533 "configure"
+#line 1532 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1537: \"$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:1566: checking for working const" >&5
+echo "configure:1565: 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 1571 "configure"
+#line 1570 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1619: \"$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:1642: checking if ANSI prototypes work" >&5
+echo "configure:1641: checking if ANSI prototypes work" >&5
cat > conftest.$ac_ext <<EOF
-#line 1644 "configure"
+#line 1643 "configure"
#include "confdefs.h"
int foo(char *); int foo (char *bar) {return 1;}
int main() {
foo("bar")
; return 0; }
EOF
-if { (eval echo configure:1651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1650: \"$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:1667: checking for tm->tm_gmtoff" >&5
+echo "configure:1666: checking for tm->tm_gmtoff" >&5
cat > conftest.$ac_ext <<EOF
-#line 1669 "configure"
+#line 1668 "configure"
#include "confdefs.h"
#include <time.h>
#include <sys/time.h>
foo.tm_gmtoff = 0;
; return 0; }
EOF
-if { (eval echo configure:1678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1677: \"$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:1694: checking for extended mallinfo" >&5
+echo "configure:1693: checking for extended mallinfo" >&5
cat > conftest.$ac_ext <<EOF
-#line 1696 "configure"
+#line 1695 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <malloc.h>
foo.mxfast = 0;
; return 0; }
EOF
-if { (eval echo configure:1705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1704: \"$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:1721: checking for ip->ip_hl" >&5
+echo "configure:1720: checking for ip->ip_hl" >&5
cat > conftest.$ac_ext <<EOF
-#line 1723 "configure"
+#line 1722 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <netinet/in.h>
ip.ip_hl= 0;
; return 0; }
EOF
-if { (eval echo configure:1734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1733: \"$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:1750: checking size of int" >&5
+echo "configure:1749: 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 1758 "configure"
+#line 1757 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:1769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1768: \"$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:1789: checking size of long" >&5
+echo "configure:1788: 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 1797 "configure"
+#line 1796 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:1808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1807: \"$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:1831: checking for working alloca.h" >&5
+echo "configure:1830: 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 1836 "configure"
+#line 1835 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1842: \"$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:1864: checking for alloca" >&5
+echo "configure:1863: 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 1869 "configure"
+#line 1868 "configure"
#include "confdefs.h"
#ifdef __GNUC__
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1891: \"$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:1924: checking whether alloca needs Cray hooks" >&5
+echo "configure:1923: 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 1929 "configure"
+#line 1928 "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:1954: checking for $ac_func" >&5
+echo "configure:1953: 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 1959 "configure"
+#line 1958 "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:1982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1981: \"$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:2009: checking stack direction for C alloca" >&5
+echo "configure:2008: 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 2017 "configure"
+#line 2016 "configure"
#include "confdefs.h"
find_stack_direction ()
{
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2035: \"$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:2059: checking for pid_t" >&5
+echo "configure:2058: 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 2064 "configure"
+#line 2063 "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:2092: checking for size_t" >&5
+echo "configure:2091: 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 2097 "configure"
+#line 2096 "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:2125: checking for off_t" >&5
+echo "configure:2124: 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 2130 "configure"
+#line 2129 "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:2158: checking for mode_t" >&5
+echo "configure:2157: 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 2163 "configure"
+#line 2162 "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:2192: checking for main in -lnsl" >&5
+echo "configure:2191: 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 2200 "configure"
+#line 2199 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2206: \"$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:2235: checking for main in -lsocket" >&5
+echo "configure:2234: 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 2243 "configure"
+#line 2242 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2249: \"$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:2278: checking for main in -lgnumalloc" >&5
+echo "configure:2277: 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 2286 "configure"
+#line 2285 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2292: \"$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:2330: checking for main in -lmalloc" >&5
+echo "configure:2329: 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 2338 "configure"
+#line 2337 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2344: \"$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:2376: checking for main in -lbsd" >&5
+echo "configure:2375: 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 2384 "configure"
+#line 2383 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2390: \"$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:2419: checking for main in -lregex" >&5
+echo "configure:2418: 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 2427 "configure"
+#line 2426 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2433: \"$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:2455: checking for inet_aton in -lresolv" >&5
+echo "configure:2454: 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 2463 "configure"
+#line 2462 "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:2474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2473: \"$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:2490: checking for inet_aton in -l44bsd" >&5
+echo "configure:2489: 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 2498 "configure"
+#line 2497 "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:2509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2508: \"$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:2541: checking for main in -lresolv" >&5
+echo "configure:2540: 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 2549 "configure"
+#line 2548 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2555: \"$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:2584: checking for main in -lm" >&5
+echo "configure:2583: 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 2592 "configure"
+#line 2591 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2598: \"$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:2628: checking for crypt in -lcrypt" >&5
+echo "configure:2627: 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 2636 "configure"
+#line 2635 "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:2647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2646: \"$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 -lshadow""... $ac_c" 1>&6
-echo "configure:2670: checking for main in -lshadow" >&5
-ac_lib_var=`echo shadow'_'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
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lshadow $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2678 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo shadow | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lshadow $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
case "$host" in
i386-*-solaris2.?)
if test "$GCC" = "yes"; then
memmove \
mktime \
poll \
- pw_encrypt \
random \
regcomp \
regexec \
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2793: checking for $ac_func" >&5
+echo "configure:2747: 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 2798 "configure"
+#line 2752 "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:2821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2775: \"$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:2847: checking if GNUregex needs to be compiled" >&5
+echo "configure:2801: 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:2879: checking for $ac_func" >&5
+echo "configure:2833: 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 2884 "configure"
+#line 2838 "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:2907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2861: \"$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:2889: checking Default FD_SETSIZE value" >&5
+if test "$cross_compiling" = yes; then
+ DEFAULT_FD_SETSIZE=256
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2894 "configure"
+#include "confdefs.h"
+
+#if HAVE_STDIO_H
+#include <stdio.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+main() {
+ fprintf (fopen("conftestval", "w"), "%d\n", FD_SETSIZE);
+ exit(0);
+}
+
+EOF
+if { (eval echo configure:2918: \"$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 "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ DEFAULT_FD_SETSIZE=256
+fi
+rm -fr conftest*
+fi
+
+echo "$ac_t""$DEFAULT_FD_SETSIZE" 1>&6
+cat >> confdefs.h <<EOF
+#define DEFAULT_FD_SETSIZE $DEFAULT_FD_SETSIZE
+EOF
+
+
echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6
-echo "configure:2935: checking Maximum number of filedescriptors we can open" >&5
+echo "configure:2937: 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 2940 "configure"
+#line 2942 "configure"
#include "confdefs.h"
#include <stdio.h>
}
EOF
-if { (eval echo configure:2992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2994: \"$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:3011: checking Default UDP send buffer size" >&5
+echo "configure:3013: 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 3016 "configure"
+#line 3018 "configure"
#include "confdefs.h"
#include <stdlib.h>
}
EOF
-if { (eval echo configure:3035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3037: \"$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:3054: checking Default UDP receive buffer size" >&5
+echo "configure:3056: 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 3059 "configure"
+#line 3061 "configure"
#include "confdefs.h"
#include <stdlib.h>
}
EOF
-if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3080: \"$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:3097: checking Default TCP send buffer size" >&5
+echo "configure:3099: 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 3102 "configure"
+#line 3104 "configure"
#include "confdefs.h"
#include <stdlib.h>
}
EOF
-if { (eval echo configure:3121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3123: \"$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:3140: checking Default TCP receive buffer size" >&5
+echo "configure:3142: 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 3145 "configure"
+#line 3147 "configure"
#include "confdefs.h"
#include <stdlib.h>
}
EOF
-if { (eval echo configure:3164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3166: \"$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:3183: checking if sys_errlist is already defined" >&5
+echo "configure:3185: checking if sys_errlist is already defined" >&5
cat > conftest.$ac_ext <<EOF
-#line 3185 "configure"
+#line 3187 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
char *s = sys_errlist[0];
; return 0; }
EOF
-if { (eval echo configure:3192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3194: \"$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:3208: checking for libresolv _dns_ttl_ hack" >&5
+echo "configure:3210: checking for libresolv _dns_ttl_ hack" >&5
cat > conftest.$ac_ext <<EOF
-#line 3210 "configure"
+#line 3212 "configure"
#include "confdefs.h"
extern int _dns_ttl_;
int main() {
return _dns_ttl_;
; return 0; }
EOF
-if { (eval echo configure:3217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3219: \"$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.69 1997/02/23 09:07:30 wessels Exp $
+dnl $Id: configure.in,v 1.70 1997/03/04 05:16:21 wessels Exp $
dnl
dnl
dnl
AC_INIT(src/main.c)
AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.69 $)dnl
+AC_REVISION($Revision: 1.70 $)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AC_CONFIG_AUX_DIR(aux)
pwd.h \
regex.h \
resolv.h \
- shadow.h \
signal.h \
stdarg.h \
stddef.h \
AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
AC_SUBST(CRYPTLIB)
-dnl Check for libshadow which is needed by the shadow password suite
-AC_CHECK_LIB(shadow, main)
-
dnl System-specific library modifications
dnl
case "$host" in
memmove \
mktime \
poll \
- pw_encrypt \
random \
regcomp \
regexec \
strerror \
)
+AC_MSG_CHECKING(Default FD_SETSIZE value)
+AC_TRY_RUN([
+#if HAVE_STDIO_H
+#include <stdio.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+main() {
+ fprintf (fopen("conftestval", "w"), "%d\n", FD_SETSIZE);
+ exit(0);
+}
+],
+DEFAULT_FD_SETSIZE=`cat conftestval`,
+DEFAULT_FD_SETSIZE=256,
+DEFAULT_FD_SETSIZE=256)
+AC_MSG_RESULT($DEFAULT_FD_SETSIZE)
+AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE)
+
AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
AC_TRY_RUN([
#include <stdio.h>
/* Define if struct mallinfo has mxfast member */
#undef HAVE_EXT_MALLINFO
+/* Default FD_SETSIZE value */
+#undef DEFAULT_FD_SETSIZE
+
/* Maximum number of open filedescriptors */
#undef SQUID_MAXFD
/* Define if you have the poll function. */
#undef HAVE_POLL
-/* Define if you have the pw_encrypt function. */
-#undef HAVE_PW_ENCRYPT
-
/* Define if you have the random function. */
#undef HAVE_RANDOM
/* Define if you have the <resolv.h> header file. */
#undef HAVE_RESOLV_H
-/* Define if you have the <shadow.h> header file. */
-#undef HAVE_SHADOW_H
-
/* Define if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define if you have the resolv library (-lresolv). */
#undef HAVE_LIBRESOLV
-/* Define if you have the shadow library (-lshadow). */
-#undef HAVE_LIBSHADOW
-
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
-/* $Id: version.h,v 1.77 1997/02/20 21:13:12 wessels Exp $
+/* $Id: version.h,v 1.78 1997/03/04 05:16:22 wessels Exp $
*
* SQUID_VERSION - String for version id of this distribution
*/
#ifndef SQUID_VERSION
-#define SQUID_VERSION "1.1.7"
+#define SQUID_VERSION "1.1.8"
#endif
#ifndef SQUID_RELEASE_TIME
$url = "http://$url/" if ($url =~ /^[-\w\.]+$/);
print "Querying cache path to $url\n";
-$host = $1 if ($url =~ /^[^:]+:\/\/([^\/:])+/);
+$host = $1 if ($url =~ /^[^:]+:\/\/([^\/:]+)/);
$sockaddr = 'S n a4 x8';
($name, $aliases, $proto) = getprotobyname("tcp");
/*
- * $Id: acl.cc,v 1.89 1997/03/02 05:34:45 wessels Exp $
+ * $Id: acl.cc,v 1.90 1997/03/04 05:16:24 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
/* Global */
const char *AclMatchedName = NULL;
-/* for reading ACL's from files */
-int aclFromFile = 0;
-FILE *aclFile;
-
static struct _acl *AclList = NULL;
static struct _acl **AclListTail = &AclList;
static const char *const w_space = " \t\n\r"; /* Jasper sez so */
+static int aclFromFile = 0;
+static FILE *aclFile;
static void aclDestroyAclList _PARAMS((struct _acl_list * list));
static void aclDestroyTimeList _PARAMS((struct _acl_time_data * data));
static void aclParseProtoList _PARAMS((void *curlist));
static void aclParseMethodList _PARAMS((void *curlist));
static void aclParseTimeSpec _PARAMS((void *curlist));
+static char *strtokFile _PARAMS((void));
-char *
+static char *
strtokFile(void)
{
char *t, *fn;
LOCAL_ARRAY(char, addr2, 256);
LOCAL_ARRAY(char, mask, 256);
struct _acl_ip_data *q = xcalloc(1, sizeof(struct _acl_ip_data));
+ debug(28, 5, "aclParseIpData: %s\n", t);
if (!strcasecmp(t, "all")) {
q->addr1.s_addr = 0;
q->addr2.s_addr = 0;
if (sscanf(t, "%d:%d-%d:%d", &h1, &m1, &h2, &m2) < 4) {
debug(28, 0, "%s line %d: %s\n",
cfg_filename, config_lineno, config_input_line);
- debug(28, 0, "aclParseTimeSpec: Bad time range '%s'\n",
- t);
+ debug(28, 0, "aclParseTimeSpec: IGNORING Bad time range\n");
xfree(q);
return;
}
if (q->start > q->stop) {
debug(28, 0, "%s line %d: %s\n",
cfg_filename, config_lineno, config_input_line);
- debug(28, 0, "aclParseTimeSpec: Reversed time range '%s'\n",
- t);
+ debug(28, 0, "aclParseTimeSpec: IGNORING Reversed time range\n");
xfree(q);
return;
}
struct _acl *A = NULL;
LOCAL_ARRAY(char, aclname, ACL_NAME_SZ);
squid_acl acltype;
+ int new_acl = 0;
/* snarf the ACL name */
if ((t = strtok(NULL, w_space)) == NULL) {
xstrncpy(A->name, aclname, ACL_NAME_SZ);
A->type = acltype;
A->cfgline = xstrdup(config_input_line);
- *AclListTail = A;
- AclListTail = &A->next;
+ new_acl = 1;
} else {
if (acltype != A->type) {
debug(28, 0, "aclParseAclLine: ACL '%s' already exists with different type, skipping.\n", A->name);
return;
}
debug(28, 3, "aclParseAclLine: Appending to '%s'\n", aclname);
+ new_acl = 0;
}
switch (A->type) {
case ACL_SRC_IP:
debug_trap("Bad ACL type");
break;
}
+ if (!new_acl)
+ return;
+ if (A->data == NULL) {
+ debug(28, 0, "aclParseAclLine: IGNORING invalid ACL: %s\n",
+ A->cfgline);
+ xfree(A);
+ return;
+ }
+ *AclListTail = A;
+ AclListTail = &A->next;
}
/* maex@space.net (06.09.96)
static time_t last_when = 0;
static struct tm tm;
time_t t;
-
+ if (data == NULL)
+ fatal_dump("aclMatchTime: NULL data");
if (when != last_when) {
last_when = when;
xmemcpy(&tm, localtime(&when), sizeof(struct tm));
checklist->state[ACL_SRC_DOMAIN] = ACL_LOOKUP_NEED;
return 0;
} else {
- return aclMatchDomainList(acl->data, "none");
+ return aclMatchDomainList(&acl->data, "none");
}
/* NOTREACHED */
case ACL_TIME:
struct in_addr addr;
struct _acl_ip_data acl_ip;
int rc = 0;
- memcpy(&acl_ip, net, sizeof(acl_ip));
+ xmemcpy(&acl_ip, net, sizeof(acl_ip));
addr = acl_ip.addr1;
addr.s_addr &= data->mask.s_addr; /* apply netmask */
if (data->addr2.s_addr == 0) { /* single address check */
{
struct in_addr addr;
struct _acl_ip_data *data;
- memcpy(&addr, t1, sizeof(addr));
+ xmemcpy(&addr, t1, sizeof(addr));
data = (struct _acl_ip_data *) t2;
return aclIpNetworkCompare(addr, data);
}
/*
- * $Id: cache_cf.cc,v 1.175 1997/02/26 20:49:06 wessels Exp $
+ * $Id: cache_cf.cc,v 1.176 1997/03/04 05:16:24 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
#define DefaultMemHighWaterMark 90 /* 90% */
#define DefaultMemLowWaterMark 75 /* 75% */
#define DefaultSwapMaxSize (100 << 10) /* 100 MB (100*1024 kbytes) */
-#define DefaultSwapHighWaterMark 90 /* 90% */
-#define DefaultSwapLowWaterMark 75 /* 75% */
+#define DefaultSwapHighWaterMark 95 /* 95% */
+#define DefaultSwapLowWaterMark 90 /* 90% */
#define DefaultNetdbHigh 1000 /* counts, not percents */
#define DefaultNetdbLow 900
#define DefaultConnectTimeout (2 * 60) /* 2 min */
#define DefaultCleanRate -1 /* disabled */
#define DefaultDnsChildren 5 /* 5 processes */
+#define DefaultOptionsResDefnames 0 /* default off */
+#define DefaultOptionsAnonymizer 0 /* default off */
#define DefaultRedirectChildren 5 /* 5 processes */
#define DefaultMaxRequestSize (100 << 10) /* 100Kb */
#define DefaultHttpPortNum CACHE_HTTP_PORT
#define DefaultIcpPortNum CACHE_ICP_PORT
+#define DefaultLogLogFqdn 0 /* default off */
#define DefaultCacheLogFile DEFAULT_CACHE_LOG
#define DefaultAccessLogFile DEFAULT_ACCESS_LOG
#define DefaultUseragentLogFile (char *)NULL /* default NONE */
#define DefaultSwapLogFile (char *)NULL /* default swappath(0) */
#if USE_PROXY_AUTH
#define DefaultProxyAuthFile (char *)NULL /* default NONE */
-#define DefaultProxyAuthIgnoreDomain (char *)NULL /* default NONE */
#endif /* USE_PROXY_AUTH */
#define DefaultLogRotateNumber 10
#define DefaultAdminEmail "webmaster"
#define DefaultUdpIncomingAddr INADDR_ANY
#define DefaultUdpOutgoingAddr inaddr_none
#define DefaultClientNetmask 0xFFFFFFFFul
-#define DefaultSslProxyPort 0
-#define DefaultSslProxyHost (char *)NULL
+#define DefaultPassProxy NULL
+#define DefaultSslProxy NULL
#define DefaultIpcacheSize 1024
#define DefaultIpcacheLow 90
#define DefaultIpcacheHigh 95
#define DefaultLevelOneDirs 16
#define DefaultLevelTwoDirs 256
#define DefaultOptionsLogUdp 1 /* on */
+#define DefaultOptionsEnablePurge 0 /* default off */
int httpd_accel_mode = 0; /* for fast access */
const char *DefaultSwapDir = DEFAULT_SWAP_DIR;
token = strtok(NULL, w_space);
if (token == NULL)
self_destruct();
- safe_free(Config.proxyAuthFile);
- safe_free(Config.proxyAuthIgnoreDomain);
- Config.proxyAuthFile = xstrdup(token);
- if ((token = strtok(NULL, w_space)))
- Config.proxyAuthIgnoreDomain = xstrdup(token);
+ safe_free(Config.proxyAuth.File);
+ aclDestroyRegexList(Config.proxyAuth.IgnoreDomains);
+ Config.proxyAuth.IgnoreDomains = NULL;
+ Config.proxyAuth.File = xstrdup(token);
+ aclParseRegexList(&Config.proxyAuth.IgnoreDomains, 1);
}
#endif /* USE_PROXY_AUTH */
#if USE_PROXY_AUTH
else if (!strcmp(token, "proxy_auth"))
parseProxyAuthLine();
+ else if (!strcmp(token, "proxy_auth_ignore"))
+ aclParseRegexList(&Config.proxyAuth.IgnoreDomains, 1);
#endif /* USE_PROXY_AUTH */
else if (!strcmp(token, "source_ping"))
safe_free(Config.visibleHostname);
safe_free(Config.ftpUser);
#if USE_PROXY_AUTH
- safe_free(Config.proxyAuthFile);
- safe_free(Config.proxyAuthIgnoreDomain);
+ safe_free(Config.proxyAuth.File);
+ aclDestroyRegexList(Config.proxyAuth.IgnoreDomains);
+ Config.proxyAuth.IgnoreDomains = NULL;
#endif /* USE_PROXY_AUTH */
safe_free(Config.Announce.host);
safe_free(Config.Announce.file);
static void
configSetFactoryDefaults(void)
{
- memset((char *) &Config, '\0', sizeof(Config));
+ memset(&Config, '\0', sizeof(Config));
Config.Mem.maxSize = DefaultMemMaxSize;
Config.Mem.highWaterMark = DefaultMemHighWaterMark;
Config.Mem.lowWaterMark = DefaultMemLowWaterMark;
#if LOG_FULL_HEADERS
Config.logMimeHdrs = DefaultLogMimeHdrs;
#endif /* LOG_FULL_HEADERS */
+ Config.identLookup = DefaultIdentLookup;
Config.debugOptions = safe_xstrdup(DefaultDebugOptions);
Config.neighborTimeout = DefaultNeighborTimeout;
Config.stallDelay = DefaultStallDelay;
Config.effectiveGroup = safe_xstrdup(DefaultEffectiveGroup);
Config.appendDomain = safe_xstrdup(DefaultAppendDomain);
Config.errHtmlText = safe_xstrdup(DefaultErrHtmlText);
-
Config.Port.http = DefaultHttpPortNum;
Config.Port.icp = DefaultIcpPortNum;
+ Config.Log.log_fqdn = DefaultLogLogFqdn;
Config.Log.log = safe_xstrdup(DefaultCacheLogFile);
Config.Log.access = safe_xstrdup(DefaultAccessLogFile);
Config.Log.store = safe_xstrdup(DefaultStoreLogFile);
Config.pidFilename = safe_xstrdup(DefaultPidFilename);
Config.visibleHostname = safe_xstrdup(DefaultVisibleHostname);
#if USE_PROXY_AUTH
- Config.proxyAuthFile = safe_xstrdup(DefaultProxyAuthFile);
- Config.proxyAuthIgnoreDomain = safe_xstrdup(DefaultProxyAuthIgnoreDomain);
+ Config.proxyAuth.File = safe_xstrdup(DefaultProxyAuthFile);
+/* Config.proxyAuth.IgnoreDomains = safe_xstrdup(DefaultproxyAuthIgnoreDomains); */
#endif /* USE_PROXY_AUTH */
Config.ftpUser = safe_xstrdup(DefaultFtpUser);
Config.Announce.host = safe_xstrdup(DefaultAnnounceHost);
Config.Addrs.udp_outgoing.s_addr = DefaultUdpOutgoingAddr;
Config.Addrs.udp_incoming.s_addr = DefaultUdpIncomingAddr;
Config.Addrs.client_netmask.s_addr = DefaultClientNetmask;
+ Config.passProxy = DefaultPassProxy;
+ Config.sslProxy = DefaultSslProxy;
Config.ipcache.size = DefaultIpcacheSize;
Config.ipcache.low = DefaultIpcacheLow;
Config.ipcache.high = DefaultIpcacheHigh;
Config.levelOneDirs = DefaultLevelOneDirs;
Config.levelTwoDirs = DefaultLevelTwoDirs;
Config.Options.log_udp = DefaultOptionsLogUdp;
+ Config.Options.res_defnames = DefaultOptionsResDefnames;
+ Config.Options.anonymizer = DefaultOptionsAnonymizer;
+ Config.Options.enable_purge = DefaultOptionsEnablePurge;
}
static void
/*
- * $Id: client_side.cc,v 1.93 1997/02/27 02:57:05 wessels Exp $
+ * $Id: client_side.cc,v 1.94 1997/03/04 05:16:26 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
/* Check that the user is allowed to access via this proxy-cache
* don't restrict if they're accessing a local domain or
* an object of type cacheobj:// */
- if (Config.proxyAuthFile == NULL)
+ if (Config.proxyAuth.File == NULL)
return 1;
if (urlParseProtocol(icpState->url) == PROTO_CACHEOBJ)
return 1;
- if (Config.proxyAuthIgnoreDomain != NULL)
- if (matchDomainName(Config.proxyAuthIgnoreDomain, icpState->request->host))
+
+ if (Config.proxyAuth.IgnoreDomains) {
+ if (aclMatchRegex(Config.proxyAuth.IgnoreDomains, icpState->request->host)) {
+ debug(33, 2, "clientProxyAuthCheck: host \"%s\" matched proxyAuthIgnoreDomains\n", icpState->request->host);
return 1;
+ }
+ }
proxy_user = proxyAuthenticate(icpState->request_hdr);
xstrncpy(icpState->ident.ident, proxy_user, ICP_IDENT_SZ);
debug(33, 6, "clientProxyAuthCheck: user = %s\n", icpState->ident.ident);
*/
if ((squid_curtime - last_time) > CHECK_PROXY_FILE_TIME) {
- debug(33, 5, "proxyAuthenticate: checking password file %s hasn't changed\n", Config.proxyAuthFile);
+ debug(33, 5, "proxyAuthenticate: checking password file %s hasn't changed\n", Config.proxyAuth.File);
- if (stat(Config.proxyAuthFile, &buf) == 0) {
+ if (stat(Config.proxyAuth.File, &buf) == 0) {
if (buf.st_mtime != change_time) {
- debug(33, 0, "proxyAuthenticate: reloading changed proxy authentication password file %s \n", Config.proxyAuthFile);
+ debug(33, 0, "proxyAuthenticate: reloading changed proxy authentication password file %s \n", Config.proxyAuth.File);
change_time = buf.st_mtime;
if (validated != 0) {
/* First time around, 7921 should be big enough */
if ((validated = hash_create(urlcmp, 7921, hash_string)) < 0) {
debug(33, 1, "ERK: can't create hash table. Turning auth off");
- xfree(Config.proxyAuthFile);
- Config.proxyAuthFile = NULL;
+ xfree(Config.proxyAuth.File);
+ Config.proxyAuth.File = NULL;
return (dash_str);
}
}
passwords = xmalloc((size_t) buf.st_size + 2);
- f = fopen(Config.proxyAuthFile, "r");
+ f = fopen(Config.proxyAuth.File, "r");
fread(passwords, (size_t) buf.st_size, 1, f);
*(passwords + buf.st_size) = '\0';
strcat(passwords, "\n");
xfree(passwords);
}
} else {
- debug(33, 1, "ERK: can't access proxy_auth file %s. Turning authentication off", Config.proxyAuthFile);
- xfree(Config.proxyAuthFile);
- Config.proxyAuthFile = NULL;
+ debug(33, 1, "ERK: can't access proxy_auth file %s. Turning authentication off", Config.proxyAuth.File);
+ xfree(Config.proxyAuth.File);
+ Config.proxyAuth.File = NULL;
return (dash_str);
}
}
/*
- * $Id: comm.cc,v 1.139 1997/02/26 19:46:10 wessels Exp $
+ * $Id: comm.cc,v 1.140 1997/03/04 05:16:27 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
static void commSetTcpNoDelay _PARAMS((int));
#endif
static void commSetTcpRcvbuf _PARAMS((int, int));
+static void commConnectFree _PARAMS((int fd, void *data));
+static void commConnectHandle _PARAMS((int fd, void *data));
static int *fd_lifetime = NULL;
static struct timeval zero_tv;
return sock;
}
-/* Connect SOCK to specified DEST_PORT at DEST_HOST. */
void
-comm_nbconnect(int fd, void *data)
+commConnectStart(int fd, const char *host, u_short port, CCH callback, void *data)
+{
+ ConnectStateData *cs = xcalloc(1, sizeof(ConnectStateData));
+ cs->host = xstrdup(host);
+ cs->port = port;
+ cs->callback = callback;
+ cs->data = data;
+ comm_add_close_handler(fd, commConnectFree, cs);
+ commConnectHandle(fd, cs);
+}
+
+static void
+commConnectFree(int fd, void *data)
+{
+ ConnectStateData *cs = data;
+ xfree(cs->host);
+ xfree(cs);
+}
+
+/* Connect SOCK to specified DEST_PORT at DEST_HOST. */
+static void
+commConnectHandle(int fd, void *data)
{
ConnectStateData *connectState = data;
const ipcache_addrs *ia = NULL;
if (connectState->S.sin_addr.s_addr == 0) {
ia = ipcache_gethostbyname(connectState->host, IP_BLOCKING_LOOKUP);
if (ia == NULL) {
- debug(5, 3, "comm_nbconnect: Unknown host: %s\n",
+ debug(5, 3, "commConnectHandle: Unknown host: %s\n",
connectState->host);
- connectState->handler(fd,
+ connectState->callback(fd,
COMM_ERROR,
connectState->data);
return;
case COMM_INPROGRESS:
commSetSelect(fd,
COMM_SELECT_WRITE,
- comm_nbconnect,
+ commConnectHandle,
(void *) connectState,
0);
break;
case COMM_OK:
- connectState->handler(fd, COMM_OK, connectState->data);
+ if (vizSock > -1)
+ vizHackSendPkt(&connectState->S, 2);
ipcacheCycleAddr(connectState->host);
+ connectState->callback(fd, COMM_OK, connectState->data);
break;
default:
ipcacheRemoveBadAddr(connectState->host, connectState->S.sin_addr);
- connectState->handler(fd, COMM_ERROR, connectState->data);
+ connectState->callback(fd, COMM_ERROR, connectState->data);
break;
}
}
debug(5, 0, "Unknown host: %s\n", s->key);
continue;
}
- for (i = 0; i < ia->count; i++) {
+ for (i = 0; i < (int) ia->count; i++) {
mr.imr_multiaddr.s_addr = (ia->in_addrs + i)->s_addr;
mr.imr_interface.s_addr = INADDR_ANY;
x = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
/*
- * $Id: fqdncache.cc,v 1.46 1997/02/26 19:46:12 wessels Exp $
+ * $Id: fqdncache.cc,v 1.47 1997/03/04 05:16:28 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
fqdncache_entry *f = NULL;
const struct hostent *hp = NULL;
unsigned int ip;
+ static char *static_name = NULL;
if (!name)
fatal_dump("fqdncache_gethostbyaddr: NULL name");
ip = inet_addr(name);
hp = gethostbyaddr((char *) &ip, 4, AF_INET);
if (hp && hp->h_name && (hp->h_name[0] != '\0') && fqdn_table) {
+ if (f->status == FQDN_PENDING || f->status == FQDN_DISPATCHED) {
+ xfree(static_name);
+ static_name = xstrdup(hp->h_name);
+ return static_name;
+ }
/* good address, cached */
fqdncache_add(name, fqdncache_create(), hp, 1);
f = fqdncache_get(name);
/*
- * $Id: ftp.cc,v 1.96 1997/02/27 02:57:06 wessels Exp $
+ * $Id: ftp.cc,v 1.97 1997/03/04 05:16:28 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
int got_marker; /* denotes end of successful request */
int reply_hdr_state;
int authenticated; /* This ftp request is authenticated */
- ConnectStateData connectState;
} FtpStateData;
typedef struct ftp_ctrl_t {
debug(11, 3, "ftpProcessReplyHeader: key '%s'\n", entry->key);
- if (data->reply_hdr == NULL) {
+ if (data->reply_hdr == NULL)
data->reply_hdr = get_free_8k_page();
- memset(data->reply_hdr, '\0', 8192);
- }
if (data->reply_hdr_state == 0) {
hdr_len = strlen(data->reply_hdr);
room = 8191 - hdr_len;
debug(9, 5, "ftpSendRequest: FD %d\n", fd);
buflen = strlen(data->request->urlpath) + 256;
- buf = (char *) get_free_8k_page();
- memset(buf, '\0', buflen);
+ buf = get_free_8k_page();
path = data->request->urlpath;
mode = ftpTransferMode(path);
httpParseReplyHeaders(response, entry->mem_obj->reply);
storeComplete(entry);
ftpStateFree(-1, ftpData);
- xfree(url);
return;
}
}
if (ftpData->ftp_fd == COMM_ERROR) {
squid_error_entry(entry, ERR_CONNECT_FAIL, xstrerror());
ftpStateFree(-1, ftpData);
- xfree(url);
return;
}
/* Pipe/socket created ok */
(PF) ftpStateFree,
(void *) ftpData);
/* Now connect ... */
- ftpData->connectState.fd = ftpData->ftp_fd;
- ftpData->connectState.host = localhost;
- ftpData->connectState.port = ftpget_port;
- ftpData->connectState.handler = ftpConnectDone;
- ftpData->connectState.data = ftpData;
- comm_nbconnect(ftpData->ftp_fd, &ftpData->connectState);
- xfree(url);
- return;
+ commConnectStart(ftpData->ftp_fd,
+ localhost,
+ ftpget_port,
+ ftpConnectDone,
+ ftpData);
}
static void
(void *) ftpData, 0);
if (opt_no_ipcache)
ipcacheInvalidate(ftpData->request->host);
- if (vizSock > -1)
- vizHackSendPkt(&ftpData->connectState.S, 2);
}
static void
/*
- * $Id: gopher.cc,v 1.72 1997/02/27 02:57:08 wessels Exp $
+ * $Id: gopher.cc,v 1.73 1997/03/04 05:16:30 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
int cso_recno;
int len;
char *buf; /* pts to a 4k page */
- ConnectStateData connectState;
} GopherStateData;
static int gopherStateFree _PARAMS((int fd, GopherStateData *));
&data->type_id, data->request)) {
squid_error_entry(entry, ERR_INVALID_URL, NULL);
gopherStateFree(-1, data);
- xfree(url);
return;
}
/* Create socket. */
debug(10, 4, "gopherStart: Failed because we're out of sockets.\n");
squid_error_entry(entry, ERR_NO_FDS, xstrerror());
gopherStateFree(-1, data);
- xfree(url);
return;
}
comm_add_close_handler(sock,
debug(10, 4, "gopherStart: Called without IP entry in ipcache. OR lookup failed.\n");
squid_error_entry(entry, ERR_DNS_FAIL, dns_error_message);
comm_close(sock);
- xfree(url);
return;
}
if (((data->type_id == GOPHER_INDEX) || (data->type_id == GOPHER_CSO))
gopherToHTML(data, (char *) NULL, 0);
storeComplete(entry);
comm_close(sock);
- xfree(url);
return;
}
- data->connectState.fd = sock;
- data->connectState.host = data->host;
- data->connectState.port = data->port;
- data->connectState.handler = gopherConnectDone;
- data->connectState.data = data;
- comm_nbconnect(sock, &data->connectState);
- xfree(url);
- return;
+ commConnectStart(sock,
+ data->host,
+ data->port,
+ gopherConnectDone,
+ data);
}
static void
COMM_SELECT_WRITE,
(PF) gopherSendRequest,
(void *) gopherState, 0);
- if (vizSock > -1)
- vizHackSendPkt(&gopherState->connectState.S, 2);
}
/*
- * $Id: http.cc,v 1.152 1997/02/28 21:33:37 wessels Exp $
+ * $Id: http.cc,v 1.153 1997/03/04 05:16:31 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
#define HTTP_DELETE_GAP (1<<18)
-static const char *const w_space = " \t\n\r";
static const char *const crlf = "\r\n";
typedef enum {
StoreEntry *entry;
} http_ctrl_t;
-char *HttpServerCCStr[] =
+static char *HttpServerCCStr[] =
{
"public",
"private",
debug(11, 3, "httpProcessReplyHeader: key '%s'\n", entry->key);
- if (httpState->reply_hdr == NULL) {
+ if (httpState->reply_hdr == NULL)
httpState->reply_hdr = get_free_8k_page();
- memset(httpState->reply_hdr, '\0', 8192);
- }
if (httpState->reply_hdr_state == 0) {
hdr_len = strlen(httpState->reply_hdr);
room = 8191 - hdr_len;
char *end = NULL;
size_t len = 0;
size_t hdr_len = 0;
- size_t in_sz;
size_t l;
int hdr_flags = 0;
int cc_flags = 0;
EBIT_SET(hdr_flags, HDR_IMS);
}
end = mime_headers_end(hdr_in);
- in_sz = strlen(hdr_in);
for (t = hdr_in; t < end; t += strcspn(t, crlf), t += strspn(t, crlf)) {
hdr_len = t - hdr_in;
l = strcspn(t, crlf) + 1;
}
if (buflen < DISK_PAGE_SIZE) {
buf = get_free_8k_page();
- memset(buf, '\0', buflen);
buftype = BUF_TYPE_8K;
buflen = DISK_PAGE_SIZE;
} else {
return;
}
/* Open connection. */
- httpState->connectState.fd = fd;
- httpState->connectState.host = request->host;
- httpState->connectState.port = request->port;
- httpState->connectState.handler = httpConnectDone;
- httpState->connectState.data = httpState;
- comm_nbconnect(fd, &httpState->connectState);
+ commConnectStart(fd,
+ request->host,
+ request->port,
+ httpConnectDone,
+ httpState);
}
static void
HttpStateData *httpState = data;
request_t *request = httpState->request;
StoreEntry *entry = httpState->entry;
- peer *e = NULL;
if (status != COMM_OK) {
- if ((e = httpState->neighbor))
- e->last_fail_time = squid_curtime;
squid_error_entry(entry, ERR_CONNECT_FAIL, xstrerror());
+ if (httpState->neighbor)
+ peerCheckConnectStart(httpState->neighbor);
comm_close(fd);
} else {
/* Install connection complete handler. */
httpLifetimeExpire, (void *) httpState, 0);
commSetSelect(fd, COMM_SELECT_WRITE,
httpSendRequest, (void *) httpState, 0);
- if (vizSock > -1)
- vizHackSendPkt(&httpState->connectState.S, 2);
}
}
/*
- * $Id: icmp.cc,v 1.31 1997/02/26 19:46:15 wessels Exp $
+ * $Id: icmp.cc,v 1.32 1997/03/04 05:16:32 wessels Exp $
*
* DEBUG: section 37 ICMP Routines
* AUTHOR: Duane Wessels
COMM_SELECT_READ,
(PF) icmpRecv,
(void *) -1, 0);
- memset((char *) &preply, '\0', sizeof(pingerReplyData));
+ memset(&preply, '\0', sizeof(pingerReplyData));
n = recv(icmp_sock,
(char *) &preply,
sizeof(pingerReplyData),
{
#if USE_ICMP
icmpQueueData *queue;
+ if (icmp_sock < 0)
+ 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);
/*
- * $Id: ident.cc,v 1.24 1997/01/08 17:04:23 wessels Exp $
+ * $Id: ident.cc,v 1.25 1997/03/04 05:16:34 wessels Exp $
*
* DEBUG: section 30 Ident (RFC 931)
* AUTHOR: Duane Wessels
comm_add_close_handler(fd,
(PF) identClose,
(void *) icpState);
- icpState->identConnectState.fd = fd;
- icpState->identConnectState.host = inet_ntoa(icpState->peer.sin_addr);
- icpState->identConnectState.port = IDENT_PORT;
- icpState->identConnectState.handler = identConnectDone;
- icpState->identConnectState.data = icpState;
- comm_nbconnect(fd, &icpState->identConnectState);
+ commConnectStart(fd,
+ inet_ntoa(icpState->peer.sin_addr),
+ IDENT_PORT,
+ identConnectDone,
+ icpState);
}
static void
/*
- * $Id: ipcache.cc,v 1.107 1997/02/26 19:46:17 wessels Exp $
+ * $Id: ipcache.cc,v 1.108 1997/03/04 05:16:35 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
}
safe_free(i->name);
safe_free(i->error_message);
- memset(i, '\0', sizeof(ipcache_entry));
safe_free(i);
--meta_data.ipcache_count;
return;
i->status == IP_CACHED ? &i->addrs : NULL,
p->handlerData);
}
- memset(p, '\0', sizeof(struct _ip_pending));
safe_free(p);
}
i->pending_head = NULL; /* nuke list */
sprintf(buf, "%1.254s\n", i->name);
dns->flags |= DNS_FLAG_BUSY;
dns->data = i;
+ dns->lastcall = squid_curtime;
i->status = IP_DISPATCHED;
comm_write(dns->outpipe,
buf,
/* good address, cached */
if (i == NULL) {
i = ipcacheAddNew(name, hp, IP_CACHED);
+ } else if (i->status == IP_PENDING || i->status == IP_DISPATCHED) {
+ /* only dnsHandleRead() can change from DISPATCHED to CACHED */
+ static_addrs.count = 1;
+ static_addrs.cur = 0;
+ xmemcpy(&static_addrs.in_addrs[0].s_addr,
+ *(hp->h_addr_list),
+ hp->h_length);
+ return &static_addrs;
} else {
ipcacheAddHostent(i, hp);
}
/*
- * $Id: main.cc,v 1.137 1997/02/27 06:29:14 wessels Exp $
+ * $Id: main.cc,v 1.138 1997/03/04 05:16:36 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
const char *const localhost = "127.0.0.1";
struct in_addr local_addr;
struct in_addr no_addr;
-struct in_addr any_addr;
struct in_addr theOutICPAddr;
const char *const dash_str = "-";
const char *const null_string = "";
static volatile int rotate_pending = 0; /* set by SIGUSR1 handler */
static int httpPortNumOverride = 1;
static int icpPortNumOverride = 1; /* Want to detect "-u 0" */
+static struct in_addr any_addr;
#if MALLOC_DBG
static int malloc_debug_level = 0;
#endif
extern char *optarg;
int c;
- while ((c = getopt(argc, argv, "CDFRUVYa:bf:hik:m:su:vz?")) != -1) {
+ while ((c = getopt(argc, argv, "CDFRUVYXa:bf:hik:m:su:vz?")) != -1) {
switch (c) {
case 'C':
opt_catch_signals = 0;
case 'V':
vhost_mode = 1;
break;
+ case 'X':
+ /* force full debugging */
+ sigusr2_handle(SIGUSR2);
+ break;
case 'Y':
opt_reload_hit_only = 1;
break;
if (Config.vizHack.addr.s_addr > inet_addr("224.0.0.0")) {
struct ip_mreq mr;
char ttl = (char) Config.vizHack.mcast_ttl;
- memset((char *) &mr, '\0', sizeof(struct ip_mreq));
+ memset(&mr, '\0', sizeof(struct ip_mreq));
mr.imr_multiaddr.s_addr = Config.vizHack.addr.s_addr;
mr.imr_interface.s_addr = INADDR_ANY;
x = setsockopt(vizSock,
#else
debug(1, 0, "vizSock: Could not join multicast group\n");
#endif
- memset((char *) &Config.vizHack.S, '\0', sizeof(struct sockaddr_in));
+ memset(&Config.vizHack.S, '\0', sizeof(struct sockaddr_in));
Config.vizHack.S.sin_family = AF_INET;
Config.vizHack.S.sin_addr = Config.vizHack.addr;
Config.vizHack.S.sin_port = htons(Config.vizHack.port);
eventAdd("storeMaintain", storeMaintainSwapSpace, NULL, 1);
eventAdd("storeDirClean", storeDirClean, NULL, 15);
if (Config.Announce.on)
- eventAdd("send_announce", send_announce, NULL, 3600);
+ eventAdd("start_announce", start_announce, NULL, 3600);
eventAdd("ipcache_purgelru", (EVH) ipcache_purgelru, NULL, 10);
eventAdd("peerUpdateFudge", peerUpdateFudge, NULL, 10);
}
}
if (shutdown_pending) {
normal_shutdown();
- exit(0);
} else if (reread_pending) {
mainReinitialize();
reread_pending = 0; /* reset */
/*
- * $Id: neighbors.cc,v 1.128 1997/02/28 21:33:39 wessels Exp $
+ * $Id: neighbors.cc,v 1.129 1997/03/04 05:16:37 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
static peer_t parseNeighborType _PARAMS((const char *s));
static void peerRefreshDNS _PARAMS((void *));
static void peerDNSConfigure _PARAMS((int fd, const ipcache_addrs * ia, void *data));
+static void peerCheckConnect _PARAMS((void *));
+static void peerCheckConnect2 _PARAMS((int, const ipcache_addrs *, void *));
+static void peerCheckConnectDone _PARAMS((int, int, void *));
static icp_common_t echo_hdr;
static u_short echo_port;
int do_ping = 1;
const struct _acl_list *a = NULL;
aclCheck_t checklist;
-
if (request == NULL)
fatal_dump("peerAllowedToUse: NULL request");
if (BIT_TEST(request->flags, REQ_NOCACHE))
for (e = Peers.peers_head; e; e = e->next)
if (peerWouldBePinged(e, request))
count++;
+ debug(15, 3, "neighborsCount: %d\n", count);
return count;
}
return NULL; /* oops, found second parent */
p = e;
}
+ debug(15, 3, "getSingleParent: returning %s\n", p ? p->host : "NULL");
return p;
}
continue;
if (neighborType(e, request) != PEER_PARENT)
continue;
- if (peerHTTPOkay(e, request))
- return e;
+ if (!peerHTTPOkay(e, request))
+ continue;
+ break;
}
- return NULL;
+ debug(15, 3, "getFirstUpParent: returning %s\n", e ? e->host : "NULL");
+ return e;
}
peer *
}
if (f)
f->rr_count++;
+ debug(15, 3, "getRoundRobinParent: returning %s\n", e ? e->host : "NULL");
return f;
}
continue;
if (!peerHTTPOkay(e, request))
continue;
+ debug(15, 3, "getDefaultParent: returning %s\n", e->host);
return e;
}
return NULL;
e->acls = NULL;
e->icp_version = ICP_VERSION_CURRENT;
e->type = parseNeighborType(type);
+ e->tcp_up = 1;
/* Append peer */
if (!Peers.peers_head)
int
neighborUp(const peer * e)
{
- if (e->last_fail_time)
- if (squid_curtime - e->last_fail_time < (time_t) 60)
- return 0;
+ if (!e->tcp_up)
+ return 0;
if (e->stats.ack_deficit >= HIER_MAX_DEFICIT)
return 0;
return 1;
struct _domain_ping *nl = NULL;
if (e == NULL)
return;
+ if (!e->tcp_up)
+ eventDelete(peerCheckConnect, e);
for (l = e->pinglist; l; l = nl) {
nl = l->next;
safe_free(l->domain);
/* Reconfigure the peers every hour */
eventAdd("peerRefreshDNS", peerRefreshDNS, NULL, 3600);
}
+
+static void
+peerCheckConnect(void *data)
+{
+ peer *p = data;
+ int fd;
+ fd = comm_open(SOCK_STREAM, 0, Config.Addrs.tcp_outgoing,
+ 0, COMM_NONBLOCKING, p->host);
+ if (fd < 0)
+ return;
+ ipcache_nbgethostbyname(p->host, fd, peerCheckConnect2, p);
+}
+
+static void
+peerCheckConnect2(int fd, const ipcache_addrs * ia, void *data)
+{
+ peer *p = data;
+ commConnectStart(fd,
+ p->host,
+ p->http_port,
+ peerCheckConnectDone,
+ p);
+}
+
+static void
+peerCheckConnectDone(int fd, int status, void *data)
+{
+ peer *p = data;
+ p->tcp_up = status == COMM_OK ? 1 : 0;
+ if (p->tcp_up) {
+ debug(15, 0, "TCP connection to %s/%d succeeded\n",
+ p->host, p->http_port);
+ } else {
+ eventAdd("peerCheckConnect", peerCheckConnect, p, 80);
+ }
+ comm_close(fd);
+ return;
+}
+
+void
+peerCheckConnectStart(peer * p)
+{
+ if (!p->tcp_up)
+ return;
+ 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;
+ eventAdd("peerCheckConnect", peerCheckConnect, p, 80);
+}
/*
- * $Id: pinger.cc,v 1.19 1997/01/24 22:18:39 wessels Exp $
+ * $Id: pinger.cc,v 1.20 1997/03/04 05:16:39 wessels Exp $
*
* DEBUG: section 42 ICMP Pinger program
* AUTHOR: Duane Wessels
static pingerEchoData pecho;
int n;
int guess_size;
- memset((char *) &pecho, '\0', sizeof(pecho));
+ memset(&pecho, '\0', sizeof(pecho));
n = recv(0, (char *) &pecho, sizeof(pecho), 0);
if (n < 0) {
perror("recv");
/*
- * $Id: send-announce.cc,v 1.29 1997/02/26 19:46:20 wessels Exp $
+ * $Id: send-announce.cc,v 1.30 1997/03/04 05:16:40 wessels Exp $
*
* DEBUG: section 27 Cache Announcer
* AUTHOR: Duane Wessels
#include "squid.h"
+static void
+send_announce _PARAMS((int fd, const ipcache_addrs * ia, void *data));
+
void
-send_announce(void *unused)
+start_announce(void *unused)
+{
+ if (!Config.Announce.on)
+ return;
+ ipcache_nbgethostbyname(Config.Announce.host, 0, send_announce, NULL);
+ eventAdd("send_announce", start_announce, NULL, Config.Announce.rate);
+}
+
+static void
+send_announce(int fd, const ipcache_addrs * ia, void *data)
{
LOCAL_ARRAY(char, tbuf, 256);
LOCAL_ARRAY(char, sndbuf, BUFSIZ);
icpUdpData *qdata = NULL;
- const ipcache_addrs *ia = NULL;
char *host = Config.Announce.host;
char *file = NULL;
u_short port = Config.Announce.port;
- int fd;
int l;
int n;
-
- if (!Config.Announce.on)
- return;
- eventAdd("send_announce", send_announce, NULL, Config.Announce.rate);
- debug(27, 0, "Sending Announcement to %s\n", host);
- if ((ia = ipcache_gethostbyname(host, IP_BLOCKING_LOOKUP)) == NULL) {
+ if (ia == NULL) {
debug(27, 1, "send_announce: Unknown host '%s'\n", host);
return;
}
+ debug(27, 0, "Sending Announcement to %s\n", host);
sndbuf[0] = '\0';
sprintf(tbuf, "cache_version SQUID/%s\n", version_string);
strcat(sndbuf, tbuf);
mkhttpdlogtime(&squid_curtime));
strcat(sndbuf, tbuf);
l = strlen(sndbuf);
-
if ((file = Config.Announce.file)) {
fd = file_open(file, NULL, O_RDONLY, NULL, NULL);
if (fd > -1 && (n = read(fd, sndbuf + l, BUFSIZ - l - 1)) > 0) {
/*
- * $Id: squid.h,v 1.99 1997/02/28 21:33:42 wessels Exp $
+ * $Id: squid.h,v 1.100 1997/03/04 05:16:42 wessels Exp $
*
* AUTHOR: Duane Wessels
*
* NetBSD is another. So here we increase FD_SETSIZE to our
* configure-discovered maximum *before* any system includes.
*/
+#define CHANGE_FD_SETSIZE 1
-/*
- * Linux (2.x only?) always defines FD_SETSIZE in <linux/time.h> so
- * we get in trouble if we try to increase it. barf.
- */
+/* Cannot increase FD_SETSIZE on Linux */
+#if defined(_SQUID_LINUX_)
+#undef CHANGE_FD_SETSIZE
+#define CHANGE_FD_SETSIZE 0
+#endif
-#ifdef _SQUID_LINUX_
- /* Cannot increase FD_SETSIZE on Linux */
-#elif _SQUID_FREEBSD_
- /* Cannot increase FD_SETSIZE on FreeBSD */
- /* Marian Durkovic <marian@svf.stuba.sk> */
-#else
- /* Increase FD_SETSIZE if SQUID_MAXFD is bigger */
-#if SQUID_MAXFD > FD_SETSIZE
+/* Cannot increase FD_SETSIZE on FreeBSD before 2.2.0, causes select(2)
+ * to return EINVAL. */
+/* Marian Durkovic <marian@svf.stuba.sk> */
+/* Peter Wemm <peter@spinner.DIALix.COM> */
+#if defined(_SQUID_FREEBSD_)
+#include <osreldate.h>
+#if __FreeBSD_version < 220000
+#undef CHANGE_FD_SETSIZE
+#define CHANGE_FD_SETSIZE 0
+#endif
+#endif
+
+/* Increase FD_SETSIZE if SQUID_MAXFD is bigger */
+#if CHANGE_FD_SETSIZE && SQUID_MAXFD > DEFAULT_FD_SETSIZE
#define FD_SETSIZE SQUID_MAXFD
#endif
-#endif /* */
#if HAVE_UNISTD_H
#include <unistd.h>
#include <syslog.h>
#endif
-#if HAVE_SHADOW_H
-#include <shadow.h>
-#endif
-
#if HAVE_MATH_H
#include <math.h>
#endif
extern struct in_addr theOutICPAddr; /* main.c */
extern const char *const localhost;
extern unsigned int inaddr_none;
-extern struct in_addr any_addr; /* comm.c */
extern struct in_addr no_addr; /* comm.c */
extern int opt_udp_hit_obj; /* main.c */
extern int opt_mem_pools; /* main.c */
#define CONNECT_PORT 443
-extern void send_announce _PARAMS((void *unused));
+extern void start_announce _PARAMS((void *unused));
extern int sslStart _PARAMS((int fd, const char *, request_t *, char *, int *sz));
extern const char *storeToString _PARAMS((const StoreEntry *));
extern int waisStart _PARAMS((method_t, char *, StoreEntry *));
/*
- * $Id: ssl.cc,v 1.41 1997/02/28 21:33:42 wessels Exp $
+ * $Id: ssl.cc,v 1.42 1997/03/04 05:16:42 wessels Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
} client, server;
time_t timeout;
int *size_ptr; /* pointer to size in an icpStateData for logging */
- ConnectStateData connectState;
int proxying;
} SslStateData;
safe_free(sslState->client.buf);
xfree(sslState->url);
requestUnlink(sslState->request);
- memset(sslState, '\0', sizeof(SslStateData));
safe_free(sslState);
}
COMM_SELECT_LIFETIME,
sslLifetimeExpire,
(void *) sslState, 0);
- sslState->connectState.fd = fd;
- sslState->connectState.host = sslState->host;
- sslState->connectState.port = sslState->port;
- sslState->connectState.handler = sslConnectDone;
- sslState->connectState.data = sslState;
- comm_nbconnect(fd, &sslState->connectState);
+ commConnectStart(fd,
+ sslState->host,
+ sslState->port,
+ sslConnectDone,
+ sslState);
}
static void
sslProxyConnected(sslState->server.fd, sslState);
else
sslConnected(sslState->server.fd, sslState);
- if (vizSock > -1)
- vizHackSendPkt(&sslState->connectState.S, 2);
}
int
/*
- * $Id: stat.cc,v 1.128 1997/02/28 21:33:43 wessels Exp $
+ * $Id: stat.cc,v 1.129 1997/03/04 05:16:43 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
obj->parameter_get = parameter_get;
obj->server_list = server_list;
if (logfilename) {
- memset(obj->logfilename, '0', SQUID_MAXPATHLEN);
+ memset(obj->logfilename, '\0', SQUID_MAXPATHLEN);
xstrncpy(obj->logfilename, logfilename, SQUID_MAXPATHLEN);
obj->logfile_fd = file_open(obj->logfilename, NULL, O_WRONLY | O_CREAT, NULL, NULL);
if (obj->logfile_fd == DISK_ERROR) {
/*
- * $Id: store.cc,v 1.213 1997/02/26 19:46:24 wessels Exp $
+ * $Id: store.cc,v 1.214 1997/03/04 05:16:44 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
/* expiration parameters and stats */
static int store_buckets;
-int store_maintain_rate;
+static int store_maintain_rate;
static int store_maintain_buckets;
-int scan_revolutions;
+static int scan_revolutions;
static struct _bucketOrder *MaintBucketsOrder = NULL;
/* Slow/Fast rebuild status parameter */
safe_free(mem->e_abort_msg);
requestUnlink(mem->request);
mem->request = NULL;
- memset(mem, '\0', sizeof(MemObject));
put_free_mem_obj(mem);
meta_data.mem_obj_count--;
meta_data.misc -= sizeof(struct _http_reply);
e->key = NULL;
else
safe_free(e->key);
- memset(e, '\0', sizeof(StoreEntry));
xfree(e);
meta_data.store_entries--;
}
/*
- * $Id: tunnel.cc,v 1.41 1997/02/28 21:33:42 wessels Exp $
+ * $Id: tunnel.cc,v 1.42 1997/03/04 05:16:42 wessels Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
} client, server;
time_t timeout;
int *size_ptr; /* pointer to size in an icpStateData for logging */
- ConnectStateData connectState;
int proxying;
} SslStateData;
safe_free(sslState->client.buf);
xfree(sslState->url);
requestUnlink(sslState->request);
- memset(sslState, '\0', sizeof(SslStateData));
safe_free(sslState);
}
COMM_SELECT_LIFETIME,
sslLifetimeExpire,
(void *) sslState, 0);
- sslState->connectState.fd = fd;
- sslState->connectState.host = sslState->host;
- sslState->connectState.port = sslState->port;
- sslState->connectState.handler = sslConnectDone;
- sslState->connectState.data = sslState;
- comm_nbconnect(fd, &sslState->connectState);
+ commConnectStart(fd,
+ sslState->host,
+ sslState->port,
+ sslConnectDone,
+ sslState);
}
static void
sslProxyConnected(sslState->server.fd, sslState);
else
sslConnected(sslState->server.fd, sslState);
- if (vizSock > -1)
- vizHackSendPkt(&sslState->connectState.S, 2);
}
int
/*
- * $Id: wais.cc,v 1.61 1997/02/27 02:57:17 wessels Exp $
+ * $Id: wais.cc,v 1.62 1997/03/04 05:16:45 wessels Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
int relayport;
char *mime_hdr;
char request[MAX_URL];
- ConnectStateData connectState;
} WaisStateData;
static int waisStateFree _PARAMS((int, WaisStateData *));
comm_close(waisState->fd);
return;
}
- waisState->connectState.fd = fd;
- waisState->connectState.host = waisState->relayhost;
- waisState->connectState.port = waisState->relayport;
- waisState->connectState.handler = waisConnectDone;
- waisState->connectState.data = waisState;
- comm_nbconnect(fd, &waisState->connectState);
+ commConnectStart(fd,
+ waisState->relayhost,
+ waisState->relayport,
+ waisConnectDone,
+ waisState);
}
static void
COMM_SELECT_WRITE,
(PF) waisSendRequest,
(void *) waisState, 0);
- if (vizSock > -1)
- vizHackSendPkt(&waisState->connectState.S, 2);
}