From e924600d26b28bf7540df417d61c5fbfefa55089 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Tue, 4 Mar 1997 12:16:18 +0000 Subject: [PATCH] merge 1.1.7->1/1/8 --- ChangeLog | 25 +++- configure | 310 +++++++++++++++++++++--------------------- configure.in | 37 ++++- include/autoconf.h.in | 12 +- include/version.h | 4 +- scripts/cachetrace.pl | 2 +- src/acl.cc | 42 +++--- src/cache_cf.cc | 46 ++++--- src/client_side.cc | 30 ++-- src/comm.cc | 42 ++++-- src/fqdncache.cc | 8 +- src/ftp.cc | 27 ++-- src/gopher.cc | 22 +-- src/http.cc | 30 ++-- src/icmp.cc | 6 +- src/ident.cc | 13 +- src/ipcache.cc | 13 +- src/main.cc | 17 ++- src/neighbors.cc | 75 ++++++++-- src/pinger.cc | 4 +- src/send-announce.cc | 27 ++-- src/squid.h | 42 +++--- src/ssl.cc | 17 +-- src/stat.cc | 4 +- src/store.cc | 8 +- src/tunnel.cc | 17 +-- src/wais.cc | 16 +-- 27 files changed, 512 insertions(+), 384 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7b7868da5..9375f7d969 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,8 +16,31 @@ Changes to squid-1.2.alpha1 (): - 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 diff --git a/configure b/configure index 3ce645eec1..02e514b195 100755 --- a/configure +++ b/configure @@ -520,7 +520,7 @@ fi -# 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 @@ -1497,7 +1497,6 @@ for ac_hdr in \ pwd.h \ regex.h \ resolv.h \ - shadow.h \ signal.h \ stdarg.h \ stddef.h \ @@ -1524,17 +1523,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure: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 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* @@ -1562,12 +1561,12 @@ done 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 <&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 @@ -1638,16 +1637,16 @@ fi 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 <&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 @@ -1663,9 +1662,9 @@ fi 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 < #include @@ -1674,7 +1673,7 @@ struct tm foo; 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 @@ -1690,9 +1689,9 @@ fi 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 < #include @@ -1701,7 +1700,7 @@ struct mallinfo foo; 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 @@ -1717,9 +1716,9 @@ fi 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 < #include @@ -1730,7 +1729,7 @@ struct ip ip; 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 @@ -1746,7 +1745,7 @@ fi 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 @@ -1754,7 +1753,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1765,7 +1764,7 @@ 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 @@ -1785,7 +1784,7 @@ EOF 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 @@ -1793,7 +1792,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1804,7 +1803,7 @@ 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 @@ -1827,19 +1826,19 @@ EOF # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure: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 < 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 @@ -1860,12 +1859,12 @@ EOF 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 <&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 @@ -1920,12 +1919,12 @@ EOF 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 <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure: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 <&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 @@ -2005,7 +2004,7 @@ done 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 @@ -2013,7 +2012,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure: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 @@ -2055,12 +2054,12 @@ fi 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 < #if STDC_HEADERS @@ -2088,12 +2087,12 @@ EOF 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 < #if STDC_HEADERS @@ -2121,12 +2120,12 @@ EOF 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 < #if STDC_HEADERS @@ -2154,12 +2153,12 @@ EOF 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 < #if STDC_HEADERS @@ -2188,7 +2187,7 @@ fi 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 @@ -2196,14 +2195,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2231,7 +2230,7 @@ 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 @@ -2239,14 +2238,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2274,7 +2273,7 @@ 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 @@ -2282,14 +2281,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnumalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2326,7 +2325,7 @@ if test "$ac_cv_lib_gnumalloc_main" = "no"; then ;; *) 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 @@ -2334,14 +2333,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lmalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2372,7 +2371,7 @@ fi 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 @@ -2380,14 +2379,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2415,7 +2414,7 @@ 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 @@ -2423,14 +2422,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lregex $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2451,7 +2450,7 @@ 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 @@ -2459,7 +2458,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2486,7 +2485,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for inet_aton in -l44bsd""... $ac_c" 1>&6 -echo "configure: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 @@ -2494,7 +2493,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l44bsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2537,7 +2536,7 @@ 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 @@ -2545,14 +2544,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2580,7 +2579,7 @@ 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 @@ -2588,14 +2587,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2624,7 +2623,7 @@ fi 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 @@ -2632,7 +2631,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2665,50 +2664,6 @@ fi -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 <&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 <&6 -fi - - case "$host" in i386-*-solaris2.?) if test "$GCC" = "yes"; then @@ -2768,7 +2723,6 @@ for ac_func in \ memmove \ mktime \ poll \ - pw_encrypt \ random \ regcomp \ regexec \ @@ -2789,12 +2743,12 @@ for ac_func in \ 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 <&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 @@ -2843,7 +2797,7 @@ done 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 @@ -2875,12 +2829,12 @@ for ac_func in \ 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 <&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 @@ -2930,13 +2884,61 @@ done +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 < +#endif +#if HAVE_UNISTD_H +#include +#endif +#if HAVE_SYS_TIME_H +#include +#endif +#if HAVE_SYS_SELECT_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#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 <&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 < @@ -2988,7 +2990,7 @@ main() { } 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 @@ -3007,12 +3009,12 @@ EOF 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 < @@ -3031,7 +3033,7 @@ main () } 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 @@ -3050,12 +3052,12 @@ EOF 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 < @@ -3074,7 +3076,7 @@ main () } 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 @@ -3093,12 +3095,12 @@ EOF 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 < @@ -3117,7 +3119,7 @@ main () } 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 @@ -3136,12 +3138,12 @@ EOF 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 < @@ -3160,7 +3162,7 @@ main () } 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 @@ -3179,16 +3181,16 @@ EOF 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 < 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 @@ -3204,16 +3206,16 @@ fi 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 <&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 diff --git a/configure.in b/configure.in index c2e5664766..c2ec90fc6e 100644 --- a/configure.in +++ b/configure.in @@ -3,13 +3,13 @@ dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.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) @@ -138,7 +138,6 @@ AC_CHECK_HEADERS( \ pwd.h \ regex.h \ resolv.h \ - shadow.h \ signal.h \ stdarg.h \ stddef.h \ @@ -241,9 +240,6 @@ dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD) 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 @@ -303,7 +299,6 @@ AC_CHECK_FUNCS(\ memmove \ mktime \ poll \ - pw_encrypt \ random \ regcomp \ regexec \ @@ -351,6 +346,34 @@ AC_REPLACE_FUNCS(\ strerror \ ) +AC_MSG_CHECKING(Default FD_SETSIZE value) +AC_TRY_RUN([ +#if HAVE_STDIO_H +#include +#endif +#if HAVE_UNISTD_H +#include +#endif +#if HAVE_SYS_TIME_H +#include +#endif +#if HAVE_SYS_SELECT_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#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 diff --git a/include/autoconf.h.in b/include/autoconf.h.in index 045a174b01..93dc7f02b9 100644 --- a/include/autoconf.h.in +++ b/include/autoconf.h.in @@ -46,6 +46,9 @@ /* 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 @@ -127,9 +130,6 @@ /* 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 @@ -256,9 +256,6 @@ /* Define if you have the header file. */ #undef HAVE_RESOLV_H -/* Define if you have the header file. */ -#undef HAVE_SHADOW_H - /* Define if you have the header file. */ #undef HAVE_SIGNAL_H @@ -352,8 +349,5 @@ /* 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 diff --git a/include/version.h b/include/version.h index 108a3eea8b..931f798222 100644 --- a/include/version.h +++ b/include/version.h @@ -1,9 +1,9 @@ -/* $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 diff --git a/scripts/cachetrace.pl b/scripts/cachetrace.pl index e11334179f..2b11d5be8d 100755 --- a/scripts/cachetrace.pl +++ b/scripts/cachetrace.pl @@ -8,7 +8,7 @@ $port = 3128; $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"); diff --git a/src/acl.cc b/src/acl.cc index a9490097df..3bba4f25da 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -41,13 +41,11 @@ /* 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)); @@ -98,8 +96,9 @@ static void aclParseWordList _PARAMS((void *curlist)); 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; @@ -290,6 +289,7 @@ aclParseIpData(const char *t) 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; @@ -449,8 +449,7 @@ aclParseTimeSpec(void *curlist) 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; } @@ -459,8 +458,7 @@ aclParseTimeSpec(void *curlist) 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; } @@ -580,6 +578,7 @@ aclParseAclLine(void) 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) { @@ -608,14 +607,14 @@ aclParseAclLine(void) 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: @@ -654,6 +653,16 @@ aclParseAclLine(void) 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) @@ -1016,7 +1025,8 @@ aclMatchTime(struct _acl_time_data *data, time_t when) 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)); @@ -1085,7 +1095,7 @@ aclMatchAcl(struct _acl *acl, aclCheck_t * checklist) 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: @@ -1545,7 +1555,7 @@ networkCompare(struct _acl_ip_data *net, struct _acl_ip_data *data) 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 */ @@ -1652,7 +1662,7 @@ bintreeIpNetworkCompare(void *t1, void *t2) { 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); } diff --git a/src/cache_cf.cc b/src/cache_cf.cc index e28b8f9e07..91154fdc03 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -111,8 +111,8 @@ struct SquidConfig Config; #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 @@ -129,12 +129,15 @@ struct SquidConfig Config; #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 */ @@ -142,7 +145,6 @@ struct SquidConfig Config; #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" @@ -187,8 +189,8 @@ struct SquidConfig Config; #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 @@ -200,6 +202,7 @@ struct SquidConfig Config; #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; @@ -513,11 +516,11 @@ parseProxyAuthLine(void) 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 */ @@ -1051,6 +1054,8 @@ parseConfigFile(const char *file_name) #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")) @@ -1274,8 +1279,9 @@ configFreeMemory(void) 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); @@ -1295,7 +1301,7 @@ configFreeMemory(void) 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; @@ -1328,6 +1334,7 @@ configSetFactoryDefaults(void) #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; @@ -1337,9 +1344,9 @@ configSetFactoryDefaults(void) 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); @@ -1360,8 +1367,8 @@ configSetFactoryDefaults(void) 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); @@ -1376,6 +1383,8 @@ configSetFactoryDefaults(void) 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; @@ -1386,6 +1395,9 @@ configSetFactoryDefaults(void) 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 diff --git a/src/client_side.cc b/src/client_side.cc index 4513eb0096..4d50f92794 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -54,13 +54,17 @@ clientProxyAuthCheck(icpStateData * icpState) /* 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); @@ -240,11 +244,11 @@ proxyAuthenticate(const char *headers) */ 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) { @@ -257,14 +261,14 @@ proxyAuthenticate(const char *headers) /* 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"); @@ -286,9 +290,9 @@ proxyAuthenticate(const char *headers) 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); } } diff --git a/src/comm.cc b/src/comm.cc index 311292c4ac..9781777abc 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -151,6 +151,8 @@ static void RWStateCallbackAndFree _PARAMS((int fd, int code)); 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; @@ -317,18 +319,38 @@ comm_listen(int sock) 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; @@ -343,17 +365,19 @@ comm_nbconnect(int fd, void *data) 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; } } @@ -1173,7 +1197,7 @@ comm_join_mcast_groups(int fd) 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, diff --git a/src/fqdncache.cc b/src/fqdncache.cc index 899dea9966..a6af14df9d 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -747,6 +747,7 @@ fqdncache_gethostbyaddr(struct in_addr addr, int flags) 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"); @@ -775,6 +776,11 @@ fqdncache_gethostbyaddr(struct in_addr addr, int flags) 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); diff --git a/src/ftp.cc b/src/ftp.cc index 67dbfc64a9..ba5915a4c8 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -125,7 +125,6 @@ typedef struct _Ftpdata { 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 { @@ -212,10 +211,8 @@ ftpProcessReplyHeader(FtpStateData * data, const char *buf, int size) 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; @@ -467,8 +464,7 @@ ftpSendRequest(int fd, FtpStateData * data) 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); @@ -601,7 +597,6 @@ ftpStartComplete(void *data, int status) httpParseReplyHeaders(response, entry->mem_obj->reply); storeComplete(entry); ftpStateFree(-1, ftpData); - xfree(url); return; } } @@ -617,7 +612,6 @@ ftpStartComplete(void *data, int status) if (ftpData->ftp_fd == COMM_ERROR) { squid_error_entry(entry, ERR_CONNECT_FAIL, xstrerror()); ftpStateFree(-1, ftpData); - xfree(url); return; } /* Pipe/socket created ok */ @@ -626,14 +620,11 @@ ftpStartComplete(void *data, int status) (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 @@ -662,8 +653,6 @@ ftpConnectDone(int fd, int status, void *data) (void *) ftpData, 0); if (opt_no_ipcache) ipcacheInvalidate(ftpData->request->host); - if (vizSock > -1) - vizHackSendPkt(&ftpData->connectState.S, 2); } static void diff --git a/src/gopher.cc b/src/gopher.cc index ba3c174bc5..360270532f 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -156,7 +156,6 @@ typedef struct gopher_ds { int cso_recno; int len; char *buf; /* pts to a 4k page */ - ConnectStateData connectState; } GopherStateData; static int gopherStateFree _PARAMS((int fd, GopherStateData *)); @@ -958,7 +957,6 @@ gopherStartComplete(void *datap, int status) &data->type_id, data->request)) { squid_error_entry(entry, ERR_INVALID_URL, NULL); gopherStateFree(-1, data); - xfree(url); return; } /* Create socket. */ @@ -972,7 +970,6 @@ gopherStartComplete(void *datap, int status) 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, @@ -985,7 +982,6 @@ gopherStartComplete(void *datap, int status) 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)) @@ -1006,17 +1002,13 @@ gopherStartComplete(void *datap, int status) 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 @@ -1039,8 +1031,6 @@ gopherConnectDone(int fd, int status, void *data) COMM_SELECT_WRITE, (PF) gopherSendRequest, (void *) gopherState, 0); - if (vizSock > -1) - vizHackSendPkt(&gopherState->connectState.S, 2); } diff --git a/src/http.cc b/src/http.cc index 5f39e96f9e..bee2a302da 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -112,7 +112,6 @@ #define HTTP_DELETE_GAP (1<<18) -static const char *const w_space = " \t\n\r"; static const char *const crlf = "\r\n"; typedef enum { @@ -173,7 +172,7 @@ typedef struct http_ctrl_t { StoreEntry *entry; } http_ctrl_t; -char *HttpServerCCStr[] = +static char *HttpServerCCStr[] = { "public", "private", @@ -446,10 +445,8 @@ httpProcessReplyHeader(HttpStateData * httpState, const char *buf, int size) 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; @@ -738,7 +735,6 @@ httpBuildRequestHeader(request_t * request, 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; @@ -759,7 +755,6 @@ httpBuildRequestHeader(request_t * request, 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; @@ -858,7 +853,6 @@ httpSendRequest(int fd, void *data) } if (buflen < DISK_PAGE_SIZE) { buf = get_free_8k_page(); - memset(buf, '\0', buflen); buftype = BUF_TYPE_8K; buflen = DISK_PAGE_SIZE; } else { @@ -975,12 +969,11 @@ httpConnect(int fd, const ipcache_addrs * ia, void *data) 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 @@ -989,11 +982,10 @@ httpConnectDone(int fd, int status, void *data) 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. */ @@ -1004,8 +996,6 @@ httpConnectDone(int fd, int status, void *data) httpLifetimeExpire, (void *) httpState, 0); commSetSelect(fd, COMM_SELECT_WRITE, httpSendRequest, (void *) httpState, 0); - if (vizSock > -1) - vizHackSendPkt(&httpState->connectState.S, 2); } } diff --git a/src/icmp.cc b/src/icmp.cc index 8ca93cac5c..fa2bc496d2 100644 --- a/src/icmp.cc +++ b/src/icmp.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -81,7 +81,7 @@ icmpRecv(int unused1, void *unused2) 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), @@ -316,6 +316,8 @@ icmpClose(void) { #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); diff --git a/src/ident.cc b/src/ident.cc index 38ded19b5d..36d2bd04bc 100644 --- a/src/ident.cc +++ b/src/ident.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -66,12 +66,11 @@ identStart(int fd, icpStateData * icpState, void (*callback) _PARAMS((void *))) 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 diff --git a/src/ipcache.cc b/src/ipcache.cc index 8f0683cb9f..d7e454d236 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -255,7 +255,6 @@ ipcache_release(ipcache_entry * i) } safe_free(i->name); safe_free(i->error_message); - memset(i, '\0', sizeof(ipcache_entry)); safe_free(i); --meta_data.ipcache_count; return; @@ -465,7 +464,6 @@ ipcache_call_pending(ipcache_entry * i) 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 */ @@ -741,6 +739,7 @@ ipcache_dnsDispatch(dnsserver_t * dns, ipcache_entry * i) 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, @@ -857,6 +856,14 @@ ipcache_gethostbyname(const char *name, int flags) /* 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); } diff --git a/src/main.cc b/src/main.cc index e3d277876c..837da78572 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -134,7 +134,6 @@ const char *const appname = "squid"; 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 = ""; @@ -147,6 +146,7 @@ extern void (*failure_notify) _PARAMS((const char *)); 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 @@ -193,7 +193,7 @@ mainParseOptions(int argc, char *argv[]) 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; @@ -213,6 +213,10 @@ mainParseOptions(int argc, char *argv[]) case 'V': vhost_mode = 1; break; + case 'X': + /* force full debugging */ + sigusr2_handle(SIGUSR2); + break; case 'Y': opt_reload_hit_only = 1; break; @@ -420,7 +424,7 @@ serverConnectionsOpen(void) 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, @@ -447,7 +451,7 @@ serverConnectionsOpen(void) #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); @@ -601,7 +605,7 @@ mainInitialize(void) 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); } @@ -721,7 +725,6 @@ main(int argc, char **argv) } if (shutdown_pending) { normal_shutdown(); - exit(0); } else if (reread_pending) { mainReinitialize(); reread_pending = 0; /* reset */ diff --git a/src/neighbors.cc b/src/neighbors.cc index 39e0191b09..8c0a466d0b 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -115,6 +115,9 @@ static void neighborCountIgnored _PARAMS((peer * e, icp_opcode op_unused)); 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; @@ -222,7 +225,6 @@ peerAllowedToUse(const peer * e, request_t * request) 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)) @@ -291,6 +293,7 @@ neighborsCount(request_t * request) for (e = Peers.peers_head; e; e = e->next) if (peerWouldBePinged(e, request)) count++; + debug(15, 3, "neighborsCount: %d\n", count); return count; } @@ -308,6 +311,7 @@ getSingleParent(request_t * request) return NULL; /* oops, found second parent */ p = e; } + debug(15, 3, "getSingleParent: returning %s\n", p ? p->host : "NULL"); return p; } @@ -320,10 +324,12 @@ getFirstUpParent(request_t * request) 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 * @@ -344,6 +350,7 @@ getRoundRobinParent(request_t * request) } if (f) f->rr_count++; + debug(15, 3, "getRoundRobinParent: returning %s\n", e ? e->host : "NULL"); return f; } @@ -358,6 +365,7 @@ getDefaultParent(request_t * request) continue; if (!peerHTTPOkay(e, request)) continue; + debug(15, 3, "getDefaultParent: returning %s\n", e->host); return e; } return NULL; @@ -731,6 +739,7 @@ neighborAdd(const char *host, e->acls = NULL; e->icp_version = ICP_VERSION_CURRENT; e->type = parseNeighborType(type); + e->tcp_up = 1; /* Append peer */ if (!Peers.peers_head) @@ -858,9 +867,8 @@ parseNeighborType(const char *s) 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; @@ -873,6 +881,8 @@ peerDestroy(peer * e) 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); @@ -950,3 +960,52 @@ peerRefreshDNS(void *junk) /* 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); +} diff --git a/src/pinger.cc b/src/pinger.cc index d596044e68..409defc8c8 100644 --- a/src/pinger.cc +++ b/src/pinger.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -286,7 +286,7 @@ pingerReadRequest(void) 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"); diff --git a/src/send-announce.cc b/src/send-announce.cc index 28d17f8c73..d21e3010f5 100644 --- a/src/send-announce.cc +++ b/src/send-announce.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -31,28 +31,34 @@ #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); @@ -70,7 +76,6 @@ send_announce(void *unused) 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) { diff --git a/src/squid.h b/src/squid.h index 5d98f5752a..e418cc9db5 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $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 * @@ -39,23 +39,30 @@ * 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 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 */ -#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 */ +/* Peter Wemm */ +#if defined(_SQUID_FREEBSD_) +#include +#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 @@ -174,10 +181,6 @@ #include #endif -#if HAVE_SHADOW_H -#include -#endif - #if HAVE_MATH_H #include #endif @@ -334,7 +337,6 @@ extern struct in_addr local_addr; /* main.c */ 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 */ @@ -347,7 +349,7 @@ extern char ThisCache[]; /* 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 *)); diff --git a/src/ssl.cc b/src/ssl.cc index db27a07ca1..60af0658bf 100644 --- a/src/ssl.cc +++ b/src/ssl.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -45,7 +45,6 @@ typedef struct { } client, server; time_t timeout; int *size_ptr; /* pointer to size in an icpStateData for logging */ - ConnectStateData connectState; int proxying; } SslStateData; @@ -119,7 +118,6 @@ sslStateFree(int fd, void *data) safe_free(sslState->client.buf); xfree(sslState->url); requestUnlink(sslState->request); - memset(sslState, '\0', sizeof(SslStateData)); safe_free(sslState); } @@ -372,12 +370,11 @@ sslConnect(int fd, const ipcache_addrs * ia, void *data) 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 @@ -407,8 +404,6 @@ sslConnectDone(int fd, int status, void *data) sslProxyConnected(sslState->server.fd, sslState); else sslConnected(sslState->server.fd, sslState); - if (vizSock > -1) - vizHackSendPkt(&sslState->connectState.S, 2); } int diff --git a/src/stat.cc b/src/stat.cc index 2b6d392c3b..7d92709576 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -1291,7 +1291,7 @@ stat_init(cacheinfo ** object, const char *logfilename) 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) { diff --git a/src/store.cc b/src/store.cc index e971c42b11..31569844fc 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -334,9 +334,9 @@ int ncache_dirs = 0; /* 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 */ @@ -381,7 +381,6 @@ destroy_MemObject(MemObject * mem) 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); @@ -407,7 +406,6 @@ destroy_StoreEntry(StoreEntry * e) e->key = NULL; else safe_free(e->key); - memset(e, '\0', sizeof(StoreEntry)); xfree(e); meta_data.store_entries--; } diff --git a/src/tunnel.cc b/src/tunnel.cc index a293ca6541..2329a68428 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -45,7 +45,6 @@ typedef struct { } client, server; time_t timeout; int *size_ptr; /* pointer to size in an icpStateData for logging */ - ConnectStateData connectState; int proxying; } SslStateData; @@ -119,7 +118,6 @@ sslStateFree(int fd, void *data) safe_free(sslState->client.buf); xfree(sslState->url); requestUnlink(sslState->request); - memset(sslState, '\0', sizeof(SslStateData)); safe_free(sslState); } @@ -372,12 +370,11 @@ sslConnect(int fd, const ipcache_addrs * ia, void *data) 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 @@ -407,8 +404,6 @@ sslConnectDone(int fd, int status, void *data) sslProxyConnected(sslState->server.fd, sslState); else sslConnected(sslState->server.fd, sslState); - if (vizSock > -1) - vizHackSendPkt(&sslState->connectState.S, 2); } int diff --git a/src/wais.cc b/src/wais.cc index dc410144f9..88f8e07bff 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -116,7 +116,6 @@ typedef struct { int relayport; char *mime_hdr; char request[MAX_URL]; - ConnectStateData connectState; } WaisStateData; static int waisStateFree _PARAMS((int, WaisStateData *)); @@ -391,12 +390,11 @@ waisConnect(int fd, const ipcache_addrs * ia, void *data) 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 @@ -419,6 +417,4 @@ waisConnectDone(int fd, int status, void *data) COMM_SELECT_WRITE, (PF) waisSendRequest, (void *) waisState, 0); - if (vizSock > -1) - vizHackSendPkt(&waisState->connectState.S, 2); } -- 2.47.2