diff -ruN squid-2.5.STABLE9/ChangeLog squid-2.5.STABLE10/ChangeLog --- squid-2.5.STABLE9/ChangeLog Wed Feb 23 16:53:37 2005 +++ squid-2.5.STABLE10/ChangeLog Mon May 16 16:38:57 2005 @@ -1,8 +1,73 @@ +Changes to squid-2.5.STABLE10 (17 May 2005) + + - [Minor Security] Fix race condition in relation to old Netscape + Set-Cookie specifications + - [Minor] Fails to parse D.J. Bernstein's FTP EPLF ftp listing + format and PASV resposes (Bug #1252) + - [Medium] BASE HREF missing on ftp directory URLs without / + (Bug #1253) + - [Minor security] confusing http_access results on configuration + error (Bug #1255) + - [Cosmetic] More robust Date parser (Bug #321) + - [Minor] reload_with_ims fails to refresh negatively cached objects + (Bug #1159) + - [Cosmetic] delay_access description clarification (Bug #1245) + - [Cosmetic] Check for integer overflow in size specifications in + squid.conf (Bug #1247) + - [Cosmetic] bzero is a non-standard function not available on all + platforms (Bug #1256) + - [Cosmetic] Compiler warnings if pid_t is not an int (Bug #1257) + - [Cosmetic] Incorrect use of ctype functions (Bug #1259) + - [Cosmetic] Defer digest fetch if the peer is not allowed to be used + (Bug #1261) + - [Minor] Duplicate content-length headers logged incorrectly or + not cleaned up properly (Bug #1262) + - [Cosmetic] Extend relaxed_header_parser to work around "excess + data from" errors from many major web servers. (Bug #1265) + - [Minor] Add HTTP headers to a netdb error messages + - [Minor] Multiple minor aufs issues (Bug #671) + - [Minor] Basic authentication fails with very long logins or + password (Bug #1171) + - [Minor] CONNECT requests truncated if client side disconnects first + (Bug #1269) + - [Minor] --disable-hostname-checks configure option did not work + - [Cosmetic] LDAP helpers adjusted to compile with SUN LDAP SDK + - [Cosmetic] aufs warning about open event filedescriptors on shutdown + - [Medium] Failed to process requests for files larger than 2GB in size + - [Cosmetic] rename() related cleanup + - [Cosmetic] New cachemgr pending_objects and client_objects actions + - [Cosmetic] external acls requiring authentication did not request + new credentials on access denials like proxy_auth does. + - [Cosmetic] Syslog facility now configurable via command line options. + - [Cosmetic] New %a error page template code expanding into the + authenticated user name. (Bug #798) + - [Minor] IP-Filter 4.0 support in --enable-ipf-transparent + - [Minor] Support interception of multiple ports + - [Cosmetic] Allow "squid -k ..." to run even if the local hostname + can not be determined (Bug #1196) + - [Cosmetic] Configuration file parser now handles DOS/Windows formatted + configuration files with CRLF lineendings proper. + - [Minor] Unrecognized Cache-Control directives now forwarded properly + (Bug #414) + - [Minor] Authentication helpers now returns useable information + in the %m error page macro on failed authentication (Bug #1223) + - [Minor] pid file management corrected in chroot use (Bug #1157) + - [Minor Security] Fix for CVE-1999-0710: cachemgr malicouse use. + cachemgr.cgi now reads a config file telling which proxy servers + it can administer. + - [Minor] aufs statistics improvements + - [Minor] SNMP bugfixes and support for SNMPv2(c) (Bug #1288, #1299) + - [Minor] ARP acl documentation and cachemgr config dump corrections + - [Minor] dstdomain/dstdom_regex acls now allow matching of numeric + hostnames in addition to the reverse lookup of the domain name. + - [Security] Internal DNS client hardened against spoofing + Changes to squid-2.5.STABLE9 (24 Feb 2005) - [Medium] Don't retry requests on 403 errors (Bug #1210) - [Minor] Ignore invalid FQDN DNS responses (Bug #1222) - [Minor] cache_peer related memory leaks on reconfigure (Bug #1246) + - [Cosmetic] Adjusted to build cleanly with GCC-4 (Bug #1211) - [Minor] relaxed_header_parser extended to work around even more broken web servers (Bug #1242) - [Minor] FTP gatewaying URLs cleaned up slightly, mainly to work @@ -48,10 +113,10 @@ - [Minor] Internal DNS sometimes truncates host names in reverse (PTR) lookups (Bug #1136) - [Minor Security] Add sanity checks on LDAP user names (Bug #1187) - - [Security] Harden Squid agains HTTP request smuggling attacks + - [Security] Harden Squid against HTTP request smuggling attacks - [Minor] Icon URLs fails in non-anonymous FTP directory listings is short_icon_urls is on (Bug #1203) - - [Security] Harden Squid agains HTTP response splitting attacks + - [Security] Harden Squid against HTTP response splitting attacks (Bug #1200) - [Medium security] Buffer overflow in WCCP recvfrom() call (Bug #1217) @@ -94,7 +159,7 @@ - [Medium] Segfaults and other strange crashes when using heap policies. (Bug #1009) - [Minor] Supplementary group memberships not set (Bug #1021) - - [Cosmetic] ERR_TOO_BIG Portugese translation + - [Cosmetic] ERR_TOO_BIG Portuguese translation - [Minor] external_acl does not handle newlines (Bug #1038) - [Major] NTLM authentication denial of service when using msnt_auth or fake_auth (Bug #1045) @@ -114,7 +179,7 @@ (Bug #1074) - [Cosmetic] Limit internal send/receive buffer sizes (Bug #1075) - [Medium] New acl types to match arbitrary HTTP headers. In addition - the http_header_access & replace directivess now support arbitrary + the http_header_access & replace directives now support arbitrary headers and not only the well known ones. (Bug #961) - [Cosmetic] ncsa_auth now accepts Window formatted password files (Bug #1078) @@ -136,7 +201,7 @@ - Bug #937: NTLM assertion error "srv->flags.reserved" - Bug #935: squid_ldap_auth can be confused by the use of reserved characters - - Helper queue warnings inprecice on the number of helpers required + - Helper queue warnings imprecise on the number of helpers required - squid_ldap_auth TLS mode works correctly again - Bug #940, #305: pkg-config support for finding correct OpenSSL compile flags diff -ruN squid-2.5.STABLE9/Makefile.in squid-2.5.STABLE10/Makefile.in --- squid-2.5.STABLE9/Makefile.in Sat Sep 25 15:37:58 2004 +++ squid-2.5.STABLE10/Makefile.in Fri Mar 18 17:55:36 2005 @@ -14,7 +14,7 @@ @SET_MAKE@ # -# $Id: Makefile.in,v 1.6.2.23 2004/09/25 21:37:58 hno Exp $ +# $Id: Makefile.in,v 1.6.2.24 2005/03/19 00:55:36 hno Exp $ # SHELL = @SHELL@ @@ -84,6 +84,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/RELEASENOTES.html squid-2.5.STABLE10/RELEASENOTES.html --- squid-2.5.STABLE9/RELEASENOTES.html Wed Feb 23 16:55:05 2005 +++ squid-2.5.STABLE10/RELEASENOTES.html Mon May 16 16:41:25 2005 @@ -7,7 +7,7 @@

Squid 2.5 release notes

-

Squid Developers

$Id: release-2.5.html,v 1.1.2.44 2005/02/23 00:26:20 hno Exp $ +

Squid Developers

$Id: release-2.5.html,v 1.1.2.54 2005/05/11 15:00:58 hno Exp $
This document contains the release notes for version 2.5 of Squid. Squid is a WWW Cache application developed by the National Laboratory @@ -144,16 +144,12 @@

3. Known issues and limitations

-

There is a few known issues and limitations in this version of Squid which we hope to correct in a later release

+

There is a few known issues in this version of Squid which we hope to correct in a later release

Bug #761

assertion failed: cbdata.c:249: "c->locks > 0" when using diskd

Bug -#1193

Interception fails if intercepting multiple ports and Squid is not listening on the same ports

-
Bug -#1094

cachemgr.cgi should have a built-in access control layer to prevent malicious use

-
Bug #649

Problems refreshing pages stored with 'vary' information

Bug #779

users going above their allowed IP count no longer logged in cache.log

@@ -162,9 +158,7 @@
Bug #888

ntlm_user_pool assertion error on shutdown

Bug -#1223

Authentication could be more informative on why a login failed

-
Bug -#1227

Syslog facility should not be hardcoded to "local4"

+#1275

Squid internal icons served up with slightly incorrect HTTP headers

@@ -209,7 +203,7 @@
  • now possible to specify acl values with spaces in them via the "include file" technique
  • winbind helpers updated to match Samba-2.2.7a and should -work with Samba-2.2.6 or later (required). For compability with +work with Samba-2.2.6 or later (required). For compatibility with older Samba versions A new configure option --with-samba-sources=... has been added to allow you to specify which Samba version the helpers should be built for if different than the above versions.
  • @@ -285,7 +279,7 @@ matches to the "login" component of Internet style URLs (protocol://user:password@host/path/to/file).
  • Squid now respects the Telnet protocol on connections to FTP -servers. The ftp_telnet_protocol directice can be used to revert back +servers. The ftp_telnet_protocol directive can be used to revert back to the old incorrect implementation.
  • Several NTLM related bugfixes and improvements fixing the problem of random auth popups and account lockouts. Support for the NEGOTIATE @@ -388,9 +382,37 @@
  • Additional workarounds for broken web servers rejected by 2.5.STABLE8.
  • No longer automatically retries requests on 403 Access Denied or many other server errors. New squid.conf directive retry_on_error to revert -back to the old behaviour if needed.
  • +back to the old behavior if needed.
  • a number of other minor and cosmetic bugfixes. See the list of squid-2.5.STABLE8 patches and the +ChangeLog file for details.
  • + +

    + +

    12. Key changes squid-2.5.STABLE9 to 2.5.STABLE10:

    + +

    +

    diff -ruN squid-2.5.STABLE9/configure squid-2.5.STABLE10/configure --- squid-2.5.STABLE9/configure Wed Feb 23 16:54:54 2005 +++ squid-2.5.STABLE10/configure Mon May 16 16:41:14 2005 @@ -21,7 +21,11 @@ ac_help="$ac_help --enable-dlmalloc[=LIB] Compile & use the malloc package by Doug Lea" ac_help="$ac_help - --enable-gnuregex Compile GNUregex" + --enable-gnuregex Compile GNUregex. Unless you have reason to use this + option, you should not enable it. This library file + is usually only required on Windows and very old + Unix boxes which do not have their own regex library + built in." ac_help="$ac_help --enable-xmalloc-statistics Show malloc statistics in status page" @@ -129,6 +133,24 @@ --enable-linux-netfilter Enable Transparent Proxy support for Linux 2.4." ac_help="$ac_help + --with-large-files Enable support for large files (logs etc)." +ac_help="$ac_help + --enable-large-cache-files + Enable support for large cache files (>2GB). + WARNING: on-disk cache format is changed by this option" +ac_help="$ac_help + --with-build-environment=model + The build environment to use. Normally one of + POSIX_V6_ILP32_OFF32 32 bits + POSIX_V6_ILP32_OFFBIG 32 bits with large file support + POSIX_V6_LP64_OFF64 64 bits + POSIX_V6_LPBIG_OFFBIG large pointers and files + XBS5_ILP32_OFF32 32 bits (legacy) + XBS5_ILP32_OFFBIG 32 bits with large file support (legacy) + XBS5_LP64_OFF64 64 bits (legacy) + XBS5_LPBIG_OFFBIG large pointers and files (legacy) + default The default for your OS" +ac_help="$ac_help --enable-leakfinder Enable Leak Finding code. Enabling this alone does nothing; you also have to modify the source @@ -778,7 +800,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:782: checking for a BSD compatible install" >&5 +echo "configure:804: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -831,7 +853,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:835: checking whether build environment is sane" >&5 +echo "configure:857: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftest.file @@ -902,7 +924,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:906: checking for $ac_word" >&5 +echo "configure:928: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -932,7 +954,7 @@ done echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:936: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:958: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1000,7 +1022,7 @@ # Define the identity of the package. PACKAGE=squid -VERSION=2.5.STABLE9 +VERSION=2.5.STABLE10 cat >> confdefs.h <&6 -echo "configure:1057: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:1079: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -1085,7 +1107,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1089: checking for $ac_word" >&5 +echo "configure:1111: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1115,7 +1137,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1119: checking for $ac_word" >&5 +echo "configure:1141: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1166,7 +1188,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1170: checking for $ac_word" >&5 +echo "configure:1192: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1198,7 +1220,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1202: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1224: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1209,12 +1231,12 @@ cat > conftest.$ac_ext << EOF -#line 1213 "configure" +#line 1235 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1240,12 +1262,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1244: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1266: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1249: checking whether we are using GNU C" >&5 +echo "configure:1271: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1254,7 +1276,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1273,7 +1295,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1277: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1299: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1312,7 +1334,7 @@ END # If we don't find an include directive, just comment out the code. echo $ac_n "checking for style of include used by $am_make""... $ac_c" 1>&6 -echo "configure:1316: checking for style of include used by $am_make" >&5 +echo "configure:1338: checking for style of include used by $am_make" >&5 am__include='#' am__quote= _am_result=none @@ -1346,7 +1368,7 @@ depcc="$CC" am_compiler_list= echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6 -echo "configure:1350: checking dependency style of $depcc" >&5 +echo "configure:1372: checking dependency style of $depcc" >&5 if eval "test \"`echo '$''{'am_cv_CC_dependencies_compiler_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1414,10 +1436,10 @@ if test "x$CC" != xcc; then echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 -echo "configure:1418: checking whether $CC and cc understand -c and -o together" >&5 +echo "configure:1440: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 -echo "configure:1421: checking whether cc understands -c and -o together" >&5 +echo "configure:1443: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" @@ -1429,16 +1451,16 @@ # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' -if { (eval echo configure:1433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; +if { (eval echo configure:1455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1439: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' - if { (eval echo configure:1441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + if { (eval echo configure:1463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1464: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : @@ -1484,7 +1506,7 @@ fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1488: checking host system type" >&5 +echo "configure:1510: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1513,7 +1535,7 @@ # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1517: checking for $ac_word" >&5 +echo "configure:1539: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PKGCONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1548,12 +1570,12 @@ echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1552: checking for Cygwin environment" >&5 +echo "configure:1574: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+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:1590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1581,19 +1603,19 @@ CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1585: checking for mingw32 environment" >&5 +echo "configure:1607: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+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_mingw32=yes else @@ -1612,7 +1634,7 @@ echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1616: checking for executable suffix" >&5 +echo "configure:1638: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1622,7 +1644,7 @@ rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;; @@ -1643,13 +1665,13 @@ ac_exeext=$EXEEXT echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1647: checking for object suffix" >&5 +echo "configure:1669: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -2585,6 +2607,72 @@ fi +buildmodel="" +needlargefiles= + +# Check whether --with-large-files or --without-large-files was given. +if test "${with_large_files+set}" = set; then + withval="$with_large_files" + if test "$withval" = yes; then + needlargefiles=1 + fi + +fi + + +# Check whether --enable-large-cache-files or --disable-large-cache-files was given. +if test "${enable_large_cache_files+set}" = set; then + enableval="$enable_large_cache_files" + if test "$enableval" = "yes" ; then + echo "Large cache file support enabled" + cat >> confdefs.h <<\EOF +#define LARGE_CACHE_FILES 1 +EOF + + fi + +fi + + +# Check whether --with-build-environment or --without-build-environment was given. +if test "${with_build_environment+set}" = set; then + withval="$with_build_environment" + case "$enableval" in + yes|no) + echo "--with-build-environment expects a build environment string as used by getconf" + exit 1 + ;; + _*) + buildmodel="$enableval" + ;; + *) + buildmodel="_$enableval" + ;; + esac + +fi + + +if test $needlargefiles && test -z "$buildmodel"; then + for model in POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG; do + if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then + buildmodel=$model + break + fi + done + if test -z "$buildmodel"; then + echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64" + sleep 1 + CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS" + fi +fi +if test -n "$buildmodel" && test "$buildmodel" != "_default"; then + echo "Using $buildmodel build environment" + CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS" + LIBS="`getconf ${buildmodel}_LIBS` $LIBS" + LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS" +fi + if false; then @@ -2687,22 +2775,22 @@ fi -enable_hostname_checks=1 -# Check whether --enable-hostname_checks or --disable-hostname_checks was given. +# Check whether --enable-hostname-checks or --disable-hostname-checks was given. if test "${enable_hostname_checks+set}" = set; then enableval="$enable_hostname_checks" - if test "$enableval" = "no"; then - echo "Disabling hostname sanity checks" - enable_hostname_checks=0 - fi - + : +else + enable_hostname_checks=yes fi -if test "$enable_hostname_checks" = 1; then +if test "$enable_hostname_checks" = "yes"; then + echo "Hostname sanity checks enabled" cat >> confdefs.h <<\EOF #define CHECK_HOSTNAMES 1 EOF +else + echo "Disabling hostname sanity checks" fi # Check whether --enable-underscores or --disable-underscores was given. @@ -2940,7 +3028,7 @@ if test "$require_sasl" = "yes"; then echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2944: checking how to run the C preprocessor" >&5 +echo "configure:3032: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2955,13 +3043,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2972,13 +3060,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2989,13 +3077,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3087: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3023,17 +3111,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3027: checking for $ac_hdr" >&5 +echo "configure:3115: 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:3037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3167,7 +3255,7 @@ esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3171: checking how to run the C preprocessor" >&5 +echo "configure:3259: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3182,13 +3270,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3199,13 +3287,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3216,13 +3304,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3258,7 +3346,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:3262: checking for a BSD compatible install" >&5 +echo "configure:3350: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3313,7 +3401,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3317: checking for $ac_word" >&5 +echo "configure:3405: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3341,7 +3429,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:3345: checking whether ln -s works" >&5 +echo "configure:3433: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3364,7 +3452,7 @@ # Extract the first word of "sh", so it can be a program name with args. set dummy sh; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3368: checking for $ac_word" >&5 +echo "configure:3456: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3400,7 +3488,7 @@ # Extract the first word of "false", so it can be a program name with args. set dummy false; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3404: checking for $ac_word" >&5 +echo "configure:3492: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FALSE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3436,7 +3524,7 @@ # Extract the first word of "true", so it can be a program name with args. set dummy true; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3440: checking for $ac_word" >&5 +echo "configure:3528: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TRUE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3472,7 +3560,7 @@ # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3476: checking for $ac_word" >&5 +echo "configure:3564: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3508,7 +3596,7 @@ # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3512: checking for $ac_word" >&5 +echo "configure:3600: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3544,7 +3632,7 @@ # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3548: checking for $ac_word" >&5 +echo "configure:3636: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3580,7 +3668,7 @@ # Extract the first word of "ln", so it can be a program name with args. set dummy ln; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3584: checking for $ac_word" >&5 +echo "configure:3672: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3616,7 +3704,7 @@ # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3620: checking for $ac_word" >&5 +echo "configure:3708: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3652,7 +3740,7 @@ # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3656: checking for $ac_word" >&5 +echo "configure:3744: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3712,12 +3800,12 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:3716: checking for $ac_hdr that defines DIR" >&5 +echo "configure:3804: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -3725,7 +3813,7 @@ DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:3729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -3750,7 +3838,7 @@ # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:3754: checking for opendir in -ldir" >&5 +echo "configure:3842: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3758,7 +3846,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3791,7 +3879,7 @@ else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:3795: checking for opendir in -lx" >&5 +echo "configure:3883: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3799,7 +3887,7 @@ ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3833,12 +3921,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3837: checking for ANSI C header files" >&5 +echo "configure:3925: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3846,7 +3934,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3863,7 +3951,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3881,7 +3969,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3902,7 +3990,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3913,7 +4001,7 @@ exit (0); } EOF -if { (eval echo configure:3917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3947,6 +4035,7 @@ errno.h \ execinfo.h \ fcntl.h \ + fnmatch.h \ getopt.h \ gnumalloc.h \ grp.h \ @@ -4020,17 +4109,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4024: checking for $ac_hdr" >&5 +echo "configure:4113: 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:4034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4058,12 +4147,12 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4062: checking for working const" >&5 +echo "configure:4151: 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:4205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4133,14 +4222,14 @@ fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4137: checking whether byte ordering is bigendian" >&5 +echo "configure:4226: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -4151,11 +4240,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:4155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -4166,7 +4255,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:4170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4186,7 +4275,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -4224,20 +4313,20 @@ echo $ac_n "checking if ANSI prototypes work""... $ac_c" 1>&6 -echo "configure:4228: checking if ANSI prototypes work" >&5 +echo "configure:4317: checking if ANSI prototypes work" >&5 if eval "test \"`echo '$''{'ac_cv_have_ansi_prototypes'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ansi_prototypes="yes" else @@ -4259,13 +4348,13 @@ fi echo $ac_n "checking for tm->tm_gmtoff""... $ac_c" 1>&6 -echo "configure:4263: checking for tm->tm_gmtoff" >&5 +echo "configure:4352: checking for tm->tm_gmtoff" >&5 if eval "test \"`echo '$''{'ac_cv_have_tm_gmoff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4274,7 +4363,7 @@ foo.tm_gmtoff = 0; ; return 0; } EOF -if { (eval echo configure:4278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_tm_gmoff="yes" else @@ -4296,13 +4385,13 @@ fi echo $ac_n "checking for struct mallinfo""... $ac_c" 1>&6 -echo "configure:4300: checking for struct mallinfo" >&5 +echo "configure:4389: checking for struct mallinfo" >&5 if eval "test \"`echo '$''{'ac_cv_have_struct_mallinfo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if HAVE_MALLOC_H @@ -4320,7 +4409,7 @@ foo.keepcost = 0; ; return 0; } EOF -if { (eval echo configure:4324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_struct_mallinfo="yes" else @@ -4342,13 +4431,13 @@ fi echo $ac_n "checking for extended mallinfo""... $ac_c" 1>&6 -echo "configure:4346: checking for extended mallinfo" >&5 +echo "configure:4435: checking for extended mallinfo" >&5 if eval "test \"`echo '$''{'ac_cv_have_ext_mallinfo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4357,7 +4446,7 @@ foo.mxfast = 0; ; return 0; } EOF -if { (eval echo configure:4361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ext_mallinfo="yes" else @@ -4379,13 +4468,13 @@ fi echo $ac_n "checking for struct rusage""... $ac_c" 1>&6 -echo "configure:4383: checking for struct rusage" >&5 +echo "configure:4472: checking for struct rusage" >&5 if eval "test \"`echo '$''{'ac_cv_have_struct_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_struct_rusage="yes" else @@ -4420,13 +4509,13 @@ fi echo $ac_n "checking for ip->ip_hl""... $ac_c" 1>&6 -echo "configure:4424: checking for ip->ip_hl" >&5 +echo "configure:4513: checking for ip->ip_hl" >&5 if eval "test \"`echo '$''{'ac_cv_have_ip_hl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4445,7 +4534,7 @@ ip.ip_hl= 0; ; return 0; } EOF -if { (eval echo configure:4449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ip_hl="yes" else @@ -4467,7 +4556,7 @@ fi echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4471: checking size of void *" >&5 +echo "configure:4560: checking size of void *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4475,7 +4564,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4486,7 +4575,7 @@ exit(0); } EOF -if { (eval echo configure:4490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_void_p=`cat conftestval` else @@ -4506,7 +4595,7 @@ echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:4510: checking size of short" >&5 +echo "configure:4599: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4514,7 +4603,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4525,7 +4614,7 @@ exit(0); } EOF -if { (eval echo configure:4529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -4545,7 +4634,7 @@ echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4549: checking size of int" >&5 +echo "configure:4638: 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 @@ -4553,7 +4642,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4564,7 +4653,7 @@ exit(0); } EOF -if { (eval echo configure:4568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -4584,7 +4673,7 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4588: checking size of long" >&5 +echo "configure:4677: 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 @@ -4592,7 +4681,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4603,7 +4692,7 @@ exit(0); } EOF -if { (eval echo configure:4607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -4623,7 +4712,7 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4627: checking size of long long" >&5 +echo "configure:4716: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4631,7 +4720,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4642,7 +4731,7 @@ exit(0); } EOF -if { (eval echo configure:4646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -4662,7 +4751,7 @@ echo $ac_n "checking size of __int64""... $ac_c" 1>&6 -echo "configure:4666: checking size of __int64" >&5 +echo "configure:4755: checking size of __int64" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof___int64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4670,7 +4759,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4696,7 +4785,7 @@ } EOF -if { (eval echo configure:4700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof___int64=`cat conftestval` else @@ -4716,7 +4805,7 @@ echo $ac_n "checking size of int16_t""... $ac_c" 1>&6 -echo "configure:4720: checking size of int16_t" >&5 +echo "configure:4809: checking size of int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4724,7 +4813,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4750,7 +4839,7 @@ } EOF -if { (eval echo configure:4754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int16_t=`cat conftestval` else @@ -4770,7 +4859,7 @@ echo $ac_n "checking size of uint16_t""... $ac_c" 1>&6 -echo "configure:4774: checking size of uint16_t" >&5 +echo "configure:4863: checking size of uint16_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4778,7 +4867,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4804,7 +4893,7 @@ } EOF -if { (eval echo configure:4808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint16_t=`cat conftestval` else @@ -4824,7 +4913,7 @@ echo $ac_n "checking size of u_int16_t""... $ac_c" 1>&6 -echo "configure:4828: checking size of u_int16_t" >&5 +echo "configure:4917: checking size of u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4832,7 +4921,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4858,7 +4947,7 @@ } EOF -if { (eval echo configure:4862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_u_int16_t=`cat conftestval` else @@ -4878,7 +4967,7 @@ echo $ac_n "checking size of int32_t""... $ac_c" 1>&6 -echo "configure:4882: checking size of int32_t" >&5 +echo "configure:4971: checking size of int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4886,7 +4975,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4912,7 +5001,7 @@ } EOF -if { (eval echo configure:4916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int32_t=`cat conftestval` else @@ -4932,7 +5021,7 @@ echo $ac_n "checking size of uint32_t""... $ac_c" 1>&6 -echo "configure:4936: checking size of uint32_t" >&5 +echo "configure:5025: checking size of uint32_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4940,7 +5029,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4966,7 +5055,7 @@ } EOF -if { (eval echo configure:4970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint32_t=`cat conftestval` else @@ -4986,7 +5075,7 @@ echo $ac_n "checking size of u_int32_t""... $ac_c" 1>&6 -echo "configure:4990: checking size of u_int32_t" >&5 +echo "configure:5079: checking size of u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4994,7 +5083,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5020,7 +5109,7 @@ } EOF -if { (eval echo configure:5024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_u_int32_t=`cat conftestval` else @@ -5040,7 +5129,7 @@ echo $ac_n "checking size of int64_t""... $ac_c" 1>&6 -echo "configure:5044: checking size of int64_t" >&5 +echo "configure:5133: checking size of int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5048,7 +5137,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5074,7 +5163,7 @@ } EOF -if { (eval echo configure:5078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int64_t=`cat conftestval` else @@ -5094,7 +5183,7 @@ echo $ac_n "checking size of uint64_t""... $ac_c" 1>&6 -echo "configure:5098: checking size of uint64_t" >&5 +echo "configure:5187: checking size of uint64_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5102,7 +5191,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5128,7 +5217,7 @@ } EOF -if { (eval echo configure:5132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint64_t=`cat conftestval` else @@ -5148,7 +5237,7 @@ echo $ac_n "checking size of u_int64_t""... $ac_c" 1>&6 -echo "configure:5152: checking size of u_int64_t" >&5 +echo "configure:5241: checking size of u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5156,7 +5245,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5182,7 +5271,7 @@ } EOF -if { (eval echo configure:5186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_u_int64_t=`cat conftestval` else @@ -5204,12 +5293,12 @@ if test "x$ac_cv_sizeof_short" = "x2"; then echo $ac_n "checking for int16_t""... $ac_c" 1>&6 -echo "configure:5208: checking for int16_t" >&5 +echo "configure:5297: checking for int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5257: checking for int16_t" >&5 +echo "configure:5346: checking for int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5307: checking for u_int16_t" >&5 +echo "configure:5396: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5356: checking for u_int16_t" >&5 +echo "configure:5445: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5405: checking for u_int16_t" >&5 +echo "configure:5494: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5455: checking for int32_t" >&5 +echo "configure:5544: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5504: checking for int32_t" >&5 +echo "configure:5593: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5554: checking for u_int32_t" >&5 +echo "configure:5643: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5603: checking for u_int32_t" >&5 +echo "configure:5692: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5652: checking for u_int32_t" >&5 +echo "configure:5741: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5702: checking for int64_t" >&5 +echo "configure:5791: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5751: checking for int64_t" >&5 +echo "configure:5840: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5800: checking for int64_t" >&5 +echo "configure:5889: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5850: checking for u_int64_t" >&5 +echo "configure:5939: checking for u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5899: checking for u_int64_t" >&5 +echo "configure:5988: checking for u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5948: checking for u_int64_t" >&5 +echo "configure:6037: checking for u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5997: checking for int64_t" >&5 +echo "configure:6086: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6047: checking for pid_t" >&5 +echo "configure:6136: 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 @@ -6076,12 +6165,12 @@ fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:6080: checking for size_t" >&5 +echo "configure:6169: 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 @@ -6109,12 +6198,12 @@ fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:6113: checking for ssize_t" >&5 +echo "configure:6202: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6142,12 +6231,12 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:6146: checking for off_t" >&5 +echo "configure:6235: 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 @@ -6175,12 +6264,12 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:6179: checking for mode_t" >&5 +echo "configure:6268: 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 @@ -6208,12 +6297,12 @@ fi echo $ac_n "checking for fd_mask""... $ac_c" 1>&6 -echo "configure:6212: checking for fd_mask" >&5 +echo "configure:6301: checking for fd_mask" >&5 if eval "test \"`echo '$''{'ac_cv_type_fd_mask'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6242,7 +6331,7 @@ echo $ac_n "checking size of off_t""... $ac_c" 1>&6 -echo "configure:6246: checking size of off_t" >&5 +echo "configure:6335: checking size of off_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6250,7 +6339,7 @@ ac_cv_sizeof_off_t=4 else cat > conftest.$ac_ext < @@ -6276,7 +6365,7 @@ } EOF -if { (eval echo configure:6280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_off_t=`cat conftestval` else @@ -6296,7 +6385,7 @@ echo $ac_n "checking size of size_t""... $ac_c" 1>&6 -echo "configure:6300: checking size of size_t" >&5 +echo "configure:6389: checking size of size_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6304,7 +6393,7 @@ ac_cv_sizeof_size_t=4 else cat > conftest.$ac_ext < @@ -6330,7 +6419,7 @@ } EOF -if { (eval echo configure:6334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_size_t=`cat conftestval` else @@ -6353,19 +6442,19 @@ # 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:6357: checking for working alloca.h" >&5 +echo "configure:6446: 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:6369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -6386,12 +6475,12 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:6390: checking for alloca" >&5 +echo "configure:6479: 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${ac_exeext}; then +if { (eval echo configure:6512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -6451,12 +6540,12 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:6455: checking whether alloca needs Cray hooks" >&5 +echo "configure:6544: 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 -echo "configure:6485: checking for $ac_func" >&5 +echo "configure:6574: 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${ac_exeext}; then +if { (eval echo configure:6602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6536,7 +6625,7 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:6540: checking stack direction for C alloca" >&5 +echo "configure:6629: 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 @@ -6544,7 +6633,7 @@ ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -6587,13 +6676,13 @@ echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:6591: checking for socklen_t" >&5 +echo "configure:6680: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6624,13 +6713,13 @@ fi echo $ac_n "checking for mtyp_t""... $ac_c" 1>&6 -echo "configure:6628: checking for mtyp_t" >&5 +echo "configure:6717: checking for mtyp_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mtyp_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6658,7 +6747,7 @@ fi echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:6662: checking for main in -lnsl" >&5 +echo "configure:6751: 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 @@ -6666,14 +6755,14 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6701,7 +6790,7 @@ fi echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:6705: checking for main in -lsocket" >&5 +echo "configure:6794: 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 @@ -6709,14 +6798,14 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6745,13 +6834,13 @@ echo $ac_n "checking for unix domain sockets""... $ac_c" 1>&6 -echo "configure:6749: checking for unix domain sockets" >&5 +echo "configure:6838: checking for unix domain sockets" >&5 if eval "test \"`echo '$''{'squid_cv_unixsocket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6766,7 +6855,7 @@ ; return 0; } EOF -if { (eval echo configure:6770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* squid_cv_unixsocket=yes else @@ -6790,7 +6879,7 @@ echo "skipping libmalloc check (--enable-dlmalloc specified)" else echo $ac_n "checking for main in -lgnumalloc""... $ac_c" 1>&6 -echo "configure:6794: checking for main in -lgnumalloc" >&5 +echo "configure:6883: 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 @@ -6798,14 +6887,14 @@ ac_save_LIBS="$LIBS" LIBS="-lgnumalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6848,7 +6937,7 @@ *) echo $ac_n "checking for main in -lmalloc""... $ac_c" 1>&6 -echo "configure:6852: checking for main in -lmalloc" >&5 +echo "configure:6941: 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 @@ -6856,14 +6945,14 @@ ac_save_LIBS="$LIBS" LIBS="-lmalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6896,7 +6985,7 @@ fi echo $ac_n "checking for main in -lbsd""... $ac_c" 1>&6 -echo "configure:6900: checking for main in -lbsd" >&5 +echo "configure:6989: 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 @@ -6904,14 +6993,14 @@ ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6939,7 +7028,7 @@ fi echo $ac_n "checking for main in -lregex""... $ac_c" 1>&6 -echo "configure:6943: checking for main in -lregex" >&5 +echo "configure:7032: 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 @@ -6947,14 +7036,14 @@ ac_save_LIBS="$LIBS" LIBS="-lregex $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6975,7 +7064,7 @@ fi echo $ac_n "checking for gethostbyname in -lbind""... $ac_c" 1>&6 -echo "configure:6979: checking for gethostbyname in -lbind" >&5 +echo "configure:7068: checking for gethostbyname in -lbind" >&5 ac_lib_var=`echo bind'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6983,7 +7072,7 @@ ac_save_LIBS="$LIBS" LIBS="-lbind $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7028,7 +7117,7 @@ ;; *) echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:7032: checking for inet_aton in -lresolv" >&5 +echo "configure:7121: 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 @@ -7036,7 +7125,7 @@ ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7063,7 +7152,7 @@ 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:7067: checking for inet_aton in -l44bsd" >&5 +echo "configure:7156: 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 @@ -7071,7 +7160,7 @@ ac_save_LIBS="$LIBS" LIBS="-l44bsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7114,7 +7203,7 @@ fi echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6 -echo "configure:7118: checking for main in -lresolv" >&5 +echo "configure:7207: 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 @@ -7122,14 +7211,14 @@ ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7160,7 +7249,7 @@ esac fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:7164: checking for main in -lm" >&5 +echo "configure:7253: 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 @@ -7168,14 +7257,14 @@ ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7204,7 +7293,7 @@ echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:7208: checking for crypt in -lcrypt" >&5 +echo "configure:7297: 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 @@ -7212,7 +7301,7 @@ ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7247,7 +7336,7 @@ if test "$with_dl" = "yes"; then echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:7251: checking for dlopen in -ldl" >&5 +echo "configure:7340: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7255,7 +7344,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7314,7 +7403,7 @@ ;; esac echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 -echo "configure:7318: checking for main in -lpthread" >&5 +echo "configure:7407: checking for main in -lpthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7322,14 +7411,14 @@ ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7360,7 +7449,7 @@ if test "$with_aio" = "yes"; then echo $ac_n "checking for aio_read in -lrt""... $ac_c" 1>&6 -echo "configure:7364: checking for aio_read in -lrt" >&5 +echo "configure:7453: checking for aio_read in -lrt" >&5 ac_lib_var=`echo rt'_'aio_read | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7368,7 +7457,7 @@ ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7411,7 +7500,7 @@ case "$host" in *-pc-sco3.2*) echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:7415: checking for strftime in -lintl" >&5 +echo "configure:7504: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7419,7 +7508,7 @@ ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7460,6 +7549,44 @@ ;; esac +echo $ac_n "checking for main in -llber""... $ac_c" 1>&6 +echo "configure:7554: checking for main in -llber" >&5 +ac_lib_var=`echo lber'_'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="-llber $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 + LIB_LBER="-llber" +else + echo "$ac_t""no" 1>&6 +fi + + + case "$host" in i386-*-solaris2.*) if test "$GCC" = "yes"; then @@ -7615,6 +7742,7 @@ srand48 \ srandom \ statfs \ + strtoll \ sysconf \ syslog \ timegm \ @@ -7624,12 +7752,12 @@ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7628: checking for $ac_func" >&5 +echo "configure:7756: 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${ac_exeext}; then +if { (eval echo configure:7784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7678,7 +7806,7 @@ echo $ac_n "checking if setresuid is implemented""... $ac_c" 1>&6 -echo "configure:7682: checking if setresuid is implemented" >&5 +echo "configure:7810: checking if setresuid is implemented" >&5 if eval "test \"`echo '$''{'ac_cv_func_setresuid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7686,7 +7814,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -7699,7 +7827,7 @@ } EOF -if { (eval echo configure:7703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setresuid="yes" else @@ -7744,7 +7872,7 @@ fi echo $ac_n "checking if va_copy is implemented""... $ac_c" 1>&6 -echo "configure:7748: checking if va_copy is implemented" >&5 +echo "configure:7876: checking if va_copy is implemented" >&5 if eval "test \"`echo '$''{'ac_cv_func_va_copy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7752,7 +7880,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -7770,7 +7898,7 @@ } EOF -if { (eval echo configure:7774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_va_copy="yes" else @@ -7794,7 +7922,7 @@ fi echo $ac_n "checking if __va_copy is implemented""... $ac_c" 1>&6 -echo "configure:7798: checking if __va_copy is implemented" >&5 +echo "configure:7926: checking if __va_copy is implemented" >&5 if eval "test \"`echo '$''{'ac_cv_func___va_copy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7802,7 +7930,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -7820,7 +7948,7 @@ } EOF -if { (eval echo configure:7824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func___va_copy="yes" else @@ -7845,7 +7973,7 @@ if test "$IPF_TRANSPARENT" ; then echo $ac_n "checking if IP-Filter header files are installed""... $ac_c" 1>&6 -echo "configure:7849: checking if IP-Filter header files are installed" >&5 +echo "configure:7977: checking if IP-Filter header files are installed" >&5 # hold on to your hats... if test "$ac_cv_header_ip_compat_h" = "yes" || test "$ac_cv_header_ip_fil_compat_h" = "yes" || @@ -7886,7 +8014,7 @@ if test "$PF_TRANSPARENT" ; then echo $ac_n "checking if PF header file is installed""... $ac_c" 1>&6 -echo "configure:7890: checking if PF header file is installed" >&5 +echo "configure:8018: checking if PF header file is installed" >&5 # hold on to your hats... if test "$ac_cv_header_net_pfvar_h" = "yes"; then PF_TRANSPARENT="yes" @@ -7911,7 +8039,7 @@ if test "$LINUX_NETFILTER" ; then echo $ac_n "checking if Linux 2.4 kernel header files are installed""... $ac_c" 1>&6 -echo "configure:7915: checking if Linux 2.4 kernel header files are installed" >&5 +echo "configure:8043: checking if Linux 2.4 kernel header files are installed" >&5 # hold on to your hats... if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then LINUX_NETFILTER="yes" @@ -7945,13 +8073,13 @@ esac fi echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6 -echo "configure:7949: checking if GNUregex needs to be compiled" >&5 +echo "configure:8077: checking if GNUregex needs to be compiled" >&5 if test -z "$USE_GNUREGEX"; then if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then USE_GNUREGEX="yes" else cat > conftest.$ac_ext < #include @@ -7959,7 +8087,7 @@ regex_t t; regcomp(&t,"",0); ; return 0; } EOF -if { (eval echo configure:7963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* USE_GNUREGEX="no" else @@ -7991,12 +8119,12 @@ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7995: checking for $ac_func" >&5 +echo "configure:8123: 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${ac_exeext}; then +if { (eval echo configure:8151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8047,12 +8175,12 @@ echo $ac_n "checking Default FD_SETSIZE value""... $ac_c" 1>&6 -echo "configure:8051: checking Default FD_SETSIZE value" >&5 +echo "configure:8179: checking Default FD_SETSIZE value" >&5 if test "$cross_compiling" = yes; then DEFAULT_FD_SETSIZE=256 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then DEFAULT_FD_SETSIZE=`cat conftestval` else @@ -8096,7 +8224,7 @@ echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6 -echo "configure:8100: checking Maximum number of filedescriptors we can open" >&5 +echo "configure:8228: checking Maximum number of filedescriptors we can open" >&5 TLDFLAGS="$LDFLAGS" case $host in i386-unknown-freebsd*) @@ -8108,7 +8236,7 @@ SQUID_MAXFD=256 else cat > conftest.$ac_ext < @@ -8168,7 +8296,7 @@ } EOF -if { (eval echo configure:8172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_MAXFD=`cat conftestval` else @@ -8195,12 +8323,12 @@ LDFLAGS="$TLDFLAGS" echo $ac_n "checking Default UDP send buffer size""... $ac_c" 1>&6 -echo "configure:8199: checking Default UDP send buffer size" >&5 +echo "configure:8327: checking Default UDP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -8221,7 +8349,7 @@ } EOF -if { (eval echo configure:8225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_SNDBUF=`cat conftestval` else @@ -8240,12 +8368,12 @@ echo $ac_n "checking Default UDP receive buffer size""... $ac_c" 1>&6 -echo "configure:8244: checking Default UDP receive buffer size" >&5 +echo "configure:8372: checking Default UDP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -8266,7 +8394,7 @@ } EOF -if { (eval echo configure:8270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_RCVBUF=`cat conftestval` else @@ -8285,12 +8413,12 @@ echo $ac_n "checking Default TCP send buffer size""... $ac_c" 1>&6 -echo "configure:8289: checking Default TCP send buffer size" >&5 +echo "configure:8417: checking Default TCP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -8311,7 +8439,7 @@ } EOF -if { (eval echo configure:8315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_SNDBUF=`cat conftestval` else @@ -8334,12 +8462,12 @@ echo $ac_n "checking Default TCP receive buffer size""... $ac_c" 1>&6 -echo "configure:8338: checking Default TCP receive buffer size" >&5 +echo "configure:8466: checking Default TCP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -8360,7 +8488,7 @@ } EOF -if { (eval echo configure:8364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_RCVBUF=`cat conftestval` else @@ -8382,19 +8510,19 @@ EOF echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6 -echo "configure:8386: checking if sys_errlist is already defined" >&5 +echo "configure:8514: checking if sys_errlist is already defined" >&5 if eval "test \"`echo '$''{'ac_cv_needs_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *s = sys_errlist; ; return 0; } EOF -if { (eval echo configure:8398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_needs_sys_errlist="no" else @@ -8416,16 +8544,16 @@ fi echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6 -echo "configure:8420: checking for libresolv _dns_ttl_ hack" >&5 +echo "configure:8548: checking for libresolv _dns_ttl_ hack" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -8441,12 +8569,12 @@ rm -f conftest* echo $ac_n "checking if inet_ntoa() actually works""... $ac_c" 1>&6 -echo "configure:8445: checking if inet_ntoa() actually works" >&5 +echo "configure:8573: checking if inet_ntoa() actually works" >&5 if test "$cross_compiling" = yes; then INET_NTOA_RESULT="broken" else cat > conftest.$ac_ext < @@ -8465,7 +8593,7 @@ } EOF -if { (eval echo configure:8469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then INET_NTOA_RESULT=`cat conftestval` else @@ -8491,9 +8619,9 @@ if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then echo $ac_n "checking for working statvfs() interface""... $ac_c" 1>&6 -echo "configure:8495: checking for working statvfs() interface" >&5 +echo "configure:8623: checking for working statvfs() interface" >&5 cat > conftest.$ac_ext < @@ -8510,7 +8638,7 @@ ; return 0; } EOF -if { (eval echo configure:8514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_func_statvfs=yes else @@ -8530,12 +8658,12 @@ fi echo $ac_n "checking for _res.nsaddr_list""... $ac_c" 1>&6 -echo "configure:8534: checking for _res.nsaddr_list" >&5 +echo "configure:8662: checking for _res.nsaddr_list" >&5 if eval "test \"`echo '$''{'ac_cv_have_res_nsaddr_list'+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:8690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_res_nsaddr_list="yes" else @@ -8580,12 +8708,12 @@ if test $ac_cv_have_res_nsaddr_list = "no" ; then echo $ac_n "checking for _res.ns_list""... $ac_c" 1>&6 -echo "configure:8584: checking for _res.ns_list" >&5 +echo "configure:8712: checking for _res.ns_list" >&5 if eval "test \"`echo '$''{'ac_cv_have_res_ns_list'+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:8740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_res_ns_list="yes" else @@ -8930,6 +9058,7 @@ s%@AR_R@%$AR_R%g s%@ALLOCA@%$ALLOCA%g s%@CRYPTLIB@%$CRYPTLIB%g +s%@LIB_LBER@%$LIB_LBER%g s%@NEED_OWN_SNPRINTF_TRUE@%$NEED_OWN_SNPRINTF_TRUE%g s%@NEED_OWN_SNPRINTF_FALSE@%$NEED_OWN_SNPRINTF_FALSE%g s%@REGEXLIB@%$REGEXLIB%g diff -ruN squid-2.5.STABLE9/configure.in squid-2.5.STABLE10/configure.in --- squid-2.5.STABLE9/configure.in Wed Feb 23 16:54:54 2005 +++ squid-2.5.STABLE10/configure.in Mon May 16 16:41:14 2005 @@ -3,15 +3,15 @@ dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.251.2.81 2005/02/23 23:53:39 hno Exp $ +dnl $Id: configure.in,v 1.251.2.92 2005/05/16 22:38:57 hno Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_AUX_DIR(cfgaux) -AM_INIT_AUTOMAKE(squid, 2.5.STABLE9) +AM_INIT_AUTOMAKE(squid, 2.5.STABLE10) AM_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.251.2.81 $)dnl +AC_REVISION($Revision: 1.251.2.92 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -218,7 +218,11 @@ AC_SUBST(LIB_MALLOC) AC_ARG_ENABLE(gnuregex, -[ --enable-gnuregex Compile GNUregex], +[ --enable-gnuregex Compile GNUregex. Unless you have reason to use this + option, you should not enable it. This library file + is usually only required on Windows and very old + Unix boxes which do not have their own regex library + built in.], [USE_GNUREGEX=$enableval]) dnl This is a developer only option.. developers know how to set defines @@ -747,6 +751,75 @@ fi ]) +dnl Enable Large file support +buildmodel="" +needlargefiles= + +AC_ARG_WITH(large-files, +[ --with-large-files Enable support for large files (logs etc).], +[ if test "$withval" = yes; then + needlargefiles=1 + fi +]) + +AC_ARG_ENABLE(large-cache-files, +[ --enable-large-cache-files + Enable support for large cache files (>2GB). + WARNING: on-disk cache format is changed by this option], +[ if test "$enableval" = "yes" ; then + echo "Large cache file support enabled" + AC_DEFINE(LARGE_CACHE_FILES, 1, [Support large cache files > 2GB]) +dnl needlargefiles=1 + fi +]) + +dnl UNIX Build environment +AC_ARG_WITH(build-environment, +[ --with-build-environment=model + The build environment to use. Normally one of + POSIX_V6_ILP32_OFF32 32 bits + POSIX_V6_ILP32_OFFBIG 32 bits with large file support + POSIX_V6_LP64_OFF64 64 bits + POSIX_V6_LPBIG_OFFBIG large pointers and files + XBS5_ILP32_OFF32 32 bits (legacy) + XBS5_ILP32_OFFBIG 32 bits with large file support (legacy) + XBS5_LP64_OFF64 64 bits (legacy) + XBS5_LPBIG_OFFBIG large pointers and files (legacy) + default The default for your OS], +[ case "$enableval" in + yes|no) + echo "--with-build-environment expects a build environment string as used by getconf" + exit 1 + ;; + _*) + buildmodel="$enableval" + ;; + *) + buildmodel="_$enableval" + ;; + esac +]) + +if test $needlargefiles && test -z "$buildmodel"; then + for model in POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG; do + if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then + buildmodel=$model + break + fi + done + if test -z "$buildmodel"; then + echo "WARNING: No suitable build environment found for large files. Trying to use _FILE_OFFSET_BITS=64" + sleep 1 + CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS" + fi +fi +if test -n "$buildmodel" && test "$buildmodel" != "_default"; then + echo "Using $buildmodel build environment" + CFLAGS="`getconf ${buildmodel}_CFLAGS` $CFLAGS" + LIBS="`getconf ${buildmodel}_LIBS` $LIBS" + LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS" +fi + AM_CONDITIONAL(MAKE_LEAKFINDER, false) dnl Enable Leak Finding Functions AC_ARG_ENABLE(leakfinder, @@ -804,8 +877,7 @@ ]) dnl Disable hostname checks -enable_hostname_checks=1 -AC_ARG_ENABLE(hostname_checks, +AC_ARG_ENABLE(hostname-checks, [ --disable-hostname-checks Squid by default rejects any host names with odd characters in their name to conform with @@ -815,13 +887,13 @@ Squid does not reject such host names.. This may be required to participate in testbeds for international domain names.], -[ if test "$enableval" = "no"; then - echo "Disabling hostname sanity checks" - enable_hostname_checks=0 - fi -]) -if test "$enable_hostname_checks" = 1; then + [], + [enable_hostname_checks=yes]) +if test "$enable_hostname_checks" = "yes"; then + echo "Hostname sanity checks enabled" AC_DEFINE(CHECK_HOSTNAMES, 1, [Enable hostname sanity checks]) +else + echo "Disabling hostname sanity checks" fi dnl Enable underscore in hostnames @@ -1199,6 +1271,7 @@ errno.h \ execinfo.h \ fcntl.h \ + fnmatch.h \ getopt.h \ gnumalloc.h \ grp.h \ @@ -1583,6 +1656,10 @@ ;; esac +dnl LDAP helpers need to know if -llber is needed or not +AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"]) +AC_SUBST(LIB_LBER) + dnl System-specific library modifications dnl case "$host" in @@ -1740,6 +1817,7 @@ srand48 \ srandom \ statfs \ + strtoll \ sysconf \ syslog \ timegm \ diff -ruN squid-2.5.STABLE9/contrib/Makefile.in squid-2.5.STABLE10/contrib/Makefile.in --- squid-2.5.STABLE9/contrib/Makefile.in Sat Jul 10 06:11:39 2004 +++ squid-2.5.STABLE10/contrib/Makefile.in Fri Mar 18 17:55:41 2005 @@ -85,6 +85,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/doc/Makefile.am squid-2.5.STABLE10/doc/Makefile.am --- squid-2.5.STABLE9/doc/Makefile.am Sat Aug 31 04:26:36 2002 +++ squid-2.5.STABLE10/doc/Makefile.am Sun May 8 19:35:59 2005 @@ -1,14 +1,38 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.am,v 1.1.2.4 2002/08/31 10:26:36 robertc Exp $ +# $Id: Makefile.am,v 1.1.2.7 2005/05/09 01:35:59 hno Exp $ # # Uncomment and customize the following to suit your needs: # +DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf +DEFAULT_CACHEMGR_CONFIG = $(sysconfdir)/cachemgr.conf +DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf +DEFAULT_ERROR_DIR = $(datadir)/errors/@ERR_DEFAULT_LANGUAGE@ + +SUBSTITUTE=sed "\ + s%@DEFAULT_CONFIG_FILE@%$(DEFAULT_CONFIG_FILE)%g;\ + s%@DEFAULT_CACHEMGR_CONFIG@%$(DEFAULT_CACHEMGR_CONFIG)%g;\ + s%@DEFAULT_ERROR_DIR@%$(DEFAULT_ERROR_DIR)%g;\ + s%@DEFAULT_MIME_TABLE@%$(DEFAULT_MIME_TABLE)%g;\ + " + +squid.8: $(srcdir)/squid.8.in Makefile + $(SUBSTITUTE) < $(srcdir)/squid.8.in > $@ + +cachemgr.cgi.8: $(srcdir)/cachemgr.cgi.8.in Makefile + $(SUBSTITUTE) < $(srcdir)/cachemgr.cgi.8.in > $@ + man_MANS = \ - squid.8 + squid.8 \ + cachemgr.cgi.8 EXTRA_DIST = \ - squid.8 \ + squid.8.in \ + cachemgr.cgi.8.in \ debug-sections.txt + +CLEANFILES = \ + squid.8 \ + cachemgr.cgi.8 diff -ruN squid-2.5.STABLE9/doc/Makefile.in squid-2.5.STABLE10/doc/Makefile.in --- squid-2.5.STABLE9/doc/Makefile.in Sat Jul 10 06:11:40 2004 +++ squid-2.5.STABLE10/doc/Makefile.in Sun May 8 19:35:59 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.1.2.13 2004/07/10 12:11:40 hno Exp $ +# $Id: Makefile.in,v 1.1.2.17 2005/05/09 01:35:59 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ @@ -122,14 +123,34 @@ install_sh = @install_sh@ makesnmplib = @makesnmplib@ +DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf +DEFAULT_CACHEMGR_CONFIG = $(sysconfdir)/cachemgr.conf +DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf +DEFAULT_ERROR_DIR = $(datadir)/errors/@ERR_DEFAULT_LANGUAGE@ + +SUBSTITUTE = sed "\ + s%@DEFAULT_CONFIG_FILE@%$(DEFAULT_CONFIG_FILE)%g;\ + s%@DEFAULT_CACHEMGR_CONFIG@%$(DEFAULT_CACHEMGR_CONFIG)%g;\ + s%@DEFAULT_ERROR_DIR@%$(DEFAULT_ERROR_DIR)%g;\ + s%@DEFAULT_MIME_TABLE@%$(DEFAULT_MIME_TABLE)%g;\ + " + + man_MANS = \ - squid.8 + squid.8 \ + cachemgr.cgi.8 EXTRA_DIST = \ - squid.8 \ + squid.8.in \ + cachemgr.cgi.8.in \ debug-sections.txt + +CLEANFILES = \ + squid.8 \ + cachemgr.cgi.8 + subdir = doc mkinstalldirs = $(SHELL) $(top_srcdir)/cfgaux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/autoconf.h @@ -237,6 +258,7 @@ mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* @@ -291,6 +313,12 @@ mostlyclean mostlyclean-generic uninstall uninstall-am \ uninstall-info-am uninstall-man uninstall-man8 + +squid.8: $(srcdir)/squid.8.in Makefile + $(SUBSTITUTE) < $(srcdir)/squid.8.in > $@ + +cachemgr.cgi.8: $(srcdir)/cachemgr.cgi.8.in Makefile + $(SUBSTITUTE) < $(srcdir)/cachemgr.cgi.8.in > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -ruN squid-2.5.STABLE9/doc/cachemgr.cgi.8.in squid-2.5.STABLE10/doc/cachemgr.cgi.8.in --- squid-2.5.STABLE9/doc/cachemgr.cgi.8.in Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE10/doc/cachemgr.cgi.8.in Mon Apr 25 22:44:24 2005 @@ -0,0 +1,49 @@ +.TH cachemgr.cgi 8 2005-04-25 "squid 2.5.STABLE10" +.\" Copyright and licensing information +.\" goes here. +.SH NAME +cachemgr.cgi \- squid HTTP proxy manager interface +.SH SYNOPSIS +.B http://your.server/cgi-bin/cachemgr.cgi +.SH DESCRIPTION +The cache manager (cachemgr.cgi) is a CGI utility for displaying statistics +about the Squid HTTP proxy process as it runs. The cache manager is a +convenient way to manage the cache and view statistics without logging +into the server. +.SH FILES +.I ./cachemgr.conf +.br +.I @DEFAULT_CACHEMGR_CONFIG@ +.RS +The access configuration file defining which Squid servers may +be managed via this cachemgr.cgi program. Each line specifies a +.BR server : port +followed by an optional description +.P +The server name may contain shell wildcard characters such as *, [] etc. +A quick selection dropdown menu is automatically constructed from the simple +server names. +.P +Specifying :port is optional. If not specified then +the default proxy port is assumed. :* or :any matches +any port on the target server. +.RE +.SH SECURITY +cachemgr.cgi calls the requested server on the requested port using HTTP +and returns a formatted version of the response. To avoid abuse it is +recommended to configure your web server to restrict access to the +cachemgr.cgi program. +.P +Configuration examples for many common web servers can be found in the +Squid FAQ. +.SH SEE ALSO +.BR squid "(8)" +.br +.BR "The Squid FAQ" ", Chapter 9 The Cache Manager" +.\" Could add the following sections: +.\" .SH ENVIRONMENT +.\" .SH DIAGNOSTICS +.\" .SH BUGS +.\" .SH AUTHOR +.\" .SH SEE ALSO + diff -ruN squid-2.5.STABLE9/doc/squid.8 squid-2.5.STABLE10/doc/squid.8 --- squid-2.5.STABLE9/doc/squid.8 Mon Dec 18 14:54:18 2000 +++ squid-2.5.STABLE10/doc/squid.8 Wed Dec 31 17:00:00 1969 @@ -1,115 +0,0 @@ -.TH squid 8 "squid version 2.0" -.\" Copyright and licensing information -.\" goes here. -.SH NAME -squid \- proxy caching server -.SH SYNOPSIS -.B squid -[ -.B \-dhsvzCDFNRVYX -] [ -.BI \-f " config-file" -] [ -\-[ -.B au -] -.I port -] [ -.B \-k " signal" -] -.SH DESCRIPTION -.B squid -is a high-performance proxy caching server for web clients, -supporting FTP, gopher, and HTTP data objects. Unlike traditional -caching software, -.B squid -handles all requests in a single, non-blocking, I/O-driven process. -.PP -.B squid -keeps meta data and especially hot objects cached in RAM, -caches DNS lookups, supports non-blocking DNS lookups, and implements -negative caching of failed requests. -.PP -.B squid -supports SSL, extensive access controls, and full request -logging. By using the lightweight Internet Cache Protocol, -.B squid -caches can be arranged in a hierarchy or mesh for additional -bandwidth savings. -.PP -.B squid -consists of a main server program squid, a Domain Name System -lookup program dnsserver, some optional programs for rewriting -requests and performing authentication, and some management and client -tools. When squid starts up, it spawns a configurable number of -dnsserver processes, each of which can perform a single, blocking -Domain Name System (DNS) lookup. This reduces the amount of time the -cache waits for DNS lookups. -.PP -.B squid -is derived from the ARPA-funded Harvest Project -http://harvest.cs.colorado.edu/ -.PP -This manual page only lists the command line arguments. For details -on how to configure -.B squid -see the file -.BI /etc/squid/squid.conf, -the FAQ included with the distribution -and the documentation at the -.B squid -home page http://www.squid-cache.org -.PP -.SH OPTIONS -.IP "-a port" -Specify HTTP port number (default: 3128). -.IP "-d level" -Write debugging to stderr also. -.IP "-f file" -Use the given config-file instead of -.I /etc/squid/squid.conf -.IP -h -Print help message. -.IP "-k reconfigure | rotate | shutdown | interrupt | kill | debug | check | parse" -Parse configuration file, then send signal to running copy -(except -k parse) and exit. -.IP -s -Enable logging to syslog. -.IP "-u port" -Specify ICP port number (default: 3130), disable with 0. -.IP -v -Print version. -.IP -z -Create swap directories -.IP -C -Do not catch fatal signals. -.IP -D -Disable initial DNS tests. -.IP -F -Don't serve any requests until store is rebuilt. -.IP -N -No daemon mode. -.IP -R -Do not set REUSEADDR on port. -.IP -V -Virtual host httpd-accelerator. -.IP -X -Force full debugging. -.IP -Y -Only return UDP_HIT or UDP_MISS_NOFETCH during fast reload. -.SH FILES -.I /etc/squid/squid.conf -.RS -The main configuration file. You must initially make -changes to this file for -.B squid -to work. For example, the default configuration does not -allow access from any browser. - -.\" Could add the following sections: -.\" .SH ENVIRONMENT -.\" .SH DIAGNOSTICS -.\" .SH BUGS -.\" .SH AUTHOR -.\" .SH SEE ALSO - diff -ruN squid-2.5.STABLE9/doc/squid.8.in squid-2.5.STABLE10/doc/squid.8.in --- squid-2.5.STABLE9/doc/squid.8.in Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE10/doc/squid.8.in Mon Apr 25 22:04:30 2005 @@ -0,0 +1,147 @@ +.TH squid 8 2005-04-25 "squid 2.5.STABLE10" +.\" Copyright and licensing information +.\" goes here. +.SH NAME +squid \- proxy caching server +.SH SYNOPSIS +.B squid +[ +.B \-dhsvzCDFNRVYX +] [ +.BI \-l " facility" +] [ +.BI \-f " config-file" +] [ +\-[ +.B au +] +.I port +] [ +.B \-k " signal" +] +.SH DESCRIPTION +.B squid +is a high-performance proxy caching server for web clients, +supporting FTP, gopher, and HTTP data objects. Unlike traditional +caching software, +.B squid +handles all requests in a single, non-blocking, I/O-driven process. +.PP +.B squid +keeps meta data and especially hot objects cached in RAM, +caches DNS lookups, supports non-blocking DNS lookups, and implements +negative caching of failed requests. +.PP +.B squid +supports SSL, extensive access controls, and full request +logging. By using the lightweight Internet Cache Protocol, +.B squid +caches can be arranged in a hierarchy or mesh for additional +bandwidth savings. +.PP +.B squid +consists of a main server program squid, a Domain Name System +lookup program dnsserver, some optional programs for rewriting +requests and performing authentication, and some management and client +tools. When squid starts up, it spawns a configurable number of +dnsserver processes, each of which can perform a single, blocking +Domain Name System (DNS) lookup. This reduces the amount of time the +cache waits for DNS lookups. +.PP +.B squid +is derived from the ARPA-funded Harvest Project +http://harvest.cs.colorado.edu/ +.PP +This manual page only lists the command line arguments. For details +on how to configure +.B squid +see the file +.BI @DEFAULT_CONFIG_FILE@, +the Squid FAQ and the documentation at the +.B squid +home page http://www.squid-cache.org +.PP +.SH OPTIONS +.IP "-a port" +Specify HTTP port number (default: 3128). +.IP "-d level" +Write debugging to stderr also. +.IP "-f file" +Use the given config-file instead of +.I @DEFAULT_CONFIG_FILE@ +.IP -h +Print help message. +.IP "-k reconfigure | rotate | shutdown | interrupt | kill | debug | check | parse" +Parse configuration file, then send signal to running copy +(except -k parse) and exit. +.IP -s +Enable logging to syslog. +.IP "-l facility" +Use specified syslog facility. implies -s +.IP "-u port" +Specify ICP port number (default: 3130), disable with 0. +.IP -v +Print version. +.IP -z +Create swap directories +.IP -C +Do not catch fatal signals. +.IP -D +Disable initial DNS tests. +.IP -F +Don't serve any requests until store is rebuilt. +.IP -N +No daemon mode. +.IP -R +Do not set REUSEADDR on port. +.IP -V +Virtual host httpd-accelerator. +.IP -X +Force full debugging. +.IP -Y +Only return UDP_HIT or UDP_MISS_NOFETCH during fast reload. +.SH FILES +.I @DEFAULT_CONFIG_FILE@ +.RS +The main configuration file. You must initially make +changes to this file for +.B squid +to work. For example, the default configuration does not +allow access from any browser. +.RE + +.I @DEFAULT_CONFIG_FILE@.default +.RS +Reference copy of the configuration file. Always kept up to date with +the version of Squid you are using. Use this to look up configuration +syntax after upgrading. +.RE + +.I @DEFAULT_MIME_TABLE@ (mime_table) +.RS +MIME type mappings for FTP gatewaying +.RE + +.I @DEFAULT_ERROR_DIR@ (error_directory) +.RS +Error page templates +.RE + +.SH SEE ALSO +.BR cachemgr.cgi "(8), " +.BR pam_auth "(8), " +.BR squid_ldap_auth "(8), " +.BR squid_ldap_group "(8), " +.BR squid_unix_group "(8), " +.br +.B The Squid FAQ + + + +.\" Could add the following sections: +.\" .SH ENVIRONMENT +.\" .SH DIAGNOSTICS +.\" .SH BUGS +.\" .SH AUTHOR +.\" .SH SEE ALSO + diff -ruN squid-2.5.STABLE9/errors/Makefile.in squid-2.5.STABLE10/errors/Makefile.in --- squid-2.5.STABLE9/errors/Makefile.in Sat Jul 10 06:11:41 2004 +++ squid-2.5.STABLE10/errors/Makefile.in Fri Mar 18 17:55:41 2005 @@ -14,7 +14,7 @@ @SET_MAKE@ # -# $Id: Makefile.in,v 1.15.2.16 2004/07/10 12:11:41 hno Exp $ +# $Id: Makefile.in,v 1.15.2.17 2005/03/19 00:55:41 hno Exp $ # SHELL = @SHELL@ @@ -84,6 +84,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_ACCESS_DENIED squid-2.5.STABLE10/errors/Romanian/ERR_ACCESS_DENIED --- squid-2.5.STABLE9/errors/Romanian/ERR_ACCESS_DENIED Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_ACCESS_DENIED Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -18,9 +17,8 @@ Accesul refuzat.

    -Controlul accesului a prevenit cererea d-voastrã -de a fi acceptatã la acest moment. Vã rugãm contactaþi -providerul d-voastrã daca credeþi cã acest lucru -este incorect. +Controlul accesului a prevenit cererea d-voastrã de a fi +acceptatã la acest moment. Vã rugãm contactaþi providerul +d-voastrã daca credeþi cã acest lucru este incorect. -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_CACHE_ACCESS_DENIED squid-2.5.STABLE10/errors/Romanian/ERR_CACHE_ACCESS_DENIED --- squid-2.5.STABLE9/errors/Romanian/ERR_CACHE_ACCESS_DENIED Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_CACHE_ACCESS_DENIED Wed Apr 27 16:28:24 2005 @@ -1,11 +1,10 @@ - -EROARE: URL-ul cerut nu a putut fi citit - + +EROARE: Accesul la cache vã este refuzat -

    ERROR

    -

    URL-ul cerut nu a putut fi citit

    +

    EROARE

    +

    Accesul la cache vã este refuzat


    În timp ce citeam URL-ul: @@ -22,11 +21,11 @@

    Ne pare rãu, dar nu sunteþi îndreptãþit sã accesaþi:

        %U
    -din acest cache pana cand nu v-aþi autenticat. +din acest cache pânã când nu v-aþi autenticat.

    -Aveti nevoie de Netscape versiunea 2.0 sau mai mare, sau Microsoft +Aveþi nevoie de Netscape versiunea 2.0 sau mai mare, sau Microsoft Internet Explorer 3.0, sau un browser care cunoaºte HTTP/1.1 pentru a vã putea autentica. Vã rugãm contactaþi administratorul cache-ului daca aveþi dificultãþi în autentificare diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_CACHE_MGR_ACCESS_DENIED squid-2.5.STABLE10/errors/Romanian/ERR_CACHE_MGR_ACCESS_DENIED --- squid-2.5.STABLE9/errors/Romanian/ERR_CACHE_MGR_ACCESS_DENIED Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_CACHE_MGR_ACCESS_DENIED Wed Apr 27 16:28:24 2005 @@ -1,11 +1,10 @@ - + EROARE: Accesul interzis la Managerul Cache-ului - -

    ERROR

    +

    EROARE

    Accesul interzis la Managerul Cache-ului


    @@ -16,22 +15,21 @@

    • -Accesul interzis la Managerul Cache-ului +Accesul interzis la Managerul Cache-ului.

    Ne pare rãu, dar nu sunteþi îndreptãþit sã accesaþi:

        %U
    -din acest cache pana cand nu v-aþi autenticat. +din acest cache pânã când nu v-aþi autenticat.

    -Aveti nevoie de Netscape versiunea 2.0 sau mai mare, sau Microsoft +Aveþi nevoie de Netscape versiunea 2.0 sau mai mare, sau Microsoft Internet Explorer 3.0, sau un browser care cunoaºte HTTP/1.1 pentru a vã putea autentica. Vã rugãm contactaþi administratorul cache-ului daca aveþi dificultãþi în autentificare sau, dacã sunteþi administratorul, citiþi în documentaþia Squid-ului secþiunea despre interfaþa managerului de cache ºi verificaþi logurile pentru mesaje de eroare mai detaliate. -

    diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_CANNOT_FORWARD squid-2.5.STABLE10/errors/Romanian/ERR_CANNOT_FORWARD --- squid-2.5.STABLE9/errors/Romanian/ERR_CANNOT_FORWARD Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_CANNOT_FORWARD Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -25,6 +24,6 @@

    • Administratorul cache-ului nu permite acestui cache sã facã conexiuni directe cãtre serverele de origine, ºi -
    • Toate cache-urile pãrinte nu pot fi contactate îm acest moment. +
    • Nici un cache pãrinte nu poate fi contactat în acest moment.
    -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_CONNECT_FAIL squid-2.5.STABLE10/errors/Romanian/ERR_CONNECT_FAIL --- squid-2.5.STABLE9/errors/Romanian/ERR_CONNECT_FAIL Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_CONNECT_FAIL Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -25,5 +24,5 @@

    Calculatorul sau reþeaua destinaþie s-ar putea sã fie inoperabile. -Repetaþi cererea mai târziu. -

    +Vã rog repetaþi cererea. +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_DNS_FAIL squid-2.5.STABLE10/errors/Romanian/ERR_DNS_FAIL --- squid-2.5.STABLE9/errors/Romanian/ERR_DNS_FAIL Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_DNS_FAIL Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -16,7 +15,6 @@ Nu pot determina adresa IP din numele host-ului pentru %H -

    Serverul de DNS a returnat: @@ -30,4 +28,4 @@ Cache-ul nu a putut rezolva numele host-ului scris în URL. Verificaþi dacã adresa este corectã. -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_FORWARDING_DENIED squid-2.5.STABLE10/errors/Romanian/ERR_FORWARDING_DENIED --- squid-2.5.STABLE9/errors/Romanian/ERR_FORWARDING_DENIED Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_FORWARDING_DENIED Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -23,4 +22,4 @@ Acest cache nu va înainta cererea dumneavoastrã din cauzã cã încearcã sã stabileascã o relaþie de echivalenþã. Poate cã clientul %i este un cache care a fost configurat greºit. -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_FTP_DISABLED squid-2.5.STABLE10/errors/Romanian/ERR_FTP_DISABLED --- squid-2.5.STABLE9/errors/Romanian/ERR_FTP_DISABLED Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_FTP_DISABLED Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -21,4 +20,4 @@

    Acest cache nu suportã protocolul FTP. -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_FTP_FAILURE squid-2.5.STABLE10/errors/Romanian/ERR_FTP_FAILURE --- squid-2.5.STABLE9/errors/Romanian/ERR_FTP_FAILURE Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_FTP_FAILURE Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -17,9 +16,4 @@ ºi a primit aceastã replicã

    %F
    %g
    -

    -Acest lucru ar putea fi cauzat de un URL FTP cu o cale absolutã -(fapt care nu este coform cu standardul RFC 1738). Dacã aceasta -este cauza, atunci fiºierul poate fi gãsit la adresa -%B. -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_FTP_FORBIDDEN squid-2.5.STABLE10/errors/Romanian/ERR_FTP_FORBIDDEN --- squid-2.5.STABLE9/errors/Romanian/ERR_FTP_FORBIDDEN Wed Aug 28 15:08:09 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_FTP_FORBIDDEN Wed Apr 27 16:28:24 2005 @@ -1,19 +1,19 @@ - -ERROR: The requested URL could not be retrieved + +EROARE: URL-ul cerut nu a putut fi citit -

    ERROR

    -

    The requested URL could not be retrieved

    +

    EROARE

    +

    URL-ul cerut nu a putut fi citit


    -An FTP authentication failure occurred -while trying to retrieve the URL: +O eroare de autentificare FTP s-a întâmplat +în timp ce încercam sã citesc URL-ul: %U

    -Squid sent the following FTP command: +Squid a trimis urmãtoarea comandã FTP:

    %f
    -and then received this reply +ºi apoi a primit aceastã replicã
    %F
    %g
    -

    Your cache administrator is %w. +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_FTP_NOT_FOUND squid-2.5.STABLE10/errors/Romanian/ERR_FTP_NOT_FOUND --- squid-2.5.STABLE9/errors/Romanian/ERR_FTP_NOT_FOUND Wed Aug 28 15:08:09 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_FTP_NOT_FOUND Wed Apr 27 16:28:24 2005 @@ -1,22 +1,23 @@ - -ERROR: The requested URL could not be retrieved + +EROARE: URL-ul cerut nu a putut fi citit -

    ERROR

    -

    The requested URL could not be retrieved

    +

    EROARE

    +

    URL-ul cerut nu a putut fi citit


    -The following URL could not be retrieved: +Urmãtorul URL nu a putut fi citit: %U

    -Squid sent the following FTP command: +Squid a trimis urmãtoarea comandã FTP:

    %f
    -and then received this reply +ºi apoi a primit aceastã replicã
    %F
    %g

    -This might be caused by an FTP URL with an absolute path (which does -not comply with RFC 1738). If this is the cause, then the file -can be found at %B. -

    Your cache administrator is %w. +Acest lucru ar putea fi cauzat de un URL FTP cu o cale absolutã +(fapt care nu este conform cu standardul RFC 1738). Dacã aceasta +este cauza, atunci fiºierul poate fi gãsit la adresa +%B. +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_FTP_PUT_CREATED squid-2.5.STABLE10/errors/Romanian/ERR_FTP_PUT_CREATED --- squid-2.5.STABLE9/errors/Romanian/ERR_FTP_PUT_CREATED Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_FTP_PUT_CREATED Wed Apr 27 16:28:24 2005 @@ -1,12 +1,8 @@ - + Comanda FTP PUT a reuºit: Fiºierul a fost creat -

    Operaþiune reuºitãl

    Fiºierul a fost creat


    -

    -

    - diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_FTP_PUT_ERROR squid-2.5.STABLE10/errors/Romanian/ERR_FTP_PUT_ERROR --- squid-2.5.STABLE9/errors/Romanian/ERR_FTP_PUT_ERROR Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_FTP_PUT_ERROR Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: Trimiterea de fiºier prin FTP a eºuat - -

    ERROR

    +

    EROARE

    Comanda FTP PUT/trimiterea a eºuat


    @@ -25,4 +24,4 @@ Verificaþi calea, drepturile, spaþiul liber ºi încercaþi din nou. -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_FTP_PUT_MODIFIED squid-2.5.STABLE10/errors/Romanian/ERR_FTP_PUT_MODIFIED --- squid-2.5.STABLE9/errors/Romanian/ERR_FTP_PUT_MODIFIED Wed Aug 28 15:08:09 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_FTP_PUT_MODIFIED Wed Apr 27 16:28:24 2005 @@ -1,11 +1,8 @@ - + Comanda FTP PUT a reuºit: Fiºierul a fost modificat

    Operaþiune reuºitã

    -

    Fiºier modificat

    +

    Fiºier actualizat


    -

    -

    - diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_FTP_UNAVAILABLE squid-2.5.STABLE10/errors/Romanian/ERR_FTP_UNAVAILABLE --- squid-2.5.STABLE9/errors/Romanian/ERR_FTP_UNAVAILABLE Wed Aug 28 15:08:09 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_FTP_UNAVAILABLE Wed Apr 27 16:28:24 2005 @@ -1,18 +1,19 @@ - -ERROR: The requested URL could not be retrieved + +EROARE: URL-ul cerut nu a putut fi citit -

    ERROR

    -

    The requested URL could not be retrieved

    +

    EROARE

    +

    URL-ul cerut nu a putut fi citit


    -The FTP server was too busy while trying to retrieve the URL: +Serverul de FTP a fost prea ocupat în timp ce am încercat sã +citesc URL-ul: %U

    -Squid sent the following FTP command: +Squid a trimis urmãtoarea comandã FTP:

    %f
    -and then received this reply +ºi apoi a primit aceastã replicã
    %F
    %g
    -

    Your cache administrator is %w. +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_INVALID_REQ squid-2.5.STABLE10/errors/Romanian/ERR_INVALID_REQ --- squid-2.5.STABLE9/errors/Romanian/ERR_INVALID_REQ Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_INVALID_REQ Wed Apr 27 16:28:24 2005 @@ -1,15 +1,16 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    -În timp ce citeam URL-ul: -%U +În timp ce încercam sã procesez cererea: +

    +%R
    +

    Am întâlnit urmãtoarea eroare:

      @@ -29,4 +30,4 @@
    • Câmpul Content-Length lipseºte pentru cereri POST sau PUT
    • Caracter(e) ilegal în numele calculatorului; underscore (_) nu este acceptat
    -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_INVALID_RESP squid-2.5.STABLE10/errors/Romanian/ERR_INVALID_RESP --- squid-2.5.STABLE9/errors/Romanian/ERR_INVALID_RESP Mon Jan 17 15:13:03 2005 +++ squid-2.5.STABLE10/errors/Romanian/ERR_INVALID_RESP Wed Apr 27 16:28:24 2005 @@ -1,29 +1,30 @@ - -ERROR: The requested URL could not be retrieved + +EROARE: URL-ul cerut nu a putut fi citit -

    ERROR

    -

    The requested URL could not be retrieved

    +

    EROARE

    +

    URL-ul cerut nu a putut fi citit


    -While trying to process the request: +În timp ce încercam sã procesez cererea:

     %R
     

    -The following error was encountered: +Am întâlnit urmãtoarea eroare:

    • -Invalid Response +Rãspuns invalid

    -The HTTP Response message received from the contacted server -could not be understood or was otherwise malformed. Please contact -the site operator. Your cache administrator may be able to provide -you with more details about the exact nature of the problem if needed. +Mesajul de rãspuns HTTP primit de la serverul contactat +nu a putut fi înþeles sau a fost deformat. Vã rog sã contactaþi +operatorul serverului. Administratorul proxy-ului s-ar putea +sã vã fie de ajutor cu mai multe detalii despre natura exactã a +aceastei probleme dacã vã este necesar. -

    Your cache administrator is %w. +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_INVALID_URL squid-2.5.STABLE10/errors/Romanian/ERR_INVALID_URL --- squid-2.5.STABLE9/errors/Romanian/ERR_INVALID_URL Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_INVALID_URL Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -27,4 +26,4 @@

  • Caracterul escape-dublu este ilegal în calea URL
  • Caracter(e) ilegal în numele calculatorului; underscore (_) nu este acceptat -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_LIFETIME_EXP squid-2.5.STABLE10/errors/Romanian/ERR_LIFETIME_EXP --- squid-2.5.STABLE9/errors/Romanian/ERR_LIFETIME_EXP Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_LIFETIME_EXP Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -15,11 +14,11 @@

    • -Durate de viaþã a conexiunii a expirat +Durata de viaþã a conexiunii a expirat

    Squid a terminat conexiunea din cauzã cã a depãºit durata maximã admisã pentru o conexiune. -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_NO_RELAY squid-2.5.STABLE10/errors/Romanian/ERR_NO_RELAY --- squid-2.5.STABLE9/errors/Romanian/ERR_NO_RELAY Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_NO_RELAY Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -21,4 +20,4 @@

    Nu este definit nici un calculator relay Wais pentru acest cache! Strigaþi la administrator! -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_ONLY_IF_CACHED_MISS squid-2.5.STABLE10/errors/Romanian/ERR_ONLY_IF_CACHED_MISS --- squid-2.5.STABLE9/errors/Romanian/ERR_ONLY_IF_CACHED_MISS Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_ONLY_IF_CACHED_MISS Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -15,15 +14,17 @@

    • -Un document cu cale corectã de altfel nu a fost gãsit în cache ºi -directiva only-if-cached (numai dacã este deja în cache) +Un document valid nu a fost gãsit în cache ºi directiva +only-if-cached (numai dacã este deja în cache) a fost specificatã.

    -Aþi cerut un document cu directiva only-if-cached + +Aþi cerut un document cu directiva de control only-if-cached (numai dacã existã deja în cache). Documentul nu a fost gãsit în -cache, sau a necesitat o revalidare, revalidare interzisã +cache, sau a necesitat o revalidare interzisã de directivaonly-if-cached. -

    + +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_READ_ERROR squid-2.5.STABLE10/errors/Romanian/ERR_READ_ERROR --- squid-2.5.STABLE9/errors/Romanian/ERR_READ_ERROR Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_READ_ERROR Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -26,4 +25,4 @@

    O condiþie de eroare în timp ce citeam date din reþea. Vã rog retrimiteþi cererea. -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_READ_TIMEOUT squid-2.5.STABLE10/errors/Romanian/ERR_READ_TIMEOUT --- squid-2.5.STABLE9/errors/Romanian/ERR_READ_TIMEOUT Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_READ_TIMEOUT Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

    ERROR

    +

    EROARE

    URL-ul cerut nu a putut fi citit


    @@ -27,4 +26,4 @@ O depãºire de duratã s-a întâmplat îm timp ce citeam date din reþea. Serverul sau reþeaua ar putea fi inpoerabile sau congestionate. Încercaþi din nou. -

    +

    Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_SHUTTING_DOWN squid-2.5.STABLE10/errors/Romanian/ERR_SHUTTING_DOWN --- squid-2.5.STABLE9/errors/Romanian/ERR_SHUTTING_DOWN Wed Aug 28 15:08:09 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_SHUTTING_DOWN Wed Apr 27 16:28:24 2005 @@ -1,19 +1,18 @@ - -ERROR: The requested URL could not be retrieved + +EROARE: URL-ul cerut nu a putut fi citit -

    ERROR

    -

    The requested URL could not be retrieved

    +

    EROARE

    +

    URL-ul cerut nu a putut fi citit


    -While trying to retrieve the URL: +În timp ce citeam URL-ul: %U

    -The following error was encountered: -

      +Am întâlnit urmãtoarea eroare:

      -This cache is in the process of shutting down and can not -service your request at this time. Please retry your -request again soon. -

      +Acest cache este în curs de oprire ºi nu poate servi +cererea d-voastrã în acest moment. Vã rog sã reîncercaþi +în curând. +

      Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_SOCKET_FAILURE squid-2.5.STABLE10/errors/Romanian/ERR_SOCKET_FAILURE --- squid-2.5.STABLE9/errors/Romanian/ERR_SOCKET_FAILURE Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_SOCKET_FAILURE Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

      ERROR

      +

      EROARE

      URL-ul cerut nu a putut fi citit


      @@ -25,5 +24,5 @@

      Squid nu a reuºit sã creeze un socket TCP, probabil din cauza încãrcãrii -excesive. Încercaþi mai târziu. -

      +excesive. Încercaþi mai târziu. +

      Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_TOO_BIG squid-2.5.STABLE10/errors/Romanian/ERR_TOO_BIG --- squid-2.5.STABLE9/errors/Romanian/ERR_TOO_BIG Wed Aug 28 15:08:09 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_TOO_BIG Wed Apr 27 16:28:24 2005 @@ -1,28 +1,29 @@ - -ERROR: The requested URL could not be retrieved + +EROARE: URL-ul cerut nu a putut fi citit -

      ERROR

      -

      The requested URL could not be retrieved

      +

      EROARE

      +

      URL-ul cerut nu a putut fi citit


      -While trying to retrieve the URL: +În timp ce citeam URL-ul: %U

      -The following error was encountered: +Am întâlnit urmãtoarea eroare:

      • -The request or reply is too large. +Cererea sau rãspunsul sunt prea mari.

        -If you are making a POST or PUT request, then your request body -(the thing you are trying to upload) is too large. If you are -making a GET request, then the reply body (what you are trying -to download) is too large. These limits have been established -by the Internet Service Provider who operates this cache. Please -contact them directly if you feel this is an error. +Dacã faceþi o cerere de tipul POST sau PUT, atunci conþinutul +cererii d-voastre (datele care încercaþi sã le trimiteþi) sunt +prea mari. Dacã faceþi o cerere de tipul GET, atunci rãspunsul +serverului (ceaa ce încercaþi sã aduceþi) este prea mare. Aceste +limite au fost stabilite de cãtre providerul de internet (ISP-ul) +care administreazã acest cache. Va rugãm sã îi contactaþi direct +dacã consideraþi cã acest lucru este o eroare.

      -Your cache administrator is %w. +Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_UNSUP_REQ squid-2.5.STABLE10/errors/Romanian/ERR_UNSUP_REQ --- squid-2.5.STABLE9/errors/Romanian/ERR_UNSUP_REQ Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_UNSUP_REQ Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

      ERROR

      +

      EROARE

      URL-ul cerut nu a putut fi citit


      @@ -22,4 +21,4 @@

      Squid nu suportã toate cererile sub toate protocoalele. De exemplu, nu puteþi sã POST o cerere Gopher. -

      +

      Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_URN_RESOLVE squid-2.5.STABLE10/errors/Romanian/ERR_URN_RESOLVE --- squid-2.5.STABLE9/errors/Romanian/ERR_URN_RESOLVE Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_URN_RESOLVE Wed Apr 27 16:28:24 2005 @@ -1,14 +1,13 @@ - -EROARE: URL-ul cerut nu a putut fi citit - + +EROARE: URN-ul cerut nu a putut fi citit -

      ERROR

      -

      URL-ul cerut nu a putut fi citit

      +

      EROARE

      +

      Un URL pentru URN-ul cerut nu a putut fi citit


      -În timp ce citeam URL-ul: +În timp ce citeam URN-ul: %U

      Am întâlnit urmãtoarea eroare: @@ -21,4 +20,4 @@

      Hei, nu te aºtepta la prea multe de la URN-uri pe %T :) -

      +

      Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_WRITE_ERROR squid-2.5.STABLE10/errors/Romanian/ERR_WRITE_ERROR --- squid-2.5.STABLE9/errors/Romanian/ERR_WRITE_ERROR Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_WRITE_ERROR Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

      ERROR

      +

      EROARE

      URL-ul cerut nu a putut fi citit


      @@ -24,6 +23,6 @@

          %E

      -O condiþie de eroare a survenit în timp ce scriam date în reþea. Reîncercaþi -operaþia. -

      +O condiþie de eroare a survenit în timp ce scriam date în reþea. Vã rog +reîncercaþi operaþia. +

      Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/ERR_ZERO_SIZE_OBJECT squid-2.5.STABLE10/errors/Romanian/ERR_ZERO_SIZE_OBJECT --- squid-2.5.STABLE9/errors/Romanian/ERR_ZERO_SIZE_OBJECT Mon Aug 26 19:17:21 2002 +++ squid-2.5.STABLE10/errors/Romanian/ERR_ZERO_SIZE_OBJECT Wed Apr 27 16:28:24 2005 @@ -1,10 +1,9 @@ - + EROARE: URL-ul cerut nu a putut fi citit - -

      ERROR

      +

      EROARE

      URL-ul cerut nu a putut fi citit


      @@ -21,4 +20,4 @@

      Squid nu a recepþionat nici o informaþie ca urmare a acestei cereri. -

      +

      Administratorul cache-ului d-voastrã este %w. diff -ruN squid-2.5.STABLE9/errors/Romanian/README squid-2.5.STABLE10/errors/Romanian/README --- squid-2.5.STABLE9/errors/Romanian/README Thu Jan 14 16:59:12 1999 +++ squid-2.5.STABLE10/errors/Romanian/README Wed Apr 27 16:28:24 2005 @@ -1,2 +1,2 @@ -Thank you to Iusty Pop Daniel for +Thank you to Iustin Pop Daniel for creating these error pages in Romanian! diff -ruN squid-2.5.STABLE9/helpers/Makefile.in squid-2.5.STABLE10/helpers/Makefile.in --- squid-2.5.STABLE9/helpers/Makefile.in Sat Jul 10 06:11:41 2004 +++ squid-2.5.STABLE10/helpers/Makefile.in Fri Mar 18 17:55:41 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/LDAP/Makefile.am squid-2.5.STABLE10/helpers/basic_auth/LDAP/Makefile.am --- squid-2.5.STABLE9/helpers/basic_auth/LDAP/Makefile.am Sun Aug 11 19:13:37 2002 +++ squid-2.5.STABLE10/helpers/basic_auth/LDAP/Makefile.am Fri Mar 18 17:53:55 2005 @@ -1,7 +1,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.am,v 1.1.2.4 2002/08/12 01:13:37 hno Exp $ +# $Id: Makefile.am,v 1.1.2.5 2005/03/19 00:53:55 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -11,5 +11,5 @@ EXTRA_DIST = squid_ldap_auth.8 squid_ldap_auth_SOURCES = squid_ldap_auth.c -LDADD = -L$(top_builddir)/lib -lmiscutil -lldap -llber $(XTRA_LIBS) +LDADD = -L$(top_builddir)/lib -lmiscutil -lldap $(LIB_LBER) $(XTRA_LIBS) INCLUDES = -I$(top_srcdir)/include diff -ruN squid-2.5.STABLE9/helpers/basic_auth/LDAP/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/LDAP/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/LDAP/Makefile.in Sat Jul 10 06:11:41 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/LDAP/Makefile.in Fri Mar 18 17:55:41 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.in,v 1.8.2.13 2004/07/10 12:11:41 hno Exp $ +# $Id: Makefile.in,v 1.8.2.14 2005/03/19 00:55:41 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ @@ -127,7 +128,7 @@ EXTRA_DIST = squid_ldap_auth.8 squid_ldap_auth_SOURCES = squid_ldap_auth.c -LDADD = -L$(top_builddir)/lib -lmiscutil -lldap -llber $(XTRA_LIBS) +LDADD = -L$(top_builddir)/lib -lmiscutil -lldap $(LIB_LBER) $(XTRA_LIBS) INCLUDES = -I$(top_srcdir)/include subdir = helpers/basic_auth/LDAP mkinstalldirs = $(SHELL) $(top_srcdir)/cfgaux/mkinstalldirs diff -ruN squid-2.5.STABLE9/helpers/basic_auth/LDAP/squid_ldap_auth.c squid-2.5.STABLE10/helpers/basic_auth/LDAP/squid_ldap_auth.c --- squid-2.5.STABLE9/helpers/basic_auth/LDAP/squid_ldap_auth.c Sun Feb 20 12:07:44 2005 +++ squid-2.5.STABLE10/helpers/basic_auth/LDAP/squid_ldap_auth.c Fri Apr 22 14:29:29 2005 @@ -252,15 +252,24 @@ if (version == -1) { version = LDAP_VERSION2; } - if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version) - != LDAP_OPT_SUCCESS) { + if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version) != LDAP_SUCCESS) { fprintf(stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version); exit(1); } - if (use_tls && (version == LDAP_VERSION3) && (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS)) { - fprintf(stderr, "Could not Activate TLS connection\n"); + if (use_tls) { +#ifdef LDAP_OPT_X_TLS + if (version == LDAP_VERSION3 && ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) { + fprintf(stderr, "Could not Activate TLS connection\n"); + exit(1); + } else { + fprintf(stderr, "TLS requires LDAP version 3\n"); + exit(1); + } +#else + fprintf(stderr, "TLS not supported with your LDAP library\n"); exit(1); +#endif } #endif squid_ldap_set_timelimit(ld, timelimit); @@ -516,7 +525,7 @@ rfc1738_unescape(user); rfc1738_unescape(passwd); if (!validUsername(user)) { - printf("ERR\n"); + printf("ERR No such user\n"); continue; } tryagain = (ld != NULL); @@ -530,7 +539,7 @@ ld = NULL; goto recover; } - printf("ERR\n"); + printf("ERR %s\n", ldap_err2string(squid_ldap_errno(ld))); } else { printf("OK\n"); } diff -ruN squid-2.5.STABLE9/helpers/basic_auth/MSNT/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/MSNT/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/MSNT/Makefile.in Sat Jul 10 06:11:41 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/MSNT/Makefile.in Fri Mar 18 17:55:41 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.7.2.15 2004/07/10 12:11:41 hno Exp $ +# $Id: Makefile.in,v 1.7.2.16 2005/03/19 00:55:41 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/MSNT/rfcnb-util.c squid-2.5.STABLE10/helpers/basic_auth/MSNT/rfcnb-util.c --- squid-2.5.STABLE9/helpers/basic_auth/MSNT/rfcnb-util.c Wed Jun 26 13:11:16 2002 +++ squid-2.5.STABLE10/helpers/basic_auth/MSNT/rfcnb-util.c Wed Mar 9 07:28:32 2005 @@ -410,7 +410,7 @@ RFCNB_saved_errno = errno; return (RFCNBE_Bad); } - bzero((char *) &Socket, sizeof(Socket)); + memset((char *) &Socket, 0, sizeof(Socket)); memcpy((char *) &Socket.sin_addr, (char *) &Dest_IP, sizeof(Dest_IP)); Socket.sin_port = htons(port); diff -ruN squid-2.5.STABLE9/helpers/basic_auth/MSNT/smbencrypt.c squid-2.5.STABLE10/helpers/basic_auth/MSNT/smbencrypt.c --- squid-2.5.STABLE9/helpers/basic_auth/MSNT/smbencrypt.c Wed Jun 26 13:11:17 2002 +++ squid-2.5.STABLE10/helpers/basic_auth/MSNT/smbencrypt.c Wed Mar 9 07:33:01 2005 @@ -158,7 +158,7 @@ E_P16((uchar *) passwd, (uchar *) p16); /* clear out local copy of user's password (just being paranoid). */ - bzero(passwd, sizeof(passwd)); + memset(passwd, 0, sizeof(passwd)); } /**************************************************************************** @@ -194,16 +194,16 @@ } else if (is_kana(*s)) { s++; } else { - if (islower(*s)) - *s = toupper(*s); + if (islower((int)(unsigned char)*s)) + *s = toupper((int)(unsigned char)*s); s++; } } else #endif /* KANJI_WIN95_COMPATIBILITY */ #endif /* UNUSED_CODE */ { - if (islower(*s)) - *s = toupper(*s); + if (islower((int)(unsigned char)*s)) + *s = toupper((int)(unsigned char)*s); s++; } } diff -ruN squid-2.5.STABLE9/helpers/basic_auth/MSNT/smblib-util.c squid-2.5.STABLE10/helpers/basic_auth/MSNT/smblib-util.c --- squid-2.5.STABLE9/helpers/basic_auth/MSNT/smblib-util.c Wed Jun 26 13:11:17 2002 +++ squid-2.5.STABLE10/helpers/basic_auth/MSNT/smblib-util.c Fri Mar 25 19:50:50 2005 @@ -146,7 +146,7 @@ } /* Now plug in the bits we need */ - bzero(SMB_Hdr(pkt), SMB_negp_len); + memset(SMB_Hdr(pkt), 0, SMB_negp_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBnegprot; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid); @@ -255,7 +255,6 @@ Con_Handle->Encrypt_Key_Len = SVAL(SMB_Hdr(pkt), SMB_negrLM_ekl_offset); p = (SMB_Hdr(pkt) + SMB_negrLM_buf_offset); - fprintf(stderr, "%d", (int) (SMB_Hdr(pkt) + SMB_negrLM_buf_offset)); memcpy(Con_Handle->Encrypt_Key, p, 8); p = (SMB_Hdr(pkt) + SMB_negrLM_buf_offset + Con_Handle->Encrypt_Key_Len); @@ -397,7 +396,7 @@ /* Now plug in the values ... */ - bzero(SMB_Hdr(pkt), SMB_tcon_len); + memset(SMB_Hdr(pkt), 0, SMB_tcon_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBtcon; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid); diff -ruN squid-2.5.STABLE9/helpers/basic_auth/MSNT/smblib.c squid-2.5.STABLE10/helpers/basic_auth/MSNT/smblib.c --- squid-2.5.STABLE9/helpers/basic_auth/MSNT/smblib.c Wed Jun 26 13:11:17 2002 +++ squid-2.5.STABLE10/helpers/basic_auth/MSNT/smblib.c Wed Mar 9 07:28:32 2005 @@ -330,7 +330,7 @@ return (SMBlibE_BAD); /* Should handle the error */ } - bzero(SMB_Hdr(pkt), SMB_ssetpLM_len); + memset(SMB_Hdr(pkt), 0, SMB_ssetpLM_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBsesssetupX; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid); @@ -393,7 +393,7 @@ return (-1); /* Should handle the error */ } - bzero(SMB_Hdr(pkt), SMB_ssetpNTLM_len); + memset(SMB_Hdr(pkt), 0, SMB_ssetpNTLM_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBsesssetupX; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid); diff -ruN squid-2.5.STABLE9/helpers/basic_auth/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/Makefile.in Sat Jul 10 06:11:41 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/Makefile.in Fri Mar 18 17:55:41 2005 @@ -15,7 +15,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.7.2.12 2004/07/10 12:11:41 hno Exp $ +# $Id: Makefile.in,v 1.7.2.13 2005/03/19 00:55:41 hno Exp $ # SHELL = @SHELL@ @@ -85,6 +85,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/NCSA/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/NCSA/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/NCSA/Makefile.in Sat Jul 10 06:11:41 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/NCSA/Makefile.in Fri Mar 18 17:55:43 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.8.2.11 2004/07/10 12:11:41 hno Exp $ +# $Id: Makefile.in,v 1.8.2.12 2005/03/19 00:55:43 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/NCSA/ncsa_auth.c squid-2.5.STABLE10/helpers/basic_auth/NCSA/ncsa_auth.c --- squid-2.5.STABLE9/helpers/basic_auth/NCSA/ncsa_auth.c Sat Sep 25 14:53:17 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/NCSA/ncsa_auth.c Fri Apr 22 14:29:29 2005 @@ -138,9 +138,9 @@ rfc1738_unescape(passwd); u = hash_lookup(hash, user); if (u == NULL) { - printf("ERR\n"); + printf("ERR No such user\n"); } else if (strcmp(u->passwd, (char *) crypt(passwd, u->passwd))) { - printf("ERR\n"); + printf("ERR Wrong password\n"); } else { printf("OK\n"); } diff -ruN squid-2.5.STABLE9/helpers/basic_auth/PAM/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/PAM/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/PAM/Makefile.in Sat Jul 10 06:11:41 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/PAM/Makefile.in Fri Mar 18 17:55:43 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid PAM authentication helper # -# $Id: Makefile.in,v 1.7.2.13 2004/07/10 12:11:41 hno Exp $ +# $Id: Makefile.in,v 1.7.2.14 2005/03/19 00:55:43 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/SASL/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/SASL/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/SASL/Makefile.in Sat Jul 10 06:11:41 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/SASL/Makefile.in Fri Mar 18 17:55:44 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid SASL authentication helper # -# $Id: Makefile.in,v 1.1.2.17 2004/07/10 12:11:41 hno Exp $ +# $Id: Makefile.in,v 1.1.2.18 2005/03/19 00:55:44 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/SMB/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/SMB/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/SMB/Makefile.in Sat Jul 10 06:11:41 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/SMB/Makefile.in Fri Mar 18 17:55:45 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.7.2.13 2004/07/10 12:11:41 hno Exp $ +# $Id: Makefile.in,v 1.7.2.14 2005/03/19 00:55:45 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -93,6 +93,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/YP/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/YP/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/YP/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/YP/Makefile.in Fri Mar 18 17:55:46 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.9.2.12 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.9.2.13 2005/03/19 00:55:46 hno Exp $ # # @@ -87,6 +87,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/YP/yp_auth.c squid-2.5.STABLE10/helpers/basic_auth/YP/yp_auth.c --- squid-2.5.STABLE9/helpers/basic_auth/YP/yp_auth.c Sun Aug 11 19:13:47 2002 +++ squid-2.5.STABLE10/helpers/basic_auth/YP/yp_auth.c Sun Apr 24 10:28:16 2005 @@ -71,13 +71,13 @@ if (!nispasswd) { /* User does not exist */ - printf("ERR\n"); + printf("ERR No such user\n"); } else if (strcmp(nispasswd, (char *) crypt(passwd, nispasswd)) == 0) { /* All ok !, thanks... */ printf("OK\n"); } else { /* Password incorrect */ - printf("ERR\n"); + printf("ERR Wrong password\n"); } } exit(0); diff -ruN squid-2.5.STABLE9/helpers/basic_auth/getpwnam/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/getpwnam/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/getpwnam/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/getpwnam/Makefile.in Fri Mar 18 17:55:46 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.8.2.11 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.8.2.12 2005/03/19 00:55:46 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/getpwnam/getpwnam_auth.c squid-2.5.STABLE10/helpers/basic_auth/getpwnam/getpwnam_auth.c --- squid-2.5.STABLE9/helpers/basic_auth/getpwnam/getpwnam_auth.c Sun Aug 11 19:13:47 2002 +++ squid-2.5.STABLE10/helpers/basic_auth/getpwnam/getpwnam_auth.c Sun Apr 24 10:28:16 2005 @@ -70,10 +70,10 @@ rfc1738_unescape(passwd); pwd = getpwnam(user); if (pwd == NULL) { - printf(ERR); + printf("ERR No such user\n"); } else { if (strcmp(pwd->pw_passwd, (char *) crypt(passwd, pwd->pw_passwd))) { - printf(ERR); + printf("ERR Wrong password\n"); } else { printf(OK); } diff -ruN squid-2.5.STABLE9/helpers/basic_auth/multi-domain-NTLM/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/multi-domain-NTLM/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/multi-domain-NTLM/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/multi-domain-NTLM/Makefile.in Fri Mar 18 17:55:46 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.5.2.12 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.5.2.13 2005/03/19 00:55:46 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/winbind/Makefile.in squid-2.5.STABLE10/helpers/basic_auth/winbind/Makefile.in --- squid-2.5.STABLE9/helpers/basic_auth/winbind/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/basic_auth/winbind/Makefile.in Fri Mar 18 17:55:46 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.1.2.13 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.1.2.14 2005/03/19 00:55:46 hno Exp $ # SHELL = @SHELL@ @@ -86,6 +86,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/basic_auth/winbind/wbntlm.h squid-2.5.STABLE10/helpers/basic_auth/winbind/wbntlm.h --- squid-2.5.STABLE9/helpers/basic_auth/winbind/wbntlm.h Sun Feb 20 12:07:44 2005 +++ squid-2.5.STABLE10/helpers/basic_auth/winbind/wbntlm.h Wed Mar 9 07:30:37 2005 @@ -48,7 +48,7 @@ #endif #ifdef __GNUC__ /* this is really a gcc-ism */ -#define warn(X...) fprintf(stderr,"%s[%d](%s:%d): ", myname, mypid, \ +#define warn(X...) fprintf(stderr,"%s[%ld](%s:%d): ", myname, (long)mypid, \ ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\ __LINE__);\ fprintf(stderr,X) diff -ruN squid-2.5.STABLE9/helpers/digest_auth/Makefile.in squid-2.5.STABLE10/helpers/digest_auth/Makefile.in --- squid-2.5.STABLE9/helpers/digest_auth/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/digest_auth/Makefile.in Fri Mar 18 17:55:47 2005 @@ -15,7 +15,7 @@ # Makefile for digest auth helpers in the Squid Object Cache server # -# $Id: Makefile.in,v 1.6.2.10 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.6.2.11 2005/03/19 00:55:47 hno Exp $ # SHELL = @SHELL@ @@ -85,6 +85,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/digest_auth/password/Makefile.in squid-2.5.STABLE10/helpers/digest_auth/password/Makefile.in --- squid-2.5.STABLE9/helpers/digest_auth/password/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/digest_auth/password/Makefile.in Fri Mar 18 17:55:48 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.8.2.10 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.8.2.11 2005/03/19 00:55:48 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/digest_auth/password/digest_pw_auth.c squid-2.5.STABLE10/helpers/digest_auth/password/digest_pw_auth.c --- squid-2.5.STABLE9/helpers/digest_auth/password/digest_pw_auth.c Wed Oct 16 22:55:48 2002 +++ squid-2.5.STABLE10/helpers/digest_auth/password/digest_pw_auth.c Fri Apr 22 14:29:29 2005 @@ -149,7 +149,7 @@ } u = hash_lookup(hash, user); if (u == NULL) { - printf("ERR\n"); + printf("ERR No such user\n"); } else { DigestCalcHA1("md5", user, realm, u->passwd, NULL, NULL, HA1, HHA1); printf("%s\n", HHA1); diff -ruN squid-2.5.STABLE9/helpers/external_acl/Makefile.in squid-2.5.STABLE10/helpers/external_acl/Makefile.in --- squid-2.5.STABLE9/helpers/external_acl/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/external_acl/Makefile.in Fri Mar 18 17:55:48 2005 @@ -15,7 +15,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.2.2.7 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.2.2.8 2005/03/19 00:55:48 hno Exp $ # SHELL = @SHELL@ @@ -85,6 +85,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/external_acl/ip_user/Makefile.in squid-2.5.STABLE10/helpers/external_acl/ip_user/Makefile.in --- squid-2.5.STABLE9/helpers/external_acl/ip_user/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/external_acl/ip_user/Makefile.in Fri Mar 18 17:55:49 2005 @@ -16,7 +16,7 @@ # # Makefile for the ip_user external_acl helper by Rodrigo Campos # -# $Id: Makefile.in,v 1.1.2.8 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.1.2.9 2005/03/19 00:55:49 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/external_acl/ldap_group/ChangeLog squid-2.5.STABLE10/helpers/external_acl/ldap_group/ChangeLog --- squid-2.5.STABLE9/helpers/external_acl/ldap_group/ChangeLog Sun Nov 7 08:25:18 2004 +++ squid-2.5.STABLE10/helpers/external_acl/ldap_group/ChangeLog Tue Mar 22 15:45:27 2005 @@ -1,3 +1,22 @@ +Version 2.17-2.5 + +2005-03-19 Henrik Nordstrom + + Bug #1258: LDAP helpers fails to compile with SUN LDAP SDK + +2005-02-05 Henrik Nordstrom + + Define LDAP_NO_ATTRS if not defined in LDAP API headers + +2005-02-04 Henrik Nordstrom + + Fix LDAP helpers to send a proper NO_ATTR search when looking + for the user DN + +2005-01-30 Oliver Hookins + + LDAP helper documentation updates + Version 2.16-2.5 2004-10-21 Henrik Nordstrom diff -ruN squid-2.5.STABLE9/helpers/external_acl/ldap_group/Makefile.am squid-2.5.STABLE10/helpers/external_acl/ldap_group/Makefile.am --- squid-2.5.STABLE9/helpers/external_acl/ldap_group/Makefile.am Wed Dec 11 17:23:30 2002 +++ squid-2.5.STABLE10/helpers/external_acl/ldap_group/Makefile.am Fri Mar 18 17:54:10 2005 @@ -1,7 +1,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.am,v 1.1.2.3 2002/12/12 00:23:30 hno Exp $ +# $Id: Makefile.am,v 1.1.2.4 2005/03/19 00:54:10 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -11,4 +11,4 @@ EXTRA_DIST = squid_ldap_group.8 squid_ldap_group_SOURCES = squid_ldap_group.c -LDADD = -lldap -llber $(XTRA_LIBS) +LDADD = -lldap $(LIB_LBER) $(XTRA_LIBS) diff -ruN squid-2.5.STABLE9/helpers/external_acl/ldap_group/Makefile.in squid-2.5.STABLE10/helpers/external_acl/ldap_group/Makefile.in --- squid-2.5.STABLE9/helpers/external_acl/ldap_group/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/external_acl/ldap_group/Makefile.in Fri Mar 18 17:55:49 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.in,v 1.1.2.10 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.1.2.11 2005/03/19 00:55:49 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ @@ -127,7 +128,7 @@ EXTRA_DIST = squid_ldap_group.8 squid_ldap_group_SOURCES = squid_ldap_group.c -LDADD = -lldap -llber $(XTRA_LIBS) +LDADD = -lldap $(LIB_LBER) $(XTRA_LIBS) subdir = helpers/external_acl/ldap_group mkinstalldirs = $(SHELL) $(top_srcdir)/cfgaux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/autoconf.h diff -ruN squid-2.5.STABLE9/helpers/external_acl/ldap_group/squid_ldap_group.8 squid-2.5.STABLE10/helpers/external_acl/ldap_group/squid_ldap_group.8 --- squid-2.5.STABLE9/helpers/external_acl/ldap_group/squid_ldap_group.8 Sun Jan 30 12:28:56 2005 +++ squid-2.5.STABLE10/helpers/external_acl/ldap_group/squid_ldap_group.8 Tue Mar 22 15:54:27 2005 @@ -1,4 +1,4 @@ -.TH squid_ldap_group 8 "14 January 2005" "Squid LDAP Group" +.TH squid_ldap_group 8 "30 January 2005" "Version 2.17-2.5" . .SH NAME squid_ldap_group - Squid LDAP external acl group helper diff -ruN squid-2.5.STABLE9/helpers/external_acl/ldap_group/squid_ldap_group.c squid-2.5.STABLE10/helpers/external_acl/ldap_group/squid_ldap_group.c --- squid-2.5.STABLE9/helpers/external_acl/ldap_group/squid_ldap_group.c Sat Feb 5 03:53:07 2005 +++ squid-2.5.STABLE10/helpers/external_acl/ldap_group/squid_ldap_group.c Tue Mar 22 15:54:27 2005 @@ -44,6 +44,7 @@ #endif #define PROGRAM_NAME "squid_ldap_group" +#define VERSION "2.17-2.5" /* Globals */ @@ -401,6 +402,7 @@ ldapServer = "localhost"; if (!basedn || !searchfilter) { + fprintf(stderr, "\n" PROGRAM_NAME " version " VERSION "\n\n"); fprintf(stderr, "Usage: " PROGRAM_NAME " -b basedn -f filter [options] ldap_server_name\n\n"); fprintf(stderr, "\t-b basedn (REQUIRED)\tbase dn under where to search for groups\n"); fprintf(stderr, "\t-f filter (REQUIRED)\tgroup search filter pattern. %%v = user,\n\t\t\t\t%%a = group\n"); @@ -488,19 +490,28 @@ if (version == -1) { version = LDAP_VERSION2; } - if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version) - != LDAP_OPT_SUCCESS) { + if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version) != LDAP_SUCCESS) { fprintf(stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version); ldap_unbind(ld); ld = NULL; break; } - if (use_tls && (version == LDAP_VERSION3) && (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS)) { - fprintf(stderr, "Could not Activate TLS connection\n"); - ldap_unbind(ld); - ld = NULL; - break; + if (use_tls) { +#ifdef LDAP_OPT_X_TLS + if (version == LDAP_VERSION3 && ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) { + fprintf(stderr, "Could not Activate TLS connection\n"); + ldap_unbind(ld); + ld = NULL; + break; + } else { + fprintf(stderr, "TLS requires LDAP version 3\n"); + exit(1); + } +#else + fprintf(stderr, "TLS not supported with your LDAP library\n"); + exit(1); +#endif } #endif squid_ldap_set_timelimit(ld, timelimit); diff -ruN squid-2.5.STABLE9/helpers/external_acl/unix_group/Makefile.in squid-2.5.STABLE10/helpers/external_acl/unix_group/Makefile.in --- squid-2.5.STABLE9/helpers/external_acl/unix_group/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/external_acl/unix_group/Makefile.in Fri Mar 18 17:55:49 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.in,v 1.1.2.8 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.1.2.9 2005/03/19 00:55:49 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/external_acl/wbinfo_group/Makefile.in squid-2.5.STABLE10/helpers/external_acl/wbinfo_group/Makefile.in --- squid-2.5.STABLE9/helpers/external_acl/wbinfo_group/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/external_acl/wbinfo_group/Makefile.in Fri Mar 18 17:55:49 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.in,v 1.1.2.7 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.1.2.8 2005/03/19 00:55:49 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/external_acl/winbind_group/Makefile.in squid-2.5.STABLE10/helpers/external_acl/winbind_group/Makefile.in --- squid-2.5.STABLE9/helpers/external_acl/winbind_group/Makefile.in Sat Jul 10 06:11:42 2004 +++ squid-2.5.STABLE10/helpers/external_acl/winbind_group/Makefile.in Fri Mar 18 17:55:49 2005 @@ -16,7 +16,7 @@ # # Makefile for the wb_group external_acl helper # -# $Id: Makefile.in,v 1.1.2.9 2004/07/10 12:11:42 hno Exp $ +# $Id: Makefile.in,v 1.1.2.10 2005/03/19 00:55:49 hno Exp $ # SHELL = @SHELL@ @@ -86,6 +86,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/external_acl/winbind_group/wb_check_group.c squid-2.5.STABLE10/helpers/external_acl/winbind_group/wb_check_group.c --- squid-2.5.STABLE9/helpers/external_acl/winbind_group/wb_check_group.c Fri Sep 12 04:11:22 2003 +++ squid-2.5.STABLE10/helpers/external_acl/winbind_group/wb_check_group.c Fri Mar 25 19:50:50 2005 @@ -364,7 +364,7 @@ if ((p = strchr(buf, '\r')) != NULL) *p = '\0'; /* strip \r */ - debug("Got '%s' from Squid (length: %d).\n",buf,strlen(buf)); + debug("Got '%s' from Squid (length: %d).\n",buf,(int)strlen(buf)); if (buf[0] == '\0') { warn("Invalid Request\n"); diff -ruN squid-2.5.STABLE9/helpers/external_acl/winbind_group/wbntlm.h squid-2.5.STABLE10/helpers/external_acl/winbind_group/wbntlm.h --- squid-2.5.STABLE9/helpers/external_acl/winbind_group/wbntlm.h Sun May 11 06:51:49 2003 +++ squid-2.5.STABLE10/helpers/external_acl/winbind_group/wbntlm.h Wed Mar 9 07:30:37 2005 @@ -50,7 +50,7 @@ #endif #ifdef __GNUC__ /* this is really a gcc-ism */ -#define warn(X...) fprintf(stderr,"%s[%d](%s:%d): ", myname, mypid, \ +#define warn(X...) fprintf(stderr,"%s[%ld](%s:%d): ", myname, (long)mypid, \ ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\ __LINE__);\ fprintf(stderr,X) diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/Makefile.in squid-2.5.STABLE10/helpers/ntlm_auth/Makefile.in --- squid-2.5.STABLE9/helpers/ntlm_auth/Makefile.in Sat Jul 10 06:11:44 2004 +++ squid-2.5.STABLE10/helpers/ntlm_auth/Makefile.in Fri Mar 18 17:55:49 2005 @@ -15,7 +15,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.7.2.12 2004/07/10 12:11:44 hno Exp $ +# $Id: Makefile.in,v 1.7.2.13 2005/03/19 00:55:49 hno Exp $ # SHELL = @SHELL@ @@ -85,6 +85,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/SMB/Makefile.in squid-2.5.STABLE10/helpers/ntlm_auth/SMB/Makefile.in --- squid-2.5.STABLE9/helpers/ntlm_auth/SMB/Makefile.in Sat Jul 10 06:11:45 2004 +++ squid-2.5.STABLE10/helpers/ntlm_auth/SMB/Makefile.in Fri Mar 18 17:55:49 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.8.2.11 2004/07/10 12:11:45 hno Exp $ +# $Id: Makefile.in,v 1.8.2.12 2005/03/19 00:55:49 hno Exp $ # SHELL = @SHELL@ @@ -86,6 +86,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/SMB/ntlm.h squid-2.5.STABLE10/helpers/ntlm_auth/SMB/ntlm.h --- squid-2.5.STABLE9/helpers/ntlm_auth/SMB/ntlm.h Sun Feb 20 12:07:44 2005 +++ squid-2.5.STABLE10/helpers/ntlm_auth/SMB/ntlm.h Wed Mar 9 07:30:37 2005 @@ -53,7 +53,7 @@ static const char *__foo; extern char debug_enabled; #define debug(X...) if (debug_enabled) { \ - fprintf(stderr,"ntlm-auth[%d](%s:%d): ", getpid(), \ + fprintf(stderr,"ntlm-auth[%ld](%s:%d): ", (long)getpid(), \ ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\ __LINE__);\ fprintf(stderr,X); } diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/SMB/ntlm_auth.c squid-2.5.STABLE10/helpers/ntlm_auth/SMB/ntlm_auth.c --- squid-2.5.STABLE9/helpers/ntlm_auth/SMB/ntlm_auth.c Mon Jul 22 05:20:44 2002 +++ squid-2.5.STABLE10/helpers/ntlm_auth/SMB/ntlm_auth.c Wed Mar 9 07:30:37 2005 @@ -327,7 +327,7 @@ alarm(0); signal(SIGALRM, SIG_DFL); if (got_timeout != 0) { - fprintf(stderr, "ntlm-auth[%d]: Timeout during authentication.\n", getpid()); + fprintf(stderr, "ntlm-auth[%ld]: Timeout during authentication.\n", (long)getpid()); SEND("BH Timeout during authentication"); got_timeout = 0; return; diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/Makefile.in squid-2.5.STABLE10/helpers/ntlm_auth/SMB/smbval/Makefile.in --- squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/Makefile.in Sun Feb 20 18:35:48 2005 +++ squid-2.5.STABLE10/helpers/ntlm_auth/SMB/smbval/Makefile.in Fri Mar 18 17:55:50 2005 @@ -82,6 +82,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c squid-2.5.STABLE10/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c --- squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c Tue Feb 17 16:09:56 2004 +++ squid-2.5.STABLE10/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c Wed Mar 9 07:28:32 2005 @@ -384,7 +384,7 @@ RFCNB_saved_errno = errno; return (RFCNBE_Bad); } - bzero((char *) &Socket, sizeof(Socket)); + memset((char *) &Socket, 0, sizeof(Socket)); memcpy((char *) &Socket.sin_addr, (char *) &Dest_IP, sizeof(Dest_IP)); Socket.sin_port = htons(port); diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/smbencrypt.c squid-2.5.STABLE10/helpers/ntlm_auth/SMB/smbval/smbencrypt.c --- squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/smbencrypt.c Wed Aug 29 08:57:37 2001 +++ squid-2.5.STABLE10/helpers/ntlm_auth/SMB/smbval/smbencrypt.c Wed Mar 9 07:33:01 2005 @@ -149,7 +149,7 @@ E_P16((uchar *) passwd, (uchar *) p16); /* clear out local copy of user's password (just being paranoid). */ - bzero(passwd, sizeof(passwd)); + memset(passwd, 0, sizeof(passwd)); } /**************************************************************************** @@ -199,7 +199,7 @@ * else * #endif *//* KANJI_WIN95_COMPATIBILITY */ { - if (islower(*s)) + if (islower((int)(unsigned char)*s)) *s = toupper(*s); s++; } diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/smblib-util.c squid-2.5.STABLE10/helpers/ntlm_auth/SMB/smbval/smblib-util.c --- squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/smblib-util.c Tue Feb 17 16:09:56 2004 +++ squid-2.5.STABLE10/helpers/ntlm_auth/SMB/smbval/smblib-util.c Wed Mar 9 07:28:32 2005 @@ -269,7 +269,7 @@ } /* Now plug in the bits we need */ - bzero(SMB_Hdr(pkt), SMB_negp_len); + memset(SMB_Hdr(pkt), 0, SMB_negp_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBnegprot; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid); @@ -520,7 +520,7 @@ /* Now plug in the values ... */ - bzero(SMB_Hdr(pkt), SMB_tcon_len); + memset(SMB_Hdr(pkt), 0, SMB_tcon_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBtcon; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid); @@ -637,7 +637,7 @@ } /* Now plug in the values ... */ - bzero(SMB_Hdr(pkt), SMB_tdis_len); + memset(SMB_Hdr(pkt), 0, SMB_tdis_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBtdis; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Tree_Handle->con->pid); diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/smblib.c squid-2.5.STABLE10/helpers/ntlm_auth/SMB/smbval/smblib.c --- squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/smblib.c Tue Feb 17 16:09:56 2004 +++ squid-2.5.STABLE10/helpers/ntlm_auth/SMB/smbval/smblib.c Wed Mar 9 07:28:32 2005 @@ -374,7 +374,7 @@ fprintf(stderr, "SMB_Logon_server: Couldn't allocate packet\n"); return (SMBlibE_BAD); /* Should handle the error */ } - bzero(SMB_Hdr(pkt), SMB_ssetpLM_len); + memset(SMB_Hdr(pkt), 0, SMB_ssetpLM_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBsesssetupX; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid); @@ -437,7 +437,7 @@ fprintf(stderr, "SMB_Logon_server: Couldn't allocate packet\n"); return (-1); /* Should handle the error */ } - bzero(SMB_Hdr(pkt), SMB_ssetpNTLM_len); + memset(SMB_Hdr(pkt), 0, SMB_ssetpNTLM_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBsesssetupX; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid); diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/fakeauth/Makefile.in squid-2.5.STABLE10/helpers/ntlm_auth/fakeauth/Makefile.in --- squid-2.5.STABLE9/helpers/ntlm_auth/fakeauth/Makefile.in Sat Jul 10 06:11:47 2004 +++ squid-2.5.STABLE10/helpers/ntlm_auth/fakeauth/Makefile.in Fri Mar 18 17:55:50 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.8.2.10 2004/07/10 12:11:47 hno Exp $ +# $Id: Makefile.in,v 1.8.2.11 2005/03/19 00:55:50 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/fakeauth/fakeauth_auth.c squid-2.5.STABLE10/helpers/ntlm_auth/fakeauth/fakeauth_auth.c --- squid-2.5.STABLE9/helpers/ntlm_auth/fakeauth/fakeauth_auth.c Fri Jan 7 14:12:27 2005 +++ squid-2.5.STABLE10/helpers/ntlm_auth/fakeauth/fakeauth_auth.c Wed Mar 9 07:33:01 2005 @@ -177,7 +177,7 @@ d = buf; for (; l; l--) { - if (*sc == '\0' || !isprint(*sc)) { + if (*sc == '\0' || !isprint((int)(unsigned char)*sc)) { fprintf(stderr, "ntlmGetString: bad ascii: %04x\n", *sc); return (NULL); } diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/no_check/Makefile.in squid-2.5.STABLE10/helpers/ntlm_auth/no_check/Makefile.in --- squid-2.5.STABLE9/helpers/ntlm_auth/no_check/Makefile.in Sat Jul 10 06:11:47 2004 +++ squid-2.5.STABLE10/helpers/ntlm_auth/no_check/Makefile.in Fri Mar 18 17:55:50 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.8.2.12 2004/07/10 12:11:47 hno Exp $ +# $Id: Makefile.in,v 1.8.2.13 2005/03/19 00:55:50 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/winbind/Makefile.in squid-2.5.STABLE10/helpers/ntlm_auth/winbind/Makefile.in --- squid-2.5.STABLE9/helpers/ntlm_auth/winbind/Makefile.in Sat Jul 10 06:11:47 2004 +++ squid-2.5.STABLE10/helpers/ntlm_auth/winbind/Makefile.in Fri Mar 18 17:55:50 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.1.2.13 2004/07/10 12:11:47 hno Exp $ +# $Id: Makefile.in,v 1.1.2.14 2005/03/19 00:55:50 hno Exp $ # SHELL = @SHELL@ @@ -86,6 +86,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/helpers/ntlm_auth/winbind/wbntlm.h squid-2.5.STABLE10/helpers/ntlm_auth/winbind/wbntlm.h --- squid-2.5.STABLE9/helpers/ntlm_auth/winbind/wbntlm.h Sun Feb 20 12:07:45 2005 +++ squid-2.5.STABLE10/helpers/ntlm_auth/winbind/wbntlm.h Wed Mar 9 07:30:38 2005 @@ -48,7 +48,7 @@ #endif #if defined(__GNUC__) || defined(__ICC) /* this is really a gcc-ism */ -#define warn(X...) fprintf(stderr,"%s[%d](%s:%d): ", myname, mypid, \ +#define warn(X...) fprintf(stderr,"%s[%ld](%s:%d): ", myname, (long)mypid, \ ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\ __LINE__);\ fprintf(stderr,X) diff -ruN squid-2.5.STABLE9/icons/Makefile.in squid-2.5.STABLE10/icons/Makefile.in --- squid-2.5.STABLE9/icons/Makefile.in Sat Jul 10 06:11:47 2004 +++ squid-2.5.STABLE10/icons/Makefile.in Fri Mar 18 17:55:51 2005 @@ -13,7 +13,7 @@ @SET_MAKE@ -# $Id: Makefile.in,v 1.21.2.12 2004/07/10 12:11:47 hno Exp $ +# $Id: Makefile.in,v 1.21.2.13 2005/03/19 00:55:51 hno Exp $ # SHELL = @SHELL@ @@ -83,6 +83,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/include/autoconf.h.in squid-2.5.STABLE10/include/autoconf.h.in --- squid-2.5.STABLE9/include/autoconf.h.in Mon Aug 9 07:55:49 2004 +++ squid-2.5.STABLE10/include/autoconf.h.in Fri Apr 22 19:32:27 2005 @@ -575,6 +575,9 @@ /* Define if you have the strerror function. */ #undef HAVE_STRERROR +/* Define if you have the strtoll function. */ +#undef HAVE_STRTOLL + /* Define if you have the sysconf function. */ #undef HAVE_SYSCONF @@ -623,6 +626,9 @@ /* Define if you have the header file. */ #undef HAVE_FCNTL_H +/* Define if you have the header file. */ +#undef HAVE_FNMATCH_H + /* Define if you have the header file. */ #undef HAVE_GETOPT_H @@ -883,6 +889,9 @@ /* Version number of package */ #undef VERSION + +/* Support large cache files > 2GB */ +#undef LARGE_CACHE_FILES /* Enable hostname sanity checks */ #undef CHECK_HOSTNAMES diff -ruN squid-2.5.STABLE9/include/config.h squid-2.5.STABLE10/include/config.h --- squid-2.5.STABLE9/include/config.h Sun Feb 20 04:02:56 2005 +++ squid-2.5.STABLE10/include/config.h Fri Apr 22 19:32:27 2005 @@ -1,5 +1,5 @@ /* - * $Id: config.h,v 1.4.2.2 2005/02/20 11:02:56 hno Exp $ + * $Id: config.h,v 1.4.2.5 2005/04/23 01:32:27 hno Exp $ * * AUTHOR: Duane Wessels * @@ -130,6 +130,8 @@ #if !defined(CACHEMGR_HOSTNAME) #define CACHEMGR_HOSTNAME "" +#else +#define CACHEMGR_HOSTNAME_DEFINED 1 #endif #if SQUID_UDP_SO_SNDBUF > 16384 @@ -162,6 +164,7 @@ #define xisdigit(x) isdigit((unsigned char)x) #define xisascii(x) isascii((unsigned char)x) #define xislower(x) islower((unsigned char)x) +#define xisupper(x) isupper((unsigned char)x) #define xisalpha(x) isalpha((unsigned char)x) #define xisalnum(x) isalnum((unsigned char)x) #define xisgraph(x) isgraph((unsigned char)x) diff -ruN squid-2.5.STABLE9/include/rfc1035.h squid-2.5.STABLE10/include/rfc1035.h --- squid-2.5.STABLE9/include/rfc1035.h Wed Dec 17 18:04:22 2003 +++ squid-2.5.STABLE10/include/rfc1035.h Tue May 10 05:48:20 2005 @@ -1,5 +1,5 @@ /* - * $Id: rfc1035.h,v 1.6.2.1 2003/12/18 01:04:22 robertc Exp $ + * $Id: rfc1035.h,v 1.6.2.2 2005/05/10 11:48:20 hno Exp $ * * AUTHOR: Duane Wessels * @@ -56,18 +56,46 @@ unsigned short rdlength; char *rdata; }; -extern unsigned short rfc1035BuildAQuery(const char *hostname, +typedef struct _rfc1035_query rfc1035_query; +struct _rfc1035_query { + char name[RFC1035_MAXHOSTNAMESZ]; + unsigned short qtype; + unsigned short qclass; +}; +typedef struct _rfc1035_message rfc1035_message; +struct _rfc1035_message { + unsigned short id; + unsigned int qr:1; + unsigned int opcode:4; + unsigned int aa:1; + unsigned int tc:1; + unsigned int rd:1; + unsigned int ra:1; + unsigned int rcode:4; + unsigned short qdcount; + unsigned short ancount; + unsigned short nscount; + unsigned short arcount; + rfc1035_query *query; + rfc1035_rr *answer; +}; + +extern ssize_t rfc1035BuildAQuery(const char *hostname, char *buf, - size_t * szp); -extern unsigned short rfc1035BuildPTRQuery(const struct in_addr, + size_t sz, + unsigned short qid, + rfc1035_query * query); +extern ssize_t rfc1035BuildPTRQuery(const struct in_addr, char *buf, - size_t * szp); -extern unsigned short rfc1035RetryQuery(char *); -extern int rfc1035AnswersUnpack(const char *buf, size_t sz, - rfc1035_rr ** records, - unsigned short *id); -extern void rfc1035RRDestroy(rfc1035_rr * rr, int n); + unsigned short qid, + rfc1035_query * query); +extern void rfc1035SetQueryID(char *, unsigned short qid); +extern int rfc1035MessageUnpack(const char *buf, + size_t sz, + rfc1035_message ** answer); +extern int rfc1035QueryCompare(const rfc1035_query *, const rfc1035_query *); +extern void rfc1035MessageDestroy(rfc1035_message * message); extern int rfc1035_errno; extern const char *rfc1035_error_message; diff -ruN squid-2.5.STABLE9/include/version.h squid-2.5.STABLE10/include/version.h --- squid-2.5.STABLE9/include/version.h Wed Feb 23 16:54:54 2005 +++ squid-2.5.STABLE10/include/version.h Mon May 16 16:41:14 2005 @@ -9,5 +9,5 @@ */ #ifndef SQUID_RELEASE_TIME -#define SQUID_RELEASE_TIME 1109202891 +#define SQUID_RELEASE_TIME 1116283270 #endif diff -ruN squid-2.5.STABLE9/lib/GNUregex.c squid-2.5.STABLE10/lib/GNUregex.c --- squid-2.5.STABLE9/lib/GNUregex.c Sun Feb 20 12:07:45 2005 +++ squid-2.5.STABLE10/lib/GNUregex.c Sat Mar 5 14:00:40 2005 @@ -1,5 +1,5 @@ /* - * $Id: GNUregex.c,v 1.12.2.2 2005/02/20 19:07:45 hno Exp $ + * $Id: GNUregex.c,v 1.12.2.3 2005/03/05 21:00:40 hno Exp $ */ /* Extended regular expression matching and search library, @@ -4440,18 +4440,18 @@ if (!s) { if (!re_comp_buf.buffer) - return "No previous regular expression"; + return (char *)"No previous regular expression"; return 0; } if (!re_comp_buf.buffer) { re_comp_buf.buffer = (unsigned char *) malloc(200); if (re_comp_buf.buffer == NULL) - return "Memory exhausted"; + return (char *)"Memory exhausted"; re_comp_buf.allocated = 200; re_comp_buf.fastmap = (char *) malloc(1 << BYTEWIDTH); if (re_comp_buf.fastmap == NULL) - return "Memory exhausted"; + return (char *)"Memory exhausted"; } /* Since `re_exec' always passes NULL for the `regs' argument, we * don't need to initialize the pattern buffer fields which affect it. */ diff -ruN squid-2.5.STABLE9/lib/Makefile.in squid-2.5.STABLE10/lib/Makefile.in --- squid-2.5.STABLE9/lib/Makefile.in Sun Feb 20 18:35:48 2005 +++ squid-2.5.STABLE10/lib/Makefile.in Mon Apr 18 18:12:13 2005 @@ -14,7 +14,7 @@ @SET_MAKE@ # -# $Id: Makefile.in,v 1.57.2.15 2005/02/21 01:35:48 hno Exp $ +# $Id: Makefile.in,v 1.57.2.17 2005/04/19 00:12:13 hno Exp $ # SHELL = @SHELL@ @@ -84,6 +84,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ @@ -191,8 +192,8 @@ libmiscutil_a_DEPENDENCIES = @LIBOBJS@ @NEED_OWN_MD5_TRUE@am__objects_1 = md5.$(OBJEXT) @NEED_OWN_MD5_FALSE@am__objects_1 = -@NEED_OWN_SNPRINTF_TRUE@am__objects_2 = snprintf.$(OBJEXT) @NEED_OWN_SNPRINTF_FALSE@am__objects_2 = +@NEED_OWN_SNPRINTF_TRUE@am__objects_2 = snprintf.$(OBJEXT) am_libmiscutil_a_OBJECTS = Array.$(OBJEXT) base64.$(OBJEXT) \ getfullhostname.$(OBJEXT) hash.$(OBJEXT) heap.$(OBJEXT) \ html_quote.$(OBJEXT) iso3307.$(OBJEXT) $(am__objects_1) \ diff -ruN squid-2.5.STABLE9/lib/rfc1035.c squid-2.5.STABLE10/lib/rfc1035.c --- squid-2.5.STABLE9/lib/rfc1035.c Sun Jan 16 19:46:29 2005 +++ squid-2.5.STABLE10/lib/rfc1035.c Wed May 11 08:24:28 2005 @@ -1,6 +1,6 @@ /* - * $Id: rfc1035.c,v 1.22.2.7 2005/01/17 02:46:29 hno Exp $ + * $Id: rfc1035.c,v 1.22.2.11 2005/05/11 14:24:28 hno Exp $ * * Low level DNS protocol routines * AUTHOR: Duane Wessels @@ -40,6 +40,7 @@ */ #include "config.h" +#include "util.h" #if HAVE_STDIO_H #include @@ -82,30 +83,9 @@ #endif -typedef struct _rfc1035_header rfc1035_header; int rfc1035_errno; const char *rfc1035_error_message; -struct _rfc1035_header { - unsigned short id; - unsigned int qr:1; - unsigned int opcode:4; - unsigned int aa:1; - unsigned int tc:1; - unsigned int rd:1; - unsigned int ra:1; - unsigned int rcode:4; - unsigned short qdcount; - unsigned short ancount; - unsigned short nscount; - unsigned short arcount; -}; - -static const char *Alphanum = -"abcdefghijklmnopqrstuvwxyz" -"ABCDEFGHIJKLMNOPQRSTUVWXYZ" -"0123456789"; - /* * rfc1035HeaderPack() @@ -113,10 +93,10 @@ * Packs a rfc1035_header structure into a buffer. * Returns number of octets packed (should always be 12) */ -static off_t -rfc1035HeaderPack(char *buf, size_t sz, rfc1035_header * hdr) +static int +rfc1035HeaderPack(char *buf, size_t sz, rfc1035_message * hdr) { - off_t off = 0; + int off = 0; unsigned short s; unsigned short t; assert(sz >= 12); @@ -158,10 +138,10 @@ * bytes to follow. Labels must be smaller than 64 octets. * Returns number of octets packed. */ -static off_t +static int rfc1035LabelPack(char *buf, size_t sz, const char *label) { - off_t off = 0; + int off = 0; size_t len = label ? strlen(label) : 0; if (label) assert(!strchr(label, '.')); @@ -183,18 +163,18 @@ * Note message compression is not supported here. * Returns number of octets packed. */ -static off_t +static int rfc1035NamePack(char *buf, size_t sz, const char *name) { - off_t off = 0; - char *copy = strdup(name); + int off = 0; + char *copy = xstrdup(name); char *t; /* * NOTE: use of strtok here makes names like foo....com valid. */ for (t = strtok(copy, "."); t; t = strtok(NULL, ".")) off += rfc1035LabelPack(buf + off, sz - off, t); - free(copy); + xfree(copy); off += rfc1035LabelPack(buf + off, sz - off, NULL); assert(off <= sz); return off; @@ -206,14 +186,14 @@ * Packs a QUESTION section of a message. * Returns number of octets packed. */ -static off_t +static int rfc1035QuestionPack(char *buf, size_t sz, const char *name, unsigned short type, unsigned short class) { - off_t off = 0; + int off = 0; unsigned short s; off += rfc1035NamePack(buf + off, sz - off, name); s = htons(type); @@ -229,8 +209,8 @@ /* * rfc1035HeaderUnpack() * - * Unpacks a RFC1035 message header buffer into a rfc1035_header - * structure. + * Unpacks a RFC1035 message header buffer into the header fields + * of the rfc1035_message structure. * * Updates the buffer offset, which is the same as number of * octects unpacked since the header starts at offset 0. @@ -238,7 +218,7 @@ * Returns 0 (success) or 1 (error) */ static int -rfc1035HeaderUnpack(const char *buf, size_t sz, off_t * off, rfc1035_header * h) +rfc1035HeaderUnpack(const char *buf, size_t sz, int *off, rfc1035_message * h) { unsigned short s; unsigned short t; @@ -299,9 +279,9 @@ * Returns 0 (success) or 1 (error) */ static int -rfc1035NameUnpack(const char *buf, size_t sz, off_t * off, unsigned short *rdlength, char *name, size_t ns, int rdepth) +rfc1035NameUnpack(const char *buf, size_t sz, int *off, unsigned short *rdlength, char *name, size_t ns, int rdepth) { - off_t no = 0; + int no = 0; unsigned char c; size_t len; assert(ns > 0); @@ -311,8 +291,8 @@ if (c > 191) { /* blasted compression */ unsigned short s; - off_t ptr; - if (rdepth > 64) /* infinite pointer loop */ + int ptr; + if (rdepth > 64) /* infinite pointer loop */ return 1; memcpy(&s, buf + (*off), sizeof(s)); s = ntohs(s); @@ -367,12 +347,12 @@ * Returns 0 (success) or 1 (error) */ static int -rfc1035RRUnpack(const char *buf, size_t sz, off_t * off, rfc1035_rr * RR) +rfc1035RRUnpack(const char *buf, size_t sz, int *off, rfc1035_rr * RR) { unsigned short s; unsigned int i; unsigned short rdlength; - off_t rdata_off; + int rdata_off; if (rfc1035NameUnpack(buf, sz, off, NULL, RR->name, RFC1035_MAXHOSTNAMESZ, 0)) { RFC1035_UNPACK_DEBUG; memset(RR, '\0', sizeof(*RR)); @@ -411,26 +391,26 @@ RR->rdlength = rdlength; switch (RR->type) { case RFC1035_TYPE_PTR: - RR->rdata = malloc(RFC1035_MAXHOSTNAMESZ); + RR->rdata = xmalloc(RFC1035_MAXHOSTNAMESZ); rdata_off = *off; - RR->rdlength = 0; /* Filled in by rfc1035NameUnpack */ + RR->rdlength = 0; /* Filled in by rfc1035NameUnpack */ if (rfc1035NameUnpack(buf, sz, &rdata_off, &RR->rdlength, RR->rdata, RFC1035_MAXHOSTNAMESZ, 0)) return 1; - if (rdata_off != ((*off) + rdlength)) { + if (rdata_off > ((*off) + rdlength)) { /* * This probably doesn't happen for valid packets, but * I want to make sure that NameUnpack doesn't go beyond * the RDATA area. */ RFC1035_UNPACK_DEBUG; - free(RR->rdata); + xfree(RR->rdata); memset(RR, '\0', sizeof(*RR)); return 1; } break; case RFC1035_TYPE_A: default: - RR->rdata = malloc(rdlength); + RR->rdata = xmalloc(rdlength); memcpy(RR->rdata, buf + (*off), rdlength); break; } @@ -439,15 +419,6 @@ return 0; } -static unsigned short -rfc1035Qid(void) -{ - static unsigned short qid = 0x0001; - if (++qid == 0xFFFF) - qid = 0x0001; - return qid; -} - static void rfc1035SetErrno(int n) { @@ -485,7 +456,7 @@ } } -void +static void rfc1035RRDestroy(rfc1035_rr * rr, int n) { if (rr == NULL) @@ -493,13 +464,87 @@ assert(n > 0); while (n--) { if (rr[n].rdata) - free(rr[n].rdata); + xfree(rr[n].rdata); } - free(rr); + xfree(rr); } /* - * rfc1035AnswersUnpack() + * rfc1035QueryUnpack() + * + * Unpacks a RFC1035 Query Record into 'query' from a message buffer. + * + * Updates the new message buffer offset. + * + * Returns 0 (success) or 1 (error) + */ +static int +rfc1035QueryUnpack(const char *buf, size_t sz, int *off, rfc1035_query * query) +{ + unsigned short s; + if (rfc1035NameUnpack(buf, sz, off, NULL, query->name, RFC1035_MAXHOSTNAMESZ, 0)) { + RFC1035_UNPACK_DEBUG; + memset(query, '\0', sizeof(*query)); + return 1; + } + if (*off + 4 > sz) { + RFC1035_UNPACK_DEBUG; + memset(query, '\0', sizeof(*query)); + return 1; + } + memcpy(&s, buf + *off, 2); + *off += 2; + query->qtype = ntohs(s); + memcpy(&s, buf + *off, 2); + *off += 2; + query->qclass = ntohs(s); + return 0; +} + +void +rfc1035MessageDestroy(rfc1035_message * msg) +{ + if (!msg) + return; + if (msg->query) + xfree(msg->query); + if (msg->answer) + rfc1035RRDestroy(msg->answer, msg->ancount); + xfree(msg); +} + +/* + * rfc1035QueryCompare() + * + * Compares two rfc1035_query entries + * + * Returns 0 (equal) or !=0 (different) + */ +int +rfc1035QueryCompare(const rfc1035_query * a, const rfc1035_query * b) +{ + size_t la, lb; + if (a->qtype != b->qtype) + return 1; + if (a->qclass != b->qclass) + return 1; + la = strlen(a->name); + lb = strlen(b->name); + if (la != lb) { + /* Trim root label(s) */ + while (la > 0 && a->name[la - 1] == '.') + la--; + while (lb > 0 && b->name[lb - 1] == '.') + lb--; + } + if (la != lb) + return 1; + + return strncasecmp(a->name, b->name, la); +} + +/* + * rfc1035MessageUnpack() * * Takes the contents of a DNS reply and fills in an array * of resource record structures. The records array is allocated @@ -510,60 +555,52 @@ */ int -rfc1035AnswersUnpack(const char *buf, +rfc1035MessageUnpack(const char *buf, size_t sz, - rfc1035_rr ** records, - unsigned short *id) + rfc1035_message ** answer) { - off_t off = 0; - int l; + int off = 0; int i; int nr = 0; - rfc1035_header hdr; + rfc1035_message *msg; rfc1035_rr *recs; - memset(&hdr, '\0', sizeof(hdr)); - if (rfc1035HeaderUnpack(buf + off, sz - off, &off, &hdr)) { + rfc1035_query *querys; + msg = xcalloc(1, sizeof(*msg)); + if (rfc1035HeaderUnpack(buf + off, sz - off, &off, msg)) { RFC1035_UNPACK_DEBUG; rfc1035SetErrno(rfc1035_unpack_error); + xfree(msg); return -rfc1035_unpack_error; } - *id = hdr.id; rfc1035_errno = 0; rfc1035_error_message = NULL; - if (hdr.rcode) { + i = (int) msg->qdcount; + if (i != 1) { + /* This can not be an answer to our queries.. */ RFC1035_UNPACK_DEBUG; - rfc1035SetErrno((int) hdr.rcode); - return -rfc1035_errno; + rfc1035SetErrno(rfc1035_unpack_error); + xfree(msg); + return -rfc1035_unpack_error; } - i = (int) hdr.qdcount; - /* skip question */ - while (i--) { - do { - l = (int) (unsigned char) *(buf + off); - off++; - if (l > 191) { /* compression */ - off++; - break; - } else if (l > RFC1035_MAXLABELSZ) { - /* illegal combination of compression bits */ - RFC1035_UNPACK_DEBUG; - rfc1035SetErrno(rfc1035_unpack_error); - return -rfc1035_unpack_error; - } else { - off += l; - } - } while (l > 0); /* a zero-length label terminates */ - off += 4; /* qtype, qclass */ - if (off > sz) { + querys = msg->query = xcalloc((int) msg->qdcount, sizeof(*querys)); + for (i = 0; i < (int) msg->qdcount; i++) { + if (rfc1035QueryUnpack(buf, sz, &off, &querys[i])) { RFC1035_UNPACK_DEBUG; rfc1035SetErrno(rfc1035_unpack_error); + rfc1035MessageDestroy(msg); return -rfc1035_unpack_error; } } - if (hdr.ancount == 0) + *answer = msg; + if (msg->rcode) { + RFC1035_UNPACK_DEBUG; + rfc1035SetErrno((int) msg->rcode); + return -rfc1035_errno; + } + if (msg->ancount == 0) return 0; - recs = calloc((int)hdr.ancount, sizeof(*recs)); - for (i = 0; i < (int)hdr.ancount; i++) { + recs = msg->answer = xcalloc((int) msg->ancount, sizeof(*recs)); + for (i = 0; i < (int) msg->ancount; i++) { if (off >= sz) { /* corrupt packet */ RFC1035_UNPACK_DEBUG; break; @@ -579,11 +616,11 @@ * we expected to unpack some answers (ancount != 0), but * didn't actually get any. */ - free(recs); + rfc1035MessageDestroy(msg); + *answer = NULL; rfc1035SetErrno(rfc1035_unpack_error); return -rfc1035_unpack_error; } - *records = recs; return nr; } @@ -595,21 +632,15 @@ * probably be at least 512 octets. The 'szp' initially * specifies the size of the buffer, on return it contains * the size of the message (i.e. how much to write). - * Return value is the query ID. + * Returns the size of the query */ -unsigned short -rfc1035BuildAQuery(const char *hostname, char *buf, size_t * szp) +ssize_t +rfc1035BuildAQuery(const char *hostname, char *buf, size_t sz, unsigned short qid, rfc1035_query * query) { - static rfc1035_header h; + static rfc1035_message h; size_t offset = 0; - size_t sz = *szp; memset(&h, '\0', sizeof(h)); - /* the first char of hostname must be alphanmeric */ - if (NULL == strchr(Alphanum, *hostname)) { - rfc1035SetErrno(3); - return 0; - } - h.id = rfc1035Qid(); + h.id = qid; h.qr = 0; h.rd = 1; h.opcode = 0; /* QUERY */ @@ -620,9 +651,13 @@ hostname, RFC1035_TYPE_A, RFC1035_CLASS_IN); + if (query) { + query->qtype = RFC1035_TYPE_A; + query->qclass = RFC1035_CLASS_IN; + xstrncpy(query->name, hostname, sizeof(query->name)); + } assert(offset <= sz); - *szp = (size_t) offset; - return h.id; + return offset; } /* @@ -633,14 +668,13 @@ * probably be at least 512 octets. The 'szp' initially * specifies the size of the buffer, on return it contains * the size of the message (i.e. how much to write). - * Return value is the query ID. + * Returns the size of the query */ -unsigned short -rfc1035BuildPTRQuery(const struct in_addr addr, char *buf, size_t * szp) +ssize_t +rfc1035BuildPTRQuery(const struct in_addr addr, char *buf, size_t sz, unsigned short qid, rfc1035_query * query) { - static rfc1035_header h; + static rfc1035_message h; size_t offset = 0; - size_t sz = *szp; static char rev[32]; unsigned int i; memset(&h, '\0', sizeof(h)); @@ -650,7 +684,7 @@ (i >> 8) & 255, (i >> 16) & 255, (i >> 24) & 255); - h.id = rfc1035Qid(); + h.id = qid; h.qr = 0; h.rd = 1; h.opcode = 0; /* QUERY */ @@ -661,9 +695,13 @@ rev, RFC1035_TYPE_PTR, RFC1035_CLASS_IN); + if (query) { + query->qtype = RFC1035_TYPE_PTR; + query->qclass = RFC1035_CLASS_IN; + xstrncpy(query->name, rev, sizeof(query->name)); + } assert(offset <= sz); - *szp = offset; - return h.id; + return offset; } /* @@ -671,13 +709,11 @@ * just need a new ID for it. Lucky for us ID * is the first field in the message buffer. */ -unsigned short -rfc1035RetryQuery(char *buf) +void +rfc1035SetQueryID(char *buf, unsigned short qid) { - unsigned short qid = rfc1035Qid(); unsigned short s = htons(qid); memcpy(buf, &s, sizeof(s)); - return qid; } #if DRIVER diff -ruN squid-2.5.STABLE9/lib/rfc1123.c squid-2.5.STABLE10/lib/rfc1123.c --- squid-2.5.STABLE9/lib/rfc1123.c Wed Oct 17 13:46:43 2001 +++ squid-2.5.STABLE10/lib/rfc1123.c Wed Mar 9 07:51:39 2005 @@ -1,6 +1,6 @@ /* - * $Id: rfc1123.c,v 1.29 2001/10/17 19:46:43 hno Exp $ + * $Id: rfc1123.c,v 1.29.2.2 2005/03/09 14:51:39 hno Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -103,7 +103,7 @@ for (i = 0; i < 12; i++) if (!strncmp(month_names[i], month, 3)) return i; - return 0; + return -1; } static int @@ -125,105 +125,80 @@ } static struct tm * -parse_date1(const char *str) +parse_date_elements(const char *day, const char *month, const char *year, + const char *time, const char *zone) { - /* Thursday, 10-Jun-93 01:29:59 GMT */ - const char *s; static struct tm tm; - assert(NULL != str); - memset(&tm, '\0', sizeof(struct tm)); - s = strchr(str, ','); - if (NULL == s) - return NULL; - s++; - while (*s == ' ') - s++; - /* backup if month is only one digit */ - if (xisdigit(*s) && !xisdigit(*(s + 1))) - s--; - if (!strchr(s, '-')) - return NULL; - if ((int) strlen(s) < 18) + char *t; + memset(&tm, 0, sizeof(tm)); + + if (!day || !month || !year || !time) return NULL; - memset(&tm, '\0', sizeof(tm)); - tm.tm_mday = make_num(s); - tm.tm_mon = make_month(s + 3); - tm.tm_year = make_num(s + 7); - /* - * Y2K: Arjan de Vet - * if tm.tm_year < 70, assume it's after the year 2000. - */ - if (tm.tm_year < 70) + tm.tm_mday = atoi(day); + tm.tm_mon = make_month(month); + if (tm.tm_mon < 0) + return NULL; + tm.tm_year = atoi(year); + if (strlen(year) == 4) + tm.tm_year -= 1900; + else if (tm.tm_year < 70) tm.tm_year += 100; - tm.tm_hour = make_num(s + 10); - tm.tm_min = make_num(s + 13); - tm.tm_sec = make_num(s + 16); + else if (tm.tm_year > 19000) + tm.tm_year -= 19000; + tm.tm_hour = make_num(time); + t = strchr(time, ':'); + if (!t) + return NULL; + t++; + tm.tm_min = atoi(t); + t = strchr(t, ':'); + if (t) + tm.tm_sec = atoi(t + 1); return tmSaneValues(&tm) ? &tm : NULL; } static struct tm * -parse_date2(const char *str) +parse_date(const char *str) { - /* Thu, 10 Jan 1993 01:29:59 GMT */ - const char *s; - static struct tm tm; - assert(NULL != str); - memset(&tm, '\0', sizeof(struct tm)); - s = strchr(str, ','); - if (NULL == s) - return NULL; - s++; - while (*s == ' ') - s++; - /* backup if month is only one digit */ - if (xisdigit(*s) && !xisdigit(*(s + 1))) - s--; - if (strchr(s, '-')) - return NULL; - if ((int) strlen(s) < 20) - return NULL; - memset(&tm, '\0', sizeof(tm)); - tm.tm_mday = make_num(s); - tm.tm_mon = make_month(s + 3); - tm.tm_year = (100 * make_num(s + 7) - 1900) + make_num(s + 9); - tm.tm_hour = make_num(s + 12); - tm.tm_min = make_num(s + 15); - tm.tm_sec = make_num(s + 18); - return tmSaneValues(&tm) ? &tm : NULL; -} + struct tm *tm; + char *tmp = xstrdup(str); + char *t; + char *wday = NULL; + char *day = NULL; + char *month = NULL; + char *year = NULL; + char *time = NULL; + char *zone = NULL; + + for (t = strtok(tmp, ", "); t; t = strtok(NULL, ", ")) { + if (xisdigit(*t)) { + if (!day) { + day = t; + t = strchr(t, '-'); + if (t) { + *t++ = '\0'; + month = t; + t = strchr(t, '-'); + if (!t) + return NULL; + *t++ = '\0'; + year = t; + } + } else if (strchr(t, ':')) + time = t; + else if (!year) + year = t; + } else if (!wday) + wday = t; + else if (!month) + month = t; + else if (!zone) + zone = t; + } + tm = parse_date_elements(day, month, year, time, zone); -static struct tm * -parse_date3(const char *str) -{ - /* Wed Jun 9 01:29:59 1993 GMT */ - static struct tm tm; - char *s; - static char buf[128]; - while (*str && *str == ' ') - str++; - xstrncpy(buf, str, 128); - if (NULL == (s = strtok(buf, w_space))) - return NULL; - if (NULL == (s = strtok(NULL, w_space))) - return NULL; - tm.tm_mon = make_month(s); - if (NULL == (s = strtok(NULL, w_space))) - return NULL; - tm.tm_mday = atoi(s); - if (NULL == (s = strtok(NULL, ":"))) - return NULL; - tm.tm_hour = atoi(s); - if (NULL == (s = strtok(NULL, ":"))) - return NULL; - tm.tm_min = atoi(s); - if (NULL == (s = strtok(NULL, w_space))) - return NULL; - tm.tm_sec = atoi(s); - if (NULL == (s = strtok(NULL, w_space))) - return NULL; - /* Y2K fix, richard.kettlewell@kewill.com */ - tm.tm_year = atoi(s) - 1900; - return tmSaneValues(&tm) ? &tm : NULL; + xfree(tmp); + return tm; } time_t @@ -233,15 +208,9 @@ time_t t; if (NULL == str) return -1; - tm = parse_date1(str); - if (NULL == tm) { - tm = parse_date2(str); - if (NULL == tm) { - tm = parse_date3(str); - if (NULL == tm) - return -1; - } - } + tm = parse_date(str); + if (!tm) + return -1; tm->tm_isdst = -1; #ifdef HAVE_TIMEGM t = timegm(tm); diff -ruN squid-2.5.STABLE9/scripts/Makefile.in squid-2.5.STABLE10/scripts/Makefile.in --- squid-2.5.STABLE9/scripts/Makefile.in Sat Jul 10 06:11:47 2004 +++ squid-2.5.STABLE10/scripts/Makefile.in Fri Mar 18 17:55:51 2005 @@ -85,6 +85,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/snmplib/Makefile.in squid-2.5.STABLE10/snmplib/Makefile.in --- squid-2.5.STABLE9/snmplib/Makefile.in Sun Feb 20 18:35:48 2005 +++ squid-2.5.STABLE10/snmplib/Makefile.in Fri Mar 18 17:55:51 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/snmplib/mib.c squid-2.5.STABLE10/snmplib/mib.c --- squid-2.5.STABLE9/snmplib/mib.c Wed Nov 28 01:01:46 2001 +++ squid-2.5.STABLE10/snmplib/mib.c Wed Mar 9 07:33:02 2005 @@ -127,11 +127,11 @@ char c1, c2; while (*s1 && *s2) { - if (isupper(*s1)) + if (xisupper(*s1)) c1 = tolower(*s1); else c1 = *s1; - if (isupper(*s2)) + if (xisupper(*s2)) c2 = tolower(*s2); else c2 = *s2; @@ -163,11 +163,11 @@ (*input == '.')) return (0); - if (isdigit(*input)) { + if (xisdigit(*input)) { /* * Read the number, then try to find it in the subtree. */ - while (isdigit(*input)) { + while (xisdigit(*input)) { subid *= 10; subid += *input++ - '0'; } diff -ruN squid-2.5.STABLE9/snmplib/parse.c squid-2.5.STABLE10/snmplib/parse.c --- squid-2.5.STABLE9/snmplib/parse.c Wed Oct 17 13:05:37 2001 +++ squid-2.5.STABLE10/snmplib/parse.c Wed Mar 9 07:33:02 2005 @@ -540,7 +540,7 @@ return get_token(fp, token); } for (cp = token; *cp; cp++) - if (!isdigit(*cp)) + if (!xisdigit(*cp)) return LABEL; return NUMBER; } else { diff -ruN squid-2.5.STABLE9/snmplib/snmp_api.c squid-2.5.STABLE10/snmplib/snmp_api.c --- squid-2.5.STABLE9/snmplib/snmp_api.c Tue Feb 12 18:43:43 2002 +++ squid-2.5.STABLE10/snmplib/snmp_api.c Wed May 4 12:03:47 2005 @@ -149,5 +149,8 @@ strncpy((char *) bufp, (char *) Community, CommunityLen); bufp[CommunityLen] = '\0'; + session->community = bufp; + session->community_len = CommunityLen; + return (bufp); } diff -ruN squid-2.5.STABLE9/src/HttpHdrCc.c squid-2.5.STABLE10/src/HttpHdrCc.c --- squid-2.5.STABLE9/src/HttpHdrCc.c Thu Jan 11 17:37:13 2001 +++ squid-2.5.STABLE10/src/HttpHdrCc.c Fri Apr 22 14:18:43 2005 @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrCc.c,v 1.22 2001/01/12 00:37:13 wessels Exp $ + * $Id: HttpHdrCc.c,v 1.22.2.1 2005/04/22 20:18:43 hno Exp $ * * DEBUG: section 65 HTTP Cache Control Header * AUTHOR: Alex Rousskov @@ -103,15 +103,18 @@ const char *pos = NULL; int type; int ilen; + int nlen; assert(cc && str); /* iterate through comma separated list */ while (strListGetItem(str, ',', &item, &ilen, &pos)) { - /* strip '=' statements @?@ */ - if ((p = strchr(item, '=')) && (p - item < ilen)) - ilen = p++ - item; + /* isolate directive name */ + if ((p = memchr(item, '=', ilen))) + nlen = p++ - item; + else + nlen = ilen; /* find type */ - type = httpHeaderIdByName(item, ilen, + type = httpHeaderIdByName(item, nlen, CcFieldsInfo, CC_ENUM_END); if (type < 0) { debug(65, 2) ("hdr cc: unknown cache-directive: near '%s' in '%s'\n", item, strBuf(*str)); @@ -147,8 +150,13 @@ cc->max_stale = -1; } break; + case CC_OTHER: + if (strLen(cc->other)) + strCat(cc->other, ", "); + stringAppend(&cc->other, item, ilen); + break; default: - /* note that we ignore most of '=' specs */ + /* note that we ignore most of '=' specs (RFC-VIOLATION) */ break; } } @@ -159,6 +167,8 @@ httpHdrCcDestroy(HttpHdrCc * cc) { assert(cc); + if (strBuf(cc->other)) + stringClean(&cc->other); memFree(cc, MEM_HTTP_HDR_CC); } @@ -200,6 +210,8 @@ pcount++; } } + if (strLen(cc->other)) + packerPrintf(p, (pcount ? ", %s" : "%s"), strBuf(cc->other)); } void diff -ruN squid-2.5.STABLE9/src/HttpHdrContRange.c squid-2.5.STABLE10/src/HttpHdrContRange.c --- squid-2.5.STABLE9/src/HttpHdrContRange.c Wed Oct 24 02:19:07 2001 +++ squid-2.5.STABLE10/src/HttpHdrContRange.c Fri Mar 25 19:50:50 2005 @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrContRange.c,v 1.14 2001/10/24 08:19:07 hno Exp $ + * $Id: HttpHdrContRange.c,v 1.14.2.1 2005/03/26 02:50:50 hno Exp $ * * DEBUG: section 68 HTTP Content-Range Header * AUTHOR: Alex Rousskov @@ -81,7 +81,7 @@ p++; /* do we have last-pos ? */ if (p - field < flen) { - ssize_t last_pos; + squid_off_t last_pos; if (!httpHeaderParseSize(p, &last_pos)) return 0; spec->length = size_diff(last_pos + 1, spec->offset); @@ -101,8 +101,8 @@ if (!known_spec(spec->offset) || !known_spec(spec->length)) packerPrintf(p, "*"); else - packerPrintf(p, "bytes %ld-%ld", - (long int) spec->offset, (long int) spec->offset + spec->length - 1); + packerPrintf(p, "bytes %" PRINTF_OFF_T "-%" PRINTF_OFF_T "", + spec->offset, spec->offset + spec->length - 1); } /* @@ -152,9 +152,9 @@ range->elength = range_spec_unknown; else if (!httpHeaderParseSize(p, &range->elength)) return 0; - debug(68, 8) ("parsed content-range field: %ld-%ld / %ld\n", - (long int) range->spec.offset, (long int) range->spec.offset + range->spec.length - 1, - (long int) range->elength); + debug(68, 8) ("parsed content-range field: %" PRINTF_OFF_T "-%" PRINTF_OFF_T " / %" PRINTF_OFF_T "\n", + range->spec.offset, range->spec.offset + range->spec.length - 1, + range->elength); return 1; } @@ -187,7 +187,7 @@ } void -httpHdrContRangeSet(HttpHdrContRange * cr, HttpHdrRangeSpec spec, ssize_t ent_len) +httpHdrContRangeSet(HttpHdrContRange * cr, HttpHdrRangeSpec spec, squid_off_t ent_len) { assert(cr && ent_len >= 0); cr->spec = spec; diff -ruN squid-2.5.STABLE9/src/HttpHdrRange.c squid-2.5.STABLE10/src/HttpHdrRange.c --- squid-2.5.STABLE9/src/HttpHdrRange.c Wed Oct 24 02:19:07 2001 +++ squid-2.5.STABLE10/src/HttpHdrRange.c Fri Mar 25 19:50:50 2005 @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrRange.c,v 1.26 2001/10/24 08:19:07 hno Exp $ + * $Id: HttpHdrRange.c,v 1.26.2.1 2005/03/26 02:50:50 hno Exp $ * * DEBUG: section 64 HTTP Range Header * AUTHOR: Alex Rousskov @@ -55,7 +55,7 @@ /* local constants */ -#define range_spec_unknown ((ssize_t)-1) +#define range_spec_unknown ((squid_off_t)-1) /* local routines */ #define known_spec(s) ((s) != range_spec_unknown) @@ -102,7 +102,7 @@ p++; /* do we have last-pos ? */ if (p - field < flen) { - ssize_t last_pos; + squid_off_t last_pos; if (!httpHeaderParseSize(p, &last_pos)) return NULL; spec.length = size_diff(last_pos + 1, spec.offset); @@ -136,12 +136,12 @@ httpHdrRangeSpecPackInto(const HttpHdrRangeSpec * spec, Packer * p) { if (!known_spec(spec->offset)) /* suffix */ - packerPrintf(p, "-%ld", (long int) spec->length); + packerPrintf(p, "-%" PRINTF_OFF_T, spec->length); else if (!known_spec(spec->length)) /* trailer */ - packerPrintf(p, "%ld-", (long int) spec->offset); + packerPrintf(p, "%" PRINTF_OFF_T "-", spec->offset); else /* range */ - packerPrintf(p, "%ld-%ld", - (long int) spec->offset, (long int) spec->offset + spec->length - 1); + packerPrintf(p, "%" PRINTF_OFF_T "-%" PRINTF_OFF_T, + spec->offset, spec->offset + spec->length - 1); } /* fills "absent" positions in range specification based on response body size @@ -151,8 +151,8 @@ static int httpHdrRangeSpecCanonize(HttpHdrRangeSpec * spec, size_t clen) { - debug(64, 5) ("httpHdrRangeSpecCanonize: have: [%ld, %ld) len: %ld\n", - (long int) spec->offset, (long int) spec->offset + spec->length, (long int) spec->length); + debug(64, 5) ("httpHdrRangeSpecCanonize: have: [%" PRINTF_OFF_T ", %" PRINTF_OFF_T ") len: %" PRINTF_OFF_T "\n", + spec->offset, spec->offset + spec->length, spec->length); if (!known_spec(spec->offset)) /* suffix */ spec->offset = size_diff(clen, spec->length); else if (!known_spec(spec->length)) /* trailer */ @@ -162,8 +162,8 @@ assert(known_spec(spec->offset)); spec->length = size_min(size_diff(clen, spec->offset), spec->length); /* check range validity */ - debug(64, 5) ("httpHdrRangeSpecCanonize: done: [%ld, %ld) len: %ld\n", - (long int) spec->offset, (long int) spec->offset + (long int) spec->length, (long int) spec->length); + debug(64, 5) ("httpHdrRangeSpecCanonize: done: [%" PRINTF_OFF_T ", %" PRINTF_OFF_T ") len: %" PRINTF_OFF_T "\n", + spec->offset, spec->offset + spec->length, spec->length); return spec->length > 0; } @@ -303,7 +303,7 @@ * - there is at least one range spec */ int -httpHdrRangeCanonize(HttpHdrRange * range, ssize_t clen) +httpHdrRangeCanonize(HttpHdrRange * range, squid_off_t clen) { int i; HttpHdrRangeSpec *spec; @@ -415,10 +415,10 @@ * Returns lowest known offset in range spec(s), or range_spec_unknown * this is used for size limiting */ -ssize_t +squid_off_t httpHdrRangeFirstOffset(const HttpHdrRange * range) { - ssize_t offset = range_spec_unknown; + squid_off_t offset = range_spec_unknown; HttpHdrRangePos pos = HttpHdrRangeInitPos; const HttpHdrRangeSpec *spec; assert(range); @@ -435,11 +435,11 @@ * ranges are combined into one, for example FTP REST. * Use 0 for size if unknown */ -ssize_t -httpHdrRangeLowestOffset(const HttpHdrRange * range, ssize_t size) +squid_off_t +httpHdrRangeLowestOffset(const HttpHdrRange * range, squid_off_t size) { - ssize_t offset = range_spec_unknown; - ssize_t current; + squid_off_t offset = range_spec_unknown; + squid_off_t current; HttpHdrRangePos pos = HttpHdrRangeInitPos; const HttpHdrRangeSpec *spec; assert(range); diff -ruN squid-2.5.STABLE9/src/HttpHeader.c squid-2.5.STABLE10/src/HttpHeader.c --- squid-2.5.STABLE9/src/HttpHeader.c Sun Feb 20 03:32:41 2005 +++ squid-2.5.STABLE10/src/HttpHeader.c Fri May 6 15:32:09 2005 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.c,v 1.74.2.25 2005/02/20 10:32:41 hno Exp $ + * $Id: HttpHeader.c,v 1.74.2.28 2005/05/06 21:32:09 wessels Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -80,7 +80,7 @@ {"Content-Disposition", HDR_CONTENT_DISPOSITION, ftStr}, {"Content-Encoding", HDR_CONTENT_ENCODING, ftStr}, {"Content-Language", HDR_CONTENT_LANGUAGE, ftStr}, - {"Content-Length", HDR_CONTENT_LENGTH, ftInt}, + {"Content-Length", HDR_CONTENT_LENGTH, ftSize}, {"Content-Location", HDR_CONTENT_LOCATION, ftStr}, {"Content-MD5", HDR_CONTENT_MD5, ftStr}, /* for now */ {"Content-Range", HDR_CONTENT_RANGE, ftPContRange}, @@ -474,13 +474,20 @@ return httpHeaderReset(hdr); } if (e->id == HDR_CONTENT_LENGTH && (e2 = httpHeaderFindEntry(hdr, e->id)) != NULL) { - if (!Config.onoff.relaxed_header_parser || strCmp(e->value, strBuf(e2->value)) != 0) { + if (strCmp(e->value, strBuf(e2->value)) != 0) { debug(55, 1) ("WARNING: found two conflicting content-length headers in {%s}\n", getStringPrefix(header_start, header_end)); httpHeaderEntryDestroy(e); return httpHeaderReset(hdr); } else { debug(55, Config.onoff.relaxed_header_parser <= 0 ? 1 : 2) ("NOTICE: found double content-length header\n"); + if (Config.onoff.relaxed_header_parser) { + httpHeaderEntryDestroy(e); + continue; + } else { + httpHeaderEntryDestroy(e); + return httpHeaderReset(hdr); + } } } if (e->id == HDR_OTHER && stringHasWhitespace(strBuf(e->name))) { @@ -807,6 +814,17 @@ } void +httpHeaderPutSize(HttpHeader * hdr, http_hdr_type id, squid_off_t number) +{ + char size[64]; + assert_eid(id); + assert(Headers[id].type == ftSize); /* must be of an appropriate type */ + assert(number >= 0); + snprintf(size, sizeof(size), "%" PRINTF_OFF_T, number); + httpHeaderAddEntry(hdr, httpHeaderEntryCreate(id, NULL, size)); +} + +void httpHeaderPutTime(HttpHeader * hdr, http_hdr_type id, time_t htime) { assert_eid(id); @@ -912,6 +930,21 @@ return value; } +squid_off_t +httpHeaderGetSize(const HttpHeader * hdr, http_hdr_type id) +{ + HttpHeaderEntry *e; + squid_off_t value = -1; + int ok; + assert_eid(id); + assert(Headers[id].type == ftSize); /* must be of an appropriate type */ + if ((e = httpHeaderFindEntry(hdr, id))) { + ok = httpHeaderParseSize(strBuf(e->value), &value); + httpHeaderNoteParsedEntry(e->id, e->value, !ok); + } + return value; +} + time_t httpHeaderGetTime(const HttpHeader * hdr, http_hdr_type id) { @@ -1112,8 +1145,8 @@ /* do we have a valid field name within this field? */ if (!name_len || name_end > field_end) return NULL; - if (name_len > 65536) { - /* String has a 64K limit */ + if (name_len > 65534) { + /* String must be LESS THAN 64K and it adds a terminating NULL */ debug(55, 1) ("WARNING: ignoring header name of %d bytes\n", name_len); return NULL; } @@ -1144,8 +1177,8 @@ value_start++; while (value_start < field_end && xisspace(field_end[-1])) field_end--; - if (field_end - value_start > 65536) { - /* String has a 64K limit */ + if (field_end - value_start > 65534) { + /* String must be LESS THAN 64K and it adds a terminating NULL */ debug(55, 1) ("WARNING: ignoring '%s' header of %d bytes\n", strBuf(e->name), (int) (field_end - value_start)); if (e->id == HDR_OTHER) diff -ruN squid-2.5.STABLE9/src/HttpHeaderTools.c squid-2.5.STABLE10/src/HttpHeaderTools.c --- squid-2.5.STABLE9/src/HttpHeaderTools.c Sat Sep 25 05:56:16 2004 +++ squid-2.5.STABLE10/src/HttpHeaderTools.c Fri Mar 25 19:50:51 2005 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeaderTools.c,v 1.32.2.3 2004/09/25 11:56:16 hno Exp $ + * $Id: HttpHeaderTools.c,v 1.32.2.4 2005/03/26 02:50:51 hno Exp $ * * DEBUG: section 66 HTTP Header Tools * AUTHOR: Alex Rousskov @@ -138,7 +138,7 @@ /* wrapper arrounf PutContRange */ void -httpHeaderAddContRange(HttpHeader * hdr, HttpHdrRangeSpec spec, ssize_t ent_len) +httpHeaderAddContRange(HttpHeader * hdr, HttpHdrRangeSpec spec, squid_off_t ent_len) { HttpHdrContRange *cr = httpHdrContRangeCreate(); assert(hdr && ent_len >= 0); @@ -316,11 +316,14 @@ return 1; } -int -httpHeaderParseSize(const char *start, ssize_t * value) +squid_off_t +httpHeaderParseSize(const char *start, squid_off_t * value) { - int v; - const int res = httpHeaderParseInt(start, &v); + squid_off_t v; + char *end; + int res; + v = strto_off_t(start, &end, 10); + res = start != end; assert(value); *value = res ? v : 0; return res; diff -ruN squid-2.5.STABLE9/src/HttpReply.c squid-2.5.STABLE10/src/HttpReply.c --- squid-2.5.STABLE9/src/HttpReply.c Fri Jan 21 05:22:59 2005 +++ squid-2.5.STABLE10/src/HttpReply.c Fri Mar 25 19:50:51 2005 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.c,v 1.49.2.4 2005/01/21 12:22:59 hno Exp $ + * $Id: HttpReply.c,v 1.49.2.5 2005/03/26 02:50:51 hno Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -135,7 +135,7 @@ * returns true on success. */ int -httpReplyParse(HttpReply * rep, const char *buf, ssize_t end) +httpReplyParse(HttpReply * rep, const char *buf, size_t end) { /* * this extra buffer/copy will be eliminated when headers become @@ -194,9 +194,10 @@ packerClean(&p); } +#if UNUSED_CODE MemBuf httpPackedReply(http_version_t ver, http_status status, const char *ctype, - int clen, time_t lmt, time_t expires) + squid_off_t clen, time_t lmt, time_t expires) { HttpReply *rep = httpReplyCreate(); MemBuf mb; @@ -205,6 +206,7 @@ httpReplyDestroy(rep); return mb; } +#endif MemBuf httpPacked304Reply(const HttpReply * rep) @@ -230,7 +232,7 @@ void httpReplySetHeaders(HttpReply * reply, http_version_t ver, http_status status, const char *reason, - const char *ctype, int clen, time_t lmt, time_t expires) + const char *ctype, squid_off_t clen, time_t lmt, time_t expires) { HttpHeader *hdr; assert(reply); @@ -245,7 +247,7 @@ } else reply->content_type = StringNull; if (clen >= 0) - httpHeaderPutInt(hdr, HDR_CONTENT_LENGTH, clen); + httpHeaderPutSize(hdr, HDR_CONTENT_LENGTH, clen); if (expires >= 0) httpHeaderPutTime(hdr, HDR_EXPIRES, expires); if (lmt > 0) /* this used to be lmt != 0 @?@ */ @@ -267,7 +269,7 @@ hdr = &reply->header; httpHeaderPutStr(hdr, HDR_SERVER, full_appname_string); httpHeaderPutTime(hdr, HDR_DATE, squid_curtime); - httpHeaderPutInt(hdr, HDR_CONTENT_LENGTH, 0); + httpHeaderPutSize(hdr, HDR_CONTENT_LENGTH, 0); httpHeaderPutStr(hdr, HDR_LOCATION, loc); reply->date = squid_curtime; reply->content_length = 0; @@ -342,7 +344,7 @@ { const HttpHeader *hdr = &rep->header; const char *str; - rep->content_length = httpHeaderGetInt(hdr, HDR_CONTENT_LENGTH); + rep->content_length = httpHeaderGetSize(hdr, HDR_CONTENT_LENGTH); rep->date = httpHeaderGetTime(hdr, HDR_DATE); rep->last_modified = httpHeaderGetTime(hdr, HDR_LAST_MODIFIED); str = httpHeaderGetStr(hdr, HDR_CONTENT_TYPE); @@ -449,7 +451,7 @@ /* * Returns the body size of a HTTP response */ -int +squid_off_t httpReplyBodySize(method_t method, const HttpReply * reply) { if (reply->sline.version.major < 1) diff -ruN squid-2.5.STABLE9/src/Makefile.am squid-2.5.STABLE10/src/Makefile.am --- squid-2.5.STABLE9/src/Makefile.am Sat Sep 25 15:37:35 2004 +++ squid-2.5.STABLE10/src/Makefile.am Fri Apr 22 19:32:27 2005 @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.am,v 1.16.2.10 2004/09/25 21:37:35 hno Exp $ +# $Id: Makefile.am,v 1.16.2.11 2005/04/23 01:32:27 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -91,6 +91,7 @@ cf_gen.$(OBJEXT): cf_gen_defines.h squidclient_SOURCES = client.c cachemgr__CGIEXT__SOURCES = cachemgr.c +cachemgr__CGIEXT__CFLAGS = -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CFLAGS) EXTRA_squid_SOURCES = \ delay_pools.c \ @@ -268,10 +269,12 @@ store_modules.sh \ repl_modules.sh \ mib.txt \ + cachemgr.conf \ mime.conf.default DEFAULT_PREFIX = $(prefix) DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf +DEFAULT_CACHEMGR_CONFIG = $(sysconfdir)/cachemgr.conf DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf DEFAULT_DNSSERVER = $(libexecdir)/`echo dnsserver | sed '$(transform);s/$$/$(EXEEXT)/'` DEFAULT_LOG_PREFIX = $(localstatedir)/logs @@ -359,6 +362,12 @@ else \ echo "$(INSTALL_DATA) squid.conf.default $(DESTDIR)$(DEFAULT_CONFIG_FILE)"; \ $(INSTALL_DATA) squid.conf.default $(DESTDIR)$(DEFAULT_CONFIG_FILE); \ + fi + @if test -f $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG) ; then \ + echo "$@ will not overwrite existing $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG)" ; \ + else \ + echo "$(INSTALL_DATA) $(srcdir)/cachemgr.conf $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG)"; \ + $(INSTALL_DATA) $(srcdir)/cachemgr.conf $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG); \ fi $(mkinstalldirs) $(DESTDIR)$(DEFAULT_LOG_PREFIX) diff -ruN squid-2.5.STABLE9/src/Makefile.in squid-2.5.STABLE10/src/Makefile.in --- squid-2.5.STABLE9/src/Makefile.in Sat Sep 25 15:37:59 2004 +++ squid-2.5.STABLE10/src/Makefile.in Sat Apr 23 18:12:08 2005 @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.225.2.20 2004/09/25 21:37:59 hno Exp $ +# $Id: Makefile.in,v 1.225.2.24 2005/04/24 00:12:08 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ @@ -185,6 +186,7 @@ nodist_cf_gen_HEADER = cf_gen_defines.h squidclient_SOURCES = client.c cachemgr__CGIEXT__SOURCES = cachemgr.c +cachemgr__CGIEXT__CFLAGS = -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CFLAGS) EXTRA_squid_SOURCES = \ delay_pools.c \ @@ -369,11 +371,13 @@ store_modules.sh \ repl_modules.sh \ mib.txt \ + cachemgr.conf \ mime.conf.default DEFAULT_PREFIX = $(prefix) DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf +DEFAULT_CACHEMGR_CONFIG = $(sysconfdir)/cachemgr.conf DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf DEFAULT_DNSSERVER = $(libexecdir)/`echo dnsserver | sed '$(transform);s/$$/$(EXEEXT)/'` DEFAULT_LOG_PREFIX = $(localstatedir)/logs @@ -439,7 +443,7 @@ PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(noinst_PROGRAMS) \ $(sbin_PROGRAMS) -am_cachemgr__CGIEXT__OBJECTS = cachemgr.$(OBJEXT) +am_cachemgr__CGIEXT__OBJECTS = cachemgr__CGIEXT_-cachemgr.$(OBJEXT) cachemgr__CGIEXT__OBJECTS = $(am_cachemgr__CGIEXT__OBJECTS) cachemgr__CGIEXT__LDADD = $(LDADD) cachemgr__CGIEXT__DEPENDENCIES = @@ -460,21 +464,21 @@ pinger_LDADD = $(LDADD) pinger_DEPENDENCIES = pinger_LDFLAGS = -@USE_DELAY_POOLS_FALSE@am__objects_3 = @USE_DELAY_POOLS_TRUE@am__objects_3 = delay_pools.$(OBJEXT) +@USE_DELAY_POOLS_FALSE@am__objects_3 = @USE_DNSSERVER_FALSE@am__objects_4 = dns_internal.$(OBJEXT) @USE_DNSSERVER_TRUE@am__objects_4 = dns.$(OBJEXT) @ENABLE_HTCP_TRUE@am__objects_5 = htcp.$(OBJEXT) -@MAKE_LEAKFINDER_TRUE@am__objects_6 = leakfinder.$(OBJEXT) @MAKE_LEAKFINDER_FALSE@am__objects_6 = +@MAKE_LEAKFINDER_TRUE@am__objects_6 = leakfinder.$(OBJEXT) @USE_SNMP_TRUE@am__objects_7 = snmp_core.$(OBJEXT) snmp_agent.$(OBJEXT) @USE_SNMP_FALSE@am__objects_7 = -@ENABLE_SSL_FALSE@am__objects_8 = @ENABLE_SSL_TRUE@am__objects_8 = ssl_support.$(OBJEXT) -@ENABLE_UNLINKD_TRUE@am__objects_9 = unlinkd.$(OBJEXT) +@ENABLE_SSL_FALSE@am__objects_8 = @ENABLE_UNLINKD_FALSE@am__objects_9 = -@ENABLE_WIN32SPECIFIC_FALSE@am__objects_10 = +@ENABLE_UNLINKD_TRUE@am__objects_9 = unlinkd.$(OBJEXT) @ENABLE_WIN32SPECIFIC_TRUE@am__objects_10 = win32.$(OBJEXT) +@ENABLE_WIN32SPECIFIC_FALSE@am__objects_10 = am_squid_OBJECTS = access_log.$(OBJEXT) acl.$(OBJEXT) asn.$(OBJEXT) \ authenticate.$(OBJEXT) cache_cf.$(OBJEXT) CacheDigest.$(OBJEXT) \ cache_manager.$(OBJEXT) carp.$(OBJEXT) cbdata.$(OBJEXT) \ @@ -540,7 +544,8 @@ @AMDEP_TRUE@ $(DEPDIR)/access_log.Po $(DEPDIR)/acl.Po \ @AMDEP_TRUE@ $(DEPDIR)/asn.Po $(DEPDIR)/auth_modules.Po \ @AMDEP_TRUE@ $(DEPDIR)/authenticate.Po $(DEPDIR)/cache_cf.Po \ -@AMDEP_TRUE@ $(DEPDIR)/cache_manager.Po $(DEPDIR)/cachemgr.Po \ +@AMDEP_TRUE@ $(DEPDIR)/cache_manager.Po \ +@AMDEP_TRUE@ $(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Po \ @AMDEP_TRUE@ $(DEPDIR)/carp.Po $(DEPDIR)/cbdata.Po \ @AMDEP_TRUE@ $(DEPDIR)/cf_gen.Po $(DEPDIR)/client.Po \ @AMDEP_TRUE@ $(DEPDIR)/client_db.Po $(DEPDIR)/client_side.Po \ @@ -687,6 +692,7 @@ clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) +cachemgr__CGIEXT_-cachemgr.$(OBJEXT): cachemgr.c cachemgr$(CGIEXT)$(EXEEXT): $(cachemgr__CGIEXT__OBJECTS) $(cachemgr__CGIEXT__DEPENDENCIES) @rm -f cachemgr$(CGIEXT)$(EXEEXT) $(LINK) $(cachemgr__CGIEXT__LDFLAGS) $(cachemgr__CGIEXT__OBJECTS) $(cachemgr__CGIEXT__LDADD) $(LIBS) @@ -739,7 +745,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/authenticate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/cache_cf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/cache_manager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/cachemgr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/carp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/cbdata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/cf_gen.Po@am__quote@ @@ -834,6 +840,18 @@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` + +cachemgr__CGIEXT_-cachemgr.o: cachemgr.c +@AMDEP_TRUE@ source='cachemgr.c' object='cachemgr__CGIEXT_-cachemgr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Po' tmpdepfile='$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cachemgr__CGIEXT__CFLAGS) $(CFLAGS) -c -o cachemgr__CGIEXT_-cachemgr.o `test -f cachemgr.c || echo '$(srcdir)/'`cachemgr.c + +cachemgr__CGIEXT_-cachemgr.obj: cachemgr.c +@AMDEP_TRUE@ source='cachemgr.c' object='cachemgr__CGIEXT_-cachemgr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Po' tmpdepfile='$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cachemgr__CGIEXT__CFLAGS) $(CFLAGS) -c -o cachemgr__CGIEXT_-cachemgr.obj `cygpath -w cachemgr.c` CCDEPMODE = @CCDEPMODE@ uninstall-info-am: install-dataDATA: $(data_DATA) @@ -1163,6 +1181,12 @@ else \ echo "$(INSTALL_DATA) squid.conf.default $(DESTDIR)$(DEFAULT_CONFIG_FILE)"; \ $(INSTALL_DATA) squid.conf.default $(DESTDIR)$(DEFAULT_CONFIG_FILE); \ + fi + @if test -f $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG) ; then \ + echo "$@ will not overwrite existing $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG)" ; \ + else \ + echo "$(INSTALL_DATA) $(srcdir)/cachemgr.conf $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG)"; \ + $(INSTALL_DATA) $(srcdir)/cachemgr.conf $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG); \ fi $(mkinstalldirs) $(DESTDIR)$(DEFAULT_LOG_PREFIX) diff -ruN squid-2.5.STABLE9/src/MemBuf.c squid-2.5.STABLE10/src/MemBuf.c --- squid-2.5.STABLE9/src/MemBuf.c Tue Oct 5 15:31:25 2004 +++ squid-2.5.STABLE10/src/MemBuf.c Fri Mar 25 19:50:51 2005 @@ -1,6 +1,6 @@ /* - * $Id: MemBuf.c,v 1.28.2.3 2004/10/05 21:31:25 hno Exp $ + * $Id: MemBuf.c,v 1.28.2.4 2005/03/26 02:50:51 hno Exp $ * * DEBUG: section 59 auto-growing Memory Buffer with printf * AUTHOR: Alex Rousskov @@ -192,7 +192,7 @@ /* calls memcpy, appends exactly size bytes, extends buffer if needed */ void -memBufAppend(MemBuf * mb, const char *buf, mb_size_t sz) +memBufAppend(MemBuf * mb, const char *buf, int sz) { assert(mb && buf && sz >= 0); assert(mb->buf); diff -ruN squid-2.5.STABLE9/src/MemPool.c squid-2.5.STABLE10/src/MemPool.c --- squid-2.5.STABLE9/src/MemPool.c Sun Mar 10 08:18:04 2002 +++ squid-2.5.STABLE10/src/MemPool.c Fri Mar 25 19:50:51 2005 @@ -1,6 +1,6 @@ /* - * $Id: MemPool.c,v 1.28.2.1 2002/03/10 15:18:04 hno Exp $ + * $Id: MemPool.c,v 1.28.2.2 2005/03/26 02:50:51 hno Exp $ * * DEBUG: section 63 Low Level Memory Pool Management * AUTHOR: Alex Rousskov @@ -46,7 +46,7 @@ /* module globals */ /* huge constant to set mem_idle_limit to "unlimited" */ -static const size_t mem_unlimited_size = 2 * 1024 * MB; +static const size_t mem_unlimited_size = 2 * 1024 * MB - 1; /* we cannot keep idle more than this limit */ static size_t mem_idle_limit = 0; @@ -58,9 +58,9 @@ static Stack Pools; /* local prototypes */ -static void memShrink(ssize_t new_limit); +static void memShrink(size_t new_limit); static void memPoolDescribe(const MemPool * pool); -static void memPoolShrink(MemPool * pool, ssize_t new_limit); +static void memPoolShrink(MemPool * pool, size_t new_limit); static double @@ -135,9 +135,9 @@ static void -memShrink(ssize_t new_limit) +memShrink(size_t new_limit) { - ssize_t start_limit = TheMeter.idle.level; + size_t start_limit = TheMeter.idle.level; int i; assert(start_limit >= 0 && new_limit >= 0); debug(63, 1) ("memShrink: started with %ld KB goal: %ld KB\n", @@ -145,7 +145,7 @@ /* first phase: cut proportionally to the pool idle size */ for (i = 0; i < Pools.count && TheMeter.idle.level > new_limit; ++i) { MemPool *pool = Pools.items[i]; - const ssize_t target_pool_size = (size_t) ((double) pool->meter.idle.level * new_limit) / start_limit; + const size_t target_pool_size = (size_t) ((double) pool->meter.idle.level * new_limit) / start_limit; memPoolShrink(pool, target_pool_size); } debug(63, 1) ("memShrink: 1st phase done with %ld KB left\n", (long int) toKB(TheMeter.idle.level)); @@ -276,7 +276,7 @@ } static void -memPoolShrink(MemPool * pool, ssize_t new_limit) +memPoolShrink(MemPool * pool, size_t new_limit) { assert(pool); assert(new_limit >= 0); @@ -308,7 +308,7 @@ memPoolInUseSize(const MemPool * pool) { assert(pool); - return pool->obj_size * pool->meter.inuse.level; + return (pool->obj_size * pool->meter.inuse.level); } /* to-do: make debug level a parameter? */ @@ -321,7 +321,7 @@ (long int) toKB(memPoolInUseSize(pool))); } -size_t +int memTotalAllocated(void) { return TheMeter.alloc.level; diff -ruN squid-2.5.STABLE9/src/Packer.c squid-2.5.STABLE10/src/Packer.c --- squid-2.5.STABLE9/src/Packer.c Thu Jan 11 17:37:14 2001 +++ squid-2.5.STABLE10/src/Packer.c Fri Mar 25 19:50:51 2005 @@ -1,6 +1,6 @@ /* - * $Id: Packer.c,v 1.13 2001/01/12 00:37:14 wessels Exp $ + * $Id: Packer.c,v 1.13.2.1 2005/03/26 02:50:51 hno Exp $ * * DEBUG: section 60 Packer: A uniform interface to store-like modules * AUTHOR: Alex Rousskov @@ -93,7 +93,7 @@ /* append()'s */ static void (*const store_append) (StoreEntry *, const char *, int) = &storeAppend; -static void (*const memBuf_append) (MemBuf *, const char *, mb_size_t) = &memBufAppend; +static void (*const memBuf_append) (MemBuf *, const char *, int) = &memBufAppend; /* vprintf()'s */ static void (*const store_vprintf) (StoreEntry *, const char *, va_list ap) = &storeAppendVPrintf; @@ -109,7 +109,7 @@ assert(p && e); p->append = (append_f) store_append; p->vprintf = (vprintf_f) store_vprintf; - p->real_handler = e; + p->real_handle = e; } /* init with this to accumulate data in MemBuf */ @@ -119,7 +119,7 @@ assert(p && mb); p->append = (append_f) memBuf_append; p->vprintf = (vprintf_f) memBuf_vprintf; - p->real_handler = mb; + p->real_handle = mb; } /* call this when you are done */ @@ -130,15 +130,15 @@ /* it is not really necessary to do this, but, just in case... */ p->append = NULL; p->vprintf = NULL; - p->real_handler = NULL; + p->real_handle = NULL; } void packerAppend(Packer * p, const char *buf, int sz) { assert(p); - assert(p->real_handler && p->append); - p->append(p->real_handler, buf, sz); + assert(p->real_handle && p->append); + p->append(p->real_handle, buf, sz); } #if STDC_HEADERS @@ -161,7 +161,7 @@ fmt = va_arg(args, char *); #endif assert(p); - assert(p->real_handler && p->vprintf); - p->vprintf(p->real_handler, fmt, args); + assert(p->real_handle && p->vprintf); + p->vprintf(p->real_handle, fmt, args); va_end(args); } diff -ruN squid-2.5.STABLE9/src/access_log.c squid-2.5.STABLE10/src/access_log.c --- squid-2.5.STABLE9/src/access_log.c Mon Sep 27 16:34:19 2004 +++ squid-2.5.STABLE10/src/access_log.c Tue Mar 29 16:13:11 2005 @@ -1,6 +1,6 @@ /* - * $Id: access_log.c,v 1.72.2.6 2004/09/27 22:34:19 wessels Exp $ + * $Id: access_log.c,v 1.72.2.8 2005/03/29 23:13:11 hno Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -245,14 +245,14 @@ client = inet_ntoa(al->cache.caddr); user = accessLogFormatName(al->cache.authuser ? al->cache.authuser : al->cache.rfc931); - logfilePrintf(logfile, "%9d.%03d %6d %s %s/%03d %lu %s %s %s %s%s/%s %s", - (int) current_time.tv_sec, + logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %" PRINTF_OFF_T " %s %s %s %s%s/%s %s", + (long int) current_time.tv_sec, (int) current_time.tv_usec / 1000, al->cache.msec, client, log_tags[al->cache.code], al->http.code, - (unsigned long) al->cache.size, + al->cache.size, al->private.method_str, al->url, user && *user ? user : dash_str, @@ -274,7 +274,7 @@ client = inet_ntoa(al->cache.caddr); user1 = accessLogFormatName(al->cache.authuser); user2 = accessLogFormatName(al->cache.rfc931); - logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %ld %s:%s", + logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %" PRINTF_OFF_T " %s:%s", client, user2 ? user2 : dash_str, user1 ? user1 : dash_str, @@ -283,7 +283,7 @@ al->url, al->http.version.major, al->http.version.minor, al->http.code, - (long int) al->cache.size, + al->cache.size, log_tags[al->cache.code], hier_strings[al->hier.code]); safe_free(user1); diff -ruN squid-2.5.STABLE9/src/acl.c squid-2.5.STABLE10/src/acl.c --- squid-2.5.STABLE9/src/acl.c Sun Feb 20 12:07:45 2005 +++ squid-2.5.STABLE10/src/acl.c Sun May 8 19:48:09 2005 @@ -1,6 +1,6 @@ /* - * $Id: acl.c,v 1.270.2.34 2005/02/20 19:07:45 hno Exp $ + * $Id: acl.c,v 1.270.2.38 2005/05/09 01:48:09 hno Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -361,7 +361,7 @@ case 4: /* a dotted quad */ if (!safe_inet_addr(asc, addr)) { debug(28, 0) ("decode_addr: unsafe IP address: '%s'\n", asc); - fatal("decode_addr: unsafe IP address"); + self_destruct(); } break; case 1: /* a significant bits value for a mask */ @@ -557,9 +557,10 @@ } else { /* assume its time-of-day spec */ if (sscanf(t, "%d:%d-%d:%d", &h1, &m1, &h2, &m2) < 4) { - fatalf("aclParseTimeSpec: ERROR: Bad time range in" + debug(28, 0) ("aclParseTimeSpec: ERROR: Bad time range in" "%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); + self_destruct(); } q = memAllocate(MEM_ACL_TIME_DATA); q->start = h1 * 60 + m1; @@ -567,9 +568,10 @@ q->weekbits = weekbits; weekbits = 0; if (q->start > q->stop) { - fatalf("aclParseTimeSpec: ERROR: Reversed time range in" + debug(28, 0) ("aclParseTimeSpec: ERROR: Reversed time range in" "%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); + self_destruct(); } if (q->weekbits == 0) q->weekbits = ACL_ALLWEEK; @@ -787,23 +789,19 @@ /* snarf the ACL name */ if ((t = strtok(NULL, w_space)) == NULL) { - debug(28, 0) ("%s line %d: %s\n", - cfg_filename, config_lineno, config_input_line); debug(28, 0) ("aclParseAclLine: missing ACL name.\n"); - return; + self_destruct(); } xstrncpy(aclname, t, ACL_NAME_SZ); /* snarf the ACL type */ if ((t = strtok(NULL, w_space)) == NULL) { - debug(28, 0) ("%s line %d: %s\n", - cfg_filename, config_lineno, config_input_line); debug(28, 0) ("aclParseAclLine: missing ACL type.\n"); + self_destruct(); return; } if ((acltype = aclStrToType(t)) == ACL_NONE) { - debug(28, 0) ("%s line %d: %s\n", - cfg_filename, config_lineno, config_input_line); debug(28, 0) ("aclParseAclLine: Invalid ACL type '%s'\n", t); + self_destruct(); return; } if ((A = aclFindByName(aclname)) == NULL) { @@ -815,7 +813,8 @@ new_acl = 1; } else { if (acltype != A->type) { - debug(28, 0) ("aclParseAclLine: ACL '%s' already exists with different type, skipping.\n", A->name); + debug(28, 0) ("aclParseAclLine: ACL '%s' already exists with different type.\n", A->name); + self_destruct(); return; } debug(28, 3) ("aclParseAclLine: Appending to '%s'\n", aclname); @@ -887,22 +886,26 @@ break; case ACL_PROXY_AUTH: if (authenticateSchemeCount() == 0) { - fatalf("Invalid Proxy Auth ACL '%s' " + debug(28, 0) ("Invalid Proxy Auth ACL '%s' " "because no authentication schemes were compiled.\n", A->cfgline); + self_destruct(); } else if (authenticateActiveSchemeCount() == 0) { - fatalf("Invalid Proxy Auth ACL '%s' " + debug(28, 0) ("Invalid Proxy Auth ACL '%s' " "because no authentication schemes are fully configured.\n", A->cfgline); + self_destruct(); } else { aclParseUserList(&A->data); } break; case ACL_PROXY_AUTH_REGEX: if (authenticateSchemeCount() == 0) { - fatalf("Invalid Proxy Auth ACL '%s' " + debug(28, 0) ("Invalid Proxy Auth ACL '%s' " "because no authentication schemes were compiled.\n", A->cfgline); + self_destruct(); } else if (authenticateActiveSchemeCount() == 0) { - fatalf("Invalid Proxy Auth ACL '%s' " + debug(28, 0) ("Invalid Proxy Auth ACL '%s' " "because no authentication schemes are fully configured.\n", A->cfgline); + self_destruct(); } else { aclParseRegexList(&A->data); } @@ -972,9 +975,18 @@ acl *a; if (NULL == name) return 0; - if ((a = aclFindByName(name))) - return a->type == ACL_PROXY_AUTH || a->type == ACL_PROXY_AUTH_REGEX; - return 0; + a = aclFindByName(name); + if (a == NULL) + return 0; + switch (a->type) { + case ACL_PROXY_AUTH: + case ACL_PROXY_AUTH_REGEX: + return 1; + case ACL_EXTERNAL: + return externalAclRequiresAuth(a->data); + default: + return 0; + } } @@ -1091,9 +1103,8 @@ debug(28, 3) ("aclParseAccessLine: looking for ACL name '%s'\n", t); a = aclFindByName(t); if (a == NULL) { - debug(28, 0) ("%s line %d: %s\n", - cfg_filename, config_lineno, config_input_line); - debug(28, 0) ("aclParseAccessLine: ACL name '%s' not found.\n", t); + debug(28, 0) ("ACL name '%s' not defined!\n", t); + self_destruct(); memFree(L, MEM_ACL_LIST); continue; } @@ -1329,7 +1340,7 @@ debug(28, 5) ("aclParseUserMaxIP: Max IP address's %d\n", (int) (*acldata)->max); return; error: - fatal("aclParseUserMaxIP: Malformed ACL %d\n"); + self_destruct(); } void @@ -1612,8 +1623,10 @@ } /* NOTREACHED */ case ACL_DST_DOMAIN: + if (aclMatchDomainList(&ae->data, r->host)) + return 1; if ((ia = ipcacheCheckNumeric(r->host)) == NULL) - return aclMatchDomainList(&ae->data, r->host); + return 0; fqdn = fqdncache_gethostbyaddr(ia->in_addrs[0], FQDN_LOOKUP_IF_MISS); if (fqdn) return aclMatchDomainList(&ae->data, fqdn); @@ -1638,8 +1651,10 @@ return aclMatchDomainList(&ae->data, "none"); /* NOTREACHED */ case ACL_DST_DOM_REGEX: + if (aclMatchRegex(ae->data, r->host)) + return 1; if ((ia = ipcacheCheckNumeric(r->host)) == NULL) - return aclMatchRegex(ae->data, r->host); + return 0; fqdn = fqdncache_gethostbyaddr(ia->in_addrs[0], FQDN_LOOKUP_IF_MISS); if (fqdn) return aclMatchRegex(ae->data, fqdn); @@ -3045,10 +3060,9 @@ for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *) next; sin = (struct sockaddr_inarp *) (rtm + 1); - /*sdl = (struct sockaddr_dl *) (sin + 1); */ #define ROUNDUP(a) \ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) - (char *) sdl = (char *) sin + ROUNDUP(sin->sin_len); + sdl = (struct sockaddr_dl *) ((char *) sin + ROUNDUP(sin->sin_len)); if (c.s_addr == sin->sin_addr.s_addr) { if (sdl->sdl_alen) { arpReq.arp_ha.sa_len = sizeof(struct sockaddr); @@ -3187,8 +3201,9 @@ while (*W != NULL) W = &(*W)->next; snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x", - arp->eth[0], arp->eth[1], arp->eth[2], arp->eth[3], - arp->eth[4], arp->eth[5]); + arp->eth[0] & 0xff, arp->eth[1] & 0xff, + arp->eth[2] & 0xff, arp->eth[3] & 0xff, + arp->eth[4] & 0xff, arp->eth[5] & 0xff); wordlistAdd(state, buf); } diff -ruN squid-2.5.STABLE9/src/asn.c squid-2.5.STABLE10/src/asn.c --- squid-2.5.STABLE9/src/asn.c Wed Jun 18 17:53:34 2003 +++ squid-2.5.STABLE10/src/asn.c Fri Mar 25 19:50:51 2005 @@ -1,6 +1,6 @@ /* - * $Id: asn.c,v 1.78.2.1 2003/06/18 23:53:34 hno Exp $ + * $Id: asn.c,v 1.78.2.2 2005/03/26 02:50:51 hno Exp $ * * DEBUG: section 53 AS Number handling * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -73,8 +73,8 @@ store_client *sc; request_t *request; int as_number; - off_t seen; - off_t offset; + squid_off_t seen; + squid_off_t offset; }; typedef struct _ASState ASState; diff -ruN squid-2.5.STABLE9/src/auth/Makefile.in squid-2.5.STABLE10/src/auth/Makefile.in --- squid-2.5.STABLE9/src/auth/Makefile.in Sun Feb 20 18:35:48 2005 +++ squid-2.5.STABLE10/src/auth/Makefile.in Fri Mar 18 17:55:54 2005 @@ -15,7 +15,7 @@ # Makefile for authentication modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.6.2.10 2005/02/21 01:35:48 hno Exp $ +# $Id: Makefile.in,v 1.6.2.11 2005/03/19 00:55:54 hno Exp $ # SHELL = @SHELL@ @@ -85,6 +85,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/auth/basic/Makefile.in squid-2.5.STABLE10/src/auth/basic/Makefile.in --- squid-2.5.STABLE9/src/auth/basic/Makefile.in Sat Jul 10 06:11:49 2004 +++ squid-2.5.STABLE10/src/auth/basic/Makefile.in Fri Mar 18 17:55:54 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/auth/basic/auth_basic.c squid-2.5.STABLE10/src/auth/basic/auth_basic.c --- squid-2.5.STABLE9/src/auth/basic/auth_basic.c Sat Sep 25 15:03:49 2004 +++ squid-2.5.STABLE10/src/auth/basic/auth_basic.c Fri Apr 22 14:29:31 2005 @@ -1,5 +1,5 @@ /* - * $Id: auth_basic.c,v 1.14.2.8 2004/09/25 21:03:49 hno Exp $ + * $Id: auth_basic.c,v 1.14.2.10 2005/04/22 20:29:31 hno Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -270,7 +270,7 @@ debug(29, 9) ("authenticateBasicHandleReply: {%s}\n", reply ? reply : ""); if (reply) { if ((t = strchr(reply, ' '))) - *t = '\0'; + *t++ = '\0'; if (*reply == '\0') reply = NULL; } @@ -280,8 +280,12 @@ basic_auth = auth_user->scheme_data; if (reply && (strncasecmp(reply, "OK", 2) == 0)) basic_auth->flags.credentials_ok = 1; - else + else { basic_auth->flags.credentials_ok = 3; + safe_free(r->auth_user_request->message); + if (t && *t) + r->auth_user_request->message = xstrdup(t); + } basic_auth->credentials_checkedtime = squid_curtime; valid = cbdataValid(r->data); if (valid) @@ -442,10 +446,14 @@ * Don't allow NL or CR in the credentials. * Oezguer Kesim */ - strtok(cleartext, "\r\n"); debug(29, 9) ("authenticateBasicDecodeAuth: cleartext = '%s'\n", cleartext); - local_basic.username = xstrndup(cleartext, USER_IDENT_SZ); - xfree(cleartext); + if (strcspn(cleartext, "\r\n") != strlen(cleartext)) { + debug(29, 1) ("authenticateBasicDecodeAuth: bad characters in authorization header '%s'\n", + proxy_auth); + xfree(cleartext); + return; + } + local_basic.username = cleartext; if ((cleartext = strchr(local_basic.username, ':')) != NULL) *(cleartext)++ = '\0'; local_basic.passwd = cleartext; diff -ruN squid-2.5.STABLE9/src/auth/digest/Makefile.in squid-2.5.STABLE10/src/auth/digest/Makefile.in --- squid-2.5.STABLE9/src/auth/digest/Makefile.in Sat Jul 10 06:11:49 2004 +++ squid-2.5.STABLE10/src/auth/digest/Makefile.in Fri Mar 18 17:55:54 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/auth/digest/auth_digest.c squid-2.5.STABLE10/src/auth/digest/auth_digest.c --- squid-2.5.STABLE9/src/auth/digest/auth_digest.c Sat Aug 28 16:31:15 2004 +++ squid-2.5.STABLE10/src/auth/digest/auth_digest.c Fri Apr 22 14:29:31 2005 @@ -1,6 +1,6 @@ /* - * $Id: auth_digest.c,v 1.10.2.13 2004/08/28 22:31:15 hno Exp $ + * $Id: auth_digest.c,v 1.10.2.14 2005/04/22 20:29:31 hno Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -720,6 +720,8 @@ RequestMethodStr[METHOD_GET], digest_request->uri, HA2, Response); if (strcasecmp(digest_request->response, Response)) { digest_request->flags.credentials_ok = 3; + safe_free(auth_user_request->message); + auth_user_request->message = xstrdup("Incorrect password"); return; } else { const char *useragent = httpHeaderGetStr(&request->header, HDR_USER_AGENT); @@ -737,6 +739,8 @@ } } else { digest_request->flags.credentials_ok = 3; + safe_free(auth_user_request->message); + auth_user_request->message = xstrdup("Incorrect password"); return; } } @@ -746,6 +750,8 @@ digest_user->username); digest_request->flags.nonce_stale = 1; digest_request->flags.credentials_ok = 3; + safe_free(auth_user_request->message); + auth_user_request->message = xstrdup("Stale nonce"); return; } /* password was checked and did match */ @@ -892,7 +898,7 @@ debug(29, 9) ("authenticateDigestHandleReply: {%s}\n", reply ? reply : ""); if (reply) { if ((t = strchr(reply, ' '))) - *t = '\0'; + *t++ = '\0'; if (*reply == '\0' || *reply == '\n') reply = NULL; } @@ -901,9 +907,12 @@ assert(auth_user_request->scheme_data != NULL); digest_request = auth_user_request->scheme_data; digest_user = auth_user_request->auth_user->scheme_data; - if (reply && (strncasecmp(reply, "ERR", 3) == 0)) + if (reply && (strncasecmp(reply, "ERR", 3) == 0)) { digest_request->flags.credentials_ok = 3; - else if (reply) { + safe_free(auth_user_request->message); + if (t && *t) + auth_user_request->message = xstrdup(t); + } else if (reply) { CvtBin(reply, digest_user->HA1); digest_user->HA1created = 1; } diff -ruN squid-2.5.STABLE9/src/auth/ntlm/Makefile.in squid-2.5.STABLE10/src/auth/ntlm/Makefile.in --- squid-2.5.STABLE9/src/auth/ntlm/Makefile.in Sat Jul 10 06:11:49 2004 +++ squid-2.5.STABLE10/src/auth/ntlm/Makefile.in Fri Mar 18 17:55:55 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/auth/ntlm/auth_ntlm.c squid-2.5.STABLE10/src/auth/ntlm/auth_ntlm.c --- squid-2.5.STABLE9/src/auth/ntlm/auth_ntlm.c Thu Feb 3 16:22:12 2005 +++ squid-2.5.STABLE10/src/auth/ntlm/auth_ntlm.c Fri Apr 22 14:29:31 2005 @@ -1,6 +1,6 @@ /* - * $Id: auth_ntlm.c,v 1.17.2.21 2005/02/03 23:22:12 hno Exp $ + * $Id: auth_ntlm.c,v 1.17.2.22 2005/04/22 20:29:31 hno Exp $ * * DEBUG: section 29 NTLM Authenticator * AUTHOR: Robert Collins @@ -549,6 +549,10 @@ ntlm_request->auth_state = AUTHENTICATE_STATE_FAILED; authenticateNTLMResetServer(ntlm_request); debug(29, 4) ("authenticateNTLMHandleReply: Error validating user via NTLM. Error returned '%s'\n", reply); + reply += 3; + safe_free(auth_user_request->message); + if (*reply) + auth_user_request->message = xstrdup(reply); } else if (strncasecmp(reply, "BH ", 3) == 0) { /* TODO kick off a refresh process. This can occur after a YR or after * a KK. If after a YR release the helper and resubmit the request via @@ -579,6 +583,10 @@ /* the helper broke on a KK */ debug(29, 1) ("authenticateNTLMHandleReply: Error validating user via NTLM. Error returned '%s'\n", reply); ntlm_request->auth_state = AUTHENTICATE_STATE_FAILED; + reply += 3; + safe_free(auth_user_request->message); + if (*reply) + auth_user_request->message = xstrdup(reply); } } else { fatalf("authenticateNTLMHandleReply: *** Unsupported helper response ***, '%s'\n", reply); diff -ruN squid-2.5.STABLE9/src/authenticate.c squid-2.5.STABLE10/src/authenticate.c --- squid-2.5.STABLE9/src/authenticate.c Mon Jan 10 08:35:38 2005 +++ squid-2.5.STABLE10/src/authenticate.c Fri Mar 25 19:50:51 2005 @@ -1,6 +1,6 @@ /* - * $Id: authenticate.c,v 1.36.2.16 2005/01/10 15:35:38 hno Exp $ + * $Id: authenticate.c,v 1.36.2.17 2005/03/26 02:50:51 hno Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -352,7 +352,7 @@ authenticateAuthUserClearIp(auth_user_request->auth_user); } -size_t +int authenticateAuthUserRequestIPCount(auth_user_request_t * auth_user_request) { assert(auth_user_request); diff -ruN squid-2.5.STABLE9/src/cache_cf.c squid-2.5.STABLE10/src/cache_cf.c --- squid-2.5.STABLE9/src/cache_cf.c Sun Feb 20 19:55:04 2005 +++ squid-2.5.STABLE10/src/cache_cf.c Fri May 6 16:33:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.396.2.20 2005/02/21 02:55:04 hno Exp $ + * $Id: cache_cf.c,v 1.396.2.26 2005/05/06 22:33:53 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -78,7 +78,7 @@ static void default_all(void); static void defaults_if_none(void); static int parse_line(char *); -static void parseBytesLine(size_t * bptr, const char *units); +static void parseBytesLine(squid_off_t * bptr, const char *units); static size_t parseBytesUnits(const char *unit); static void free_all(void); void requirePathnameExists(const char *name, const char *path); @@ -110,6 +110,7 @@ void self_destruct(void) { + shutting_down = 1; fatalf("Bungled %s line %d: %s", cfg_filename, config_lineno, config_input_line); } @@ -210,10 +211,35 @@ GetInteger(void) { char *token = strtok(NULL, w_space); + char *end; int i; + double d; if (token == NULL) self_destruct(); - if (sscanf(token, "%d", &i) != 1) + i = strtol(token, &end, 0); + d = strtod(token, NULL); + if (d > INT_MAX || end == token) + self_destruct(); + return i; +} + +static squid_off_t +GetOffT(void) +{ + char *token = strtok(NULL, w_space); + char *end; + squid_off_t i; + if (token == NULL) + self_destruct(); + i = strto_off_t(token, &end, 0); +#if SIZEOF_SQUID_OFF_T <= 4 + { + double d = strtod(token, NULL); + if (d > INT_MAX) + end = token; + } +#endif + if (end == token) self_destruct(); return i; } @@ -222,7 +248,7 @@ update_maxobjsize(void) { int i; - ssize_t ms = -1; + squid_off_t ms = -1; for (i = 0; i < Config.cacheSwap.n_configured; i++) { if (Config.cacheSwap.swapDirs[i].max_objsize > ms) @@ -255,6 +281,8 @@ config_lineno++; if ((token = strchr(config_input_line, '\n'))) *token = '\0'; + if ((token = strchr(config_input_line, '\r'))) + *token = '\0'; if (config_input_line[0] == '#') continue; if (config_input_line[0] == '\0') @@ -271,11 +299,13 @@ } fclose(fp); defaults_if_none(); - configDoConfigure(); - cachemgrRegister("config", - "Current Squid Configuration", - dump_config, - 1, 1); + if (opt_send_signal == -1) { + configDoConfigure(); + cachemgrRegister("config", + "Current Squid Configuration", + dump_config, + 1, 1); + } return err_count; } @@ -439,6 +469,26 @@ debug(22, 0) ("NOTICE: positive_dns_ttl must be larger than negative_dns_ttl. Resetting negative_dns_ttl to match\n"); Config.positiveDnsTtl = Config.negativeDnsTtl; } +#if SIZEOF_SQUID_FILE_SZ <= 4 +#if SIZEOF_SQUID_OFF_T <= 4 + if (Config.Store.maxObjectSize > 0x7FFF0000) { + debug(22, 0) ("NOTICE: maximum_object_size limited to %d KB due to hardware limitations\n", 0x7FFF0000 / 1024); + Config.Store.maxObjectSize = 0x7FFF0000; + } +#elif SIZEOF_OFF_T <= 4 + if (Config.Store.maxObjectSize > 0xFFFF0000) { + debug(22, 0) ("NOTICE: maximum_object_size limited to %d KB due to OS limitations\n", 0xFFFF0000 / 1024); + Config.Store.maxObjectSize = 0xFFFF0000; + } +#else + if (Config.Store.maxObjectSize > 0xFFFF0000) { + debug(22, 0) ("NOTICE: maximum_object_size limited to %d KB to keep compatibility with existing cache\n", 0xFFFF0000 / 1024); + Config.Store.maxObjectSize = 0xFFFF0000; + } +#endif +#endif + if (Config.Store.maxInMemObjSize > 8 * 1024 * 1024) + debug(22, 0) ("WARNING: Very large maximum_object_size_in_memory settings can have negative impact on performance\n"); } /* Parse a time specification from the config file. Store the @@ -492,18 +542,18 @@ } static void -parseBytesLine(size_t * bptr, const char *units) +parseBytesLine(squid_off_t * bptr, const char *units) { char *token; double d; - size_t m; - size_t u; + squid_off_t m; + squid_off_t u; if ((u = parseBytesUnits(units)) == 0) self_destruct(); if ((token = strtok(NULL, w_space)) == NULL) self_destruct(); if (strcmp(token, "none") == 0 || strcmp(token, "-1") == 0) { - *bptr = (size_t) - 1; + *bptr = (squid_off_t) - 1; return; } d = atof(token); @@ -516,7 +566,7 @@ else if ((m = parseBytesUnits(token)) == 0) self_destruct(); *bptr = m * d / u; - if ((double) *bptr != m * d / u) + if ((double) *bptr * 2 != m * d / u * 2) self_destruct(); } @@ -1323,12 +1373,12 @@ static void parse_cachedir_option_maxsize(SwapDir * sd, const char *option, const char *value, int reconfiguring) { - ssize_t size; + squid_off_t size; if (!value) self_destruct(); - size = atoi(value); + size = strto_off_t(value, NULL, 10); if (reconfiguring && sd->max_objsize != size) debug(3, 1) ("Cache dir '%s' max object size now %ld\n", sd->path, (long int) size); @@ -2073,34 +2123,29 @@ *var = 0; } +#if UNUSED_CODE static void -dump_size_t(StoreEntry * entry, const char *name, size_t var) +dump_size_t(StoreEntry * entry, const char *name, squid_off_t var) { - storeAppendPrintf(entry, "%s %d\n", name, (int) var); + storeAppendPrintf(entry, "%s %" PRINTF_OFF_T "\n", name, var); } -static void -dump_b_size_t(StoreEntry * entry, const char *name, size_t var) -{ - storeAppendPrintf(entry, "%s %d %s\n", name, (int) var, B_BYTES_STR); -} +#endif static void -dump_kb_size_t(StoreEntry * entry, const char *name, size_t var) +dump_b_size_t(StoreEntry * entry, const char *name, squid_off_t var) { - storeAppendPrintf(entry, "%s %d %s\n", name, (int) var, B_KBYTES_STR); + storeAppendPrintf(entry, "%s %" PRINTF_OFF_T " %s\n", name, var, B_BYTES_STR); } static void -parse_size_t(size_t * var) +dump_kb_size_t(StoreEntry * entry, const char *name, squid_off_t var) { - int i; - i = GetInteger(); - *var = (size_t) i; + storeAppendPrintf(entry, "%s %" PRINTF_OFF_T " %s\n", name, var, B_KBYTES_STR); } static void -parse_b_size_t(size_t * var) +parse_b_size_t(squid_off_t * var) { parseBytesLine(var, B_BYTES_STR); } @@ -2113,7 +2158,7 @@ body_size *bs; CBDATA_INIT_TYPE(body_size); bs = cbdataAlloc(body_size); - parse_size_t(&bs->maxsize); + bs->maxsize = GetOffT(); aclParseAccessLine(&bs->access_list); dlinkAddTail(bs, &bs->node, bodylist); @@ -2128,7 +2173,7 @@ acl_list *l; acl_access *head = bs->access_list; while (head != NULL) { - storeAppendPrintf(entry, "%s %ld %s", name, (long int) bs->maxsize, + storeAppendPrintf(entry, "%s %" PRINTF_OFF_T " %s", name, bs->maxsize, head->allow ? "Allow" : "Deny"); for (l = head->acl_list; l != NULL; l = l->next) { storeAppendPrintf(entry, " %s%s", @@ -2165,13 +2210,13 @@ static void -parse_kb_size_t(size_t * var) +parse_kb_size_t(squid_off_t * var) { parseBytesLine(var, B_KBYTES_STR); } static void -free_size_t(size_t * var) +free_size_t(squid_off_t * var) { *var = 0; } @@ -2445,6 +2490,8 @@ s->key = xstrdup(token + 4); } else if (strncmp(token, "version=", 8) == 0) { s->version = atoi(token + 8); + if (s->version < 1 || s->version > 4) + self_destruct(); } else if (strncmp(token, "options=", 8) == 0) { safe_free(s->options); s->options = xstrdup(token + 8); diff -ruN squid-2.5.STABLE9/src/cachemgr.c squid-2.5.STABLE10/src/cachemgr.c --- squid-2.5.STABLE9/src/cachemgr.c Sun Nov 10 10:07:44 2002 +++ squid-2.5.STABLE10/src/cachemgr.c Mon Apr 25 22:04:30 2005 @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.c,v 1.90.2.6 2002/11/10 17:07:44 hno Exp $ + * $Id: cachemgr.c,v 1.90.2.11 2005/04/26 04:04:30 hno Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Duane Wessels @@ -125,13 +125,21 @@ #if HAVE_SYS_SELECT_H #include #endif +#if HAVE_FNMATCH_H +#include +#endif #include #include "util.h" #include "snprintf.h" +#ifndef DEFAULT_CACHEMGR_CONFIG +#define DEFAULT_CACHEMGR_CONFIG "/etc/squid/cachemgr.conf" +#endif + typedef struct { + char *server; char *hostname; int port; char *action; @@ -180,6 +188,8 @@ static void reset_auth(cachemgr_request * req); static const char *make_auth_header(const cachemgr_request * req); +static int check_target_acl(const char *hostname, int port); + static const char * safe_str(const char *str) @@ -230,10 +240,12 @@ static void auth_html(const char *host, int port, const char *user_name) { + FILE *fp; + int need_host = 1; if (!user_name) user_name = ""; if (!host || !strlen(host)) - host = "localhost"; + host = ""; printf("Content-Type: text/html\r\n\r\n"); printf("\n"); printf("Cache Manager Interface\n"); @@ -244,10 +256,54 @@ printf("


      \n"); printf("
      \n", script_name); printf("\n"); - printf("\n", host); - printf("\n", port); + fp = fopen("cachemgr.conf", "r"); + if (fp == NULL) + fp = fopen(DEFAULT_CACHEMGR_CONFIG, "r"); + if (fp != NULL) { + int servers = 0; + char config_line[BUFSIZ]; + while (fgets(config_line, BUFSIZ, fp)) { + char *server, *comment; + strtok(config_line, "\r\n"); + if (config_line[0] == '#') + continue; + if (config_line[0] == '\0') + continue; + if ((server = strtok(config_line, " \t")) == NULL) + continue; + if (strchr(server, '*') || strchr(server, '[') || strchr(server, '?')) { + need_host = -1; + continue; + } + comment = strtok(NULL, ""); + if (comment) + while (*comment == ' ' || *comment == '\t') + comment++; + if (!comment || !*comment) + comment = server; + if (!servers) { + printf("\n"); + } + fclose(fp); + } + if (need_host) { + if (need_host == 1 && !*host) + host = "localhost"; + printf("\n", host); + printf("\n", port); + } printf("\n", user_name); printf("
      Cache Host:
      Cache Port:
      Cache Server:
      Cache Host:
      Cache Port:
      Manager name:
      Password:action == NULL) { req->action = xstrdup(""); } - if (!strcmp(req->action, "authenticate")) { + if (strcmp(req->action, "authenticate") == 0) { auth_html(req->hostname, req->port, req->user_name); return 0; } + if (!check_target_acl(req->hostname, req->port)) { + snprintf(buf, 1024, "target %s:%d not allowed in cachemgr.conf\n", req->hostname, req->port); + error_html(buf); + return 1; + } if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) { snprintf(buf, 1024, "socket: %s\n", xstrerror()); error_html(buf); @@ -586,7 +647,6 @@ req = read_request(); return process_request(req); } - static char * read_post_request(void) { @@ -606,7 +666,6 @@ buf[len] = '\0'; return buf; } - static char * read_get_request(void) { @@ -615,7 +674,6 @@ return NULL; return xstrdup(s); } - static cachemgr_request * read_request(void) { @@ -638,7 +696,11 @@ if ((q = strchr(t, '=')) == NULL) continue; *q++ = '\0'; - if (0 == strcasecmp(t, "host") && strlen(q)) + rfc1738_unescape(t); + rfc1738_unescape(q); + if (0 == strcasecmp(t, "server") && strlen(q)) + req->server = xstrdup(q); + else if (0 == strcasecmp(t, "host") && strlen(q)) req->hostname = xstrdup(q); else if (0 == strcasecmp(t, "port") && strlen(q)) req->port = atoi(q); @@ -651,6 +713,12 @@ else if (0 == strcasecmp(t, "operation")) req->action = xstrdup(q); } + if (req->server && !req->hostname) { + char *p; + req->hostname = strtok(req->server, ":"); + if ((p = strtok(NULL, ":"))) + req->port = atoi(p); + } make_pub_auth(req); debug(1) fprintf(stderr, "cmgr: got req: host: '%s' port: %d uname: '%s' passwd: '%s' auth: '%s' oper: '%s'\n", safe_str(req->hostname), req->port, safe_str(req->user_name), safe_str(req->passwd), safe_str(req->pub_auth), safe_str(req->action)); @@ -735,7 +803,7 @@ make_auth_header(const cachemgr_request * req) { static char buf[1024]; - off_t l = 0; + int l = 0; const char *str64; if (!req->passwd) return ""; @@ -750,4 +818,58 @@ l += snprintf(&buf[l], sizeof(buf) - l, "Proxy-Authorization: Basic %s\r\n", str64); return buf; +} + +static int +check_target_acl(const char *hostname, int port) +{ + char config_line[BUFSIZ]; + FILE *fp = NULL; + int ret = 0; + fp = fopen("cachemgr.conf", "r"); + if (fp == NULL) + fp = fopen(DEFAULT_CACHEMGR_CONFIG, "r"); + if (fp == NULL) { +#ifdef CACHEMGR_HOSTNAME_DEFINED + if (strcmp(hostname, CACHEMGR_HOSTNAME) == 0 && port == CACHE_HTTP_PORT) + return 1; +#else + if (strcmp(hostname, "localhost") == 0) + return 1; + if (strcmp(hostname, getfullhostname()) == 0) + return 1; +#endif + return 0; + } + while (fgets(config_line, BUFSIZ, fp)) { + char *token = NULL; + strtok(config_line, " \r\n\t"); + if (config_line[0] == '#') + continue; + if (config_line[0] == '\0') + continue; + if ((token = strtok(config_line, ":")) == NULL) + continue; +#if HAVE_FNMATCH_H + if (fnmatch(token, hostname, 0) != 0) + continue; +#else + if (strcmp(token, hostname) != 0) + continue; +#endif + if ((token = strtok(NULL, ":")) != NULL) { + int i; + if (strcmp(token, "*") == 0); /* Wildcard port specification */ + else if (strcasecmp(token, "any") == 0); /* Wildcard port specification */ + else if (sscanf(token, "%d", &i) != 1) + continue; + else if (i != port) + continue; + } else if (port != CACHE_HTTP_PORT) + continue; + ret = 1; + break; + } + fclose(fp); + return ret; } diff -ruN squid-2.5.STABLE9/src/cachemgr.conf squid-2.5.STABLE10/src/cachemgr.conf --- squid-2.5.STABLE9/src/cachemgr.conf Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE10/src/cachemgr.conf Mon Apr 25 22:04:30 2005 @@ -0,0 +1,13 @@ +# This file controls which servers may be managed by +# the cachemgr.cgi script +# +# The file consists of one server per line on the format +# hostname:port description +# +# Specifying :port is optional. If not specified then +# the default proxy port is assumed. :* or :any matches +# any port on the target server. +# +# hostname is matched using shell filename matching, allowing +# * and other shell wildcards. +localhost diff -ruN squid-2.5.STABLE9/src/cf.data.pre squid-2.5.STABLE10/src/cf.data.pre --- squid-2.5.STABLE9/src/cf.data.pre Tue Feb 22 17:06:34 2005 +++ squid-2.5.STABLE10/src/cf.data.pre Tue May 10 17:08:40 2005 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.245.2.85 2005/02/23 00:06:34 hno Exp $ +# $Id: cf.data.pre,v 1.245.2.94 2005/05/10 23:08:40 hno Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1046,7 +1046,7 @@ DOC_END NAME: ftp_list_width -TYPE: size_t +TYPE: int DEFAULT: 32 LOC: Config.Ftp.list_width DOC_START @@ -1299,12 +1299,18 @@ login credentials if the request is being denied by a proxy_auth type acl. + WARNING: authenitcation can't be used in a transparently intercepting + proxy as the client then thinks it is talking to an origin server and + not the proxy. This is a limitation of bending the TCP/IP protocol to + transparently intercepting port 80, not a limitation in Squid. + === Parameters for the basic scheme follow. === "program" cmdline Specify the command for the external authenticator. Such a program reads a line containing "username password" and replies "OK" or - "ERR" in an endless loop. + "ERR" in an endless loop. "ERR" responses may optionally be followed + by a error description available as %m in the returned error page. By default, the basic authentication sheme is not used unless a program is specified. @@ -1357,6 +1363,8 @@ reads a line containing "username":"realm" and replies with the appropriate H(A1) value base64 encoded or ERR if the user (or his H(A1) hash) does not exists. See rfc 2616 for the definition of H(A1). + "ERR" responses may optionally be followed by a error description + available as %m in the returned error page. By default, the digest authentication scheme is not used unless a program is specified. @@ -2002,13 +2010,22 @@ acl aclname dst ip-address/netmask ... (URL host's IP address) acl aclname myip ip-address/netmask ... (local socket IP address) + acl aclname arp mac-address ... (xx:xx:xx:xx:xx:xx notation) + # The arp ACL requires the special configure option --enable-arp-acl. + # Furthermore, the arp ACL code is not portable to all operating systems. + # It works on Linux, Solaris, FreeBSD and some other *BSD variants. + # + # NOTE: Squid can only determine the MAC address for clients that are on + # the same subnet. If the client is on a different subnet, then Squid cannot + # find out its MAC address. + acl aclname srcdomain .foo.com ... # reverse lookup, client IP acl aclname dstdomain .foo.com ... # Destination server from URL acl aclname srcdom_regex [-i] xxx ... # regex matching client name acl aclname dstdom_regex [-i] xxx ... # regex matching server # For dstdomain and dstdom_regex a reverse lookup is tried if a IP - # based URL is used. The name "none" is used if the reverse lookup - # fails. + # based URL is used and no match is found. The name "none" is used + # if the reverse lookup fails. acl aclname time [day-abbrevs] [h1:m1-h2:m2] day-abbrevs: @@ -2118,6 +2135,7 @@ # external_acl_type directive. Examples: +acl macaddress arp 09:00:2b:23:45:67 acl myexample dst_as 1241 acl password proxy_auth REQUIRED acl fileupload req_mime_type -i ^multipart/form-data$ @@ -2293,7 +2311,7 @@ LOC: Config.accessList.identLookup DOC_START A list of ACL elements which, if matched, cause an ident - (RFC 931) lookup to be performed for this request. For + (RFC931) lookup to be performed for this request. For example, you might choose to always perform ident lookups for your main multi-user Unix boxes, but not for your Macs and PCs. By default, ident lookups are not performed for @@ -2331,10 +2349,13 @@ tcp_outgoing_tos 0x20 good_service_net TOS/DSCP values really only have local significance - so you should - know what you're specifying. For more, see RFC 2474 + know what you're specifying. For more information, see RFC2474 and + RFC3260. - The TOS/DSCP byte must be exactly that - a byte, value 0 - 255, or - "default" to use whatever default your host has. + The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or + "default" to use whatever default your host has. Note that in + practice often only values 0 - 63 is useable as the two highest bits + have been redefined for use by ECN (RFC3168). Processing proceeds in the order specified, and stops at first fully matching line. @@ -3059,8 +3080,9 @@ Usage: always_direct allow|deny [!]aclname ... Here you can use ACL elements to specify requests which should - ALWAYS be forwarded directly to origin servers. For example, - to always directly forward requests for local servers use + ALWAYS be forwarded by Squid to the origin servers without using + any peers. For example, to always directly forward requests for + local servers ignoring any parents or siblings you may have use something like: acl local-servers dstdomain my.domain.net @@ -3082,6 +3104,15 @@ always_direct deny local-external always_direct allow local-servers + NOTE: If your goal is to make the client forward the request + directly to the origin server bypassing Squid then this needs + to be done in the client configuration. Squid configuration + can only tell Squid how Squid should fetch the object. + + NOTE: This directive is not related to caching. The replies + is cached as usual even if you use always_direct. To not cache + the replies see no_cache. + This option replaces some v1.1 options such as local_domain and local_ip. DOC_END @@ -3446,10 +3477,13 @@ LOC: Config.Delay DOC_START This is used to determine which delay pool a request falls into. - The first matched delay pool is always used, i.e., if a request falls - into delay pool number one, no more delay are checked, otherwise the - rest are checked in order of their delay pool number until they have - all been checked. For example, if you want some_big_clients in delay + + delay_access is sorted per pool and the matching starts with pool 1, + then pool 2, ..., and finally pool N. The first delay pool where the + request is allowed is selected for the request. If it does not allow + the request to any pool then the request is not delayed (default). + + For example, if you want some_big_clients in delay pool 1 and lotsa_little_clients in delay pool 2: Example: @@ -3631,7 +3665,7 @@ Some HTTP servers has broken implementations of PUT/POST, and rely on an extra CRLF pair sent by some WWW clients. - Quote from RFC 2068 section 4.1 on this matter: + Quote from RFC2068 section 4.1 on this matter: Note: certain buggy HTTP/1.0 client implementations generate an extra CRLF's after a POST request. To restate what is explicitly diff -ruN squid-2.5.STABLE9/src/client.c squid-2.5.STABLE10/src/client.c --- squid-2.5.STABLE9/src/client.c Tue Feb 17 20:45:30 2004 +++ squid-2.5.STABLE10/src/client.c Wed Mar 30 14:13:55 2005 @@ -1,6 +1,6 @@ /* - * $Id: client.c,v 1.94.2.6 2004/02/18 03:45:30 hno Exp $ + * $Id: client.c,v 1.94.2.8 2005/03/30 21:13:55 hno Exp $ * * DEBUG: section 0 WWW Client * AUTHOR: Harvest Derived @@ -311,7 +311,7 @@ } loops = ping ? pcount : 1; for (i = 0; loops == 0 || i < loops; i++) { - int fsize = 0; + squid_off_t fsize = 0; /* Connect to the server */ if ((conn = socket(PF_INET, SOCK_STREAM, 0)) < 0) { perror("client: socket"); @@ -321,7 +321,7 @@ perror("client: bind"); exit(1); } - if (client_comm_connect(conn, hostname, port, ping ? &tv1 : NULL) < 0) { + if (client_comm_connect(conn, hostname, port, (ping || opt_verbose) ? &tv1 : NULL) < 0) { if (errno == 0) { fprintf(stderr, "client: ERROR: Cannot connect to %s:%d: Host unknown.\n", hostname, port); } else { @@ -365,7 +365,7 @@ if (interrupted) break; - if (ping) { + if (ping || opt_verbose) { struct tm *tmp; time_t t2s; long elapsed_msec; @@ -374,18 +374,19 @@ elapsed_msec = tvSubMsec(tv1, tv2); t2s = tv2.tv_sec; tmp = localtime(&t2s); - fprintf(stderr, "%d-%02d-%02d %02d:%02d:%02d [%d]: %ld.%03ld secs, %f KB/s\n", + fprintf(stderr, "%d-%02d-%02d %02d:%02d:%02d [%d]: %ld.%03ld secs, %f KB/s (%" PRINTF_OFF_T "KB)\n", tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, tmp->tm_hour, tmp->tm_min, tmp->tm_sec, i + 1, elapsed_msec / 1000, elapsed_msec % 1000, - elapsed_msec ? (double) fsize / elapsed_msec : -1.0); + elapsed_msec ? (double) fsize / elapsed_msec * 1000 / 1024 : -1.0, + (fsize + 1023) / 1024); if (i == 0 || elapsed_msec < ping_min) ping_min = elapsed_msec; if (i == 0 || elapsed_msec > ping_max) ping_max = elapsed_msec; ping_sum += elapsed_msec; /* Delay until next "ping_int" boundary */ - if ((loops == 0 || i + 1 < loops) && elapsed_msec < ping_int) { + if (ping && (loops == 0 || i + 1 < loops) && elapsed_msec < ping_int) { struct timeval tvs; long msec_left = ping_int - elapsed_msec; diff -ruN squid-2.5.STABLE9/src/client_db.c squid-2.5.STABLE10/src/client_db.c --- squid-2.5.STABLE9/src/client_db.c Mon Oct 11 14:25:52 2004 +++ squid-2.5.STABLE10/src/client_db.c Fri Mar 25 19:50:52 2005 @@ -1,6 +1,6 @@ /* - * $Id: client_db.c,v 1.53.2.4 2004/10/11 20:25:52 hno Exp $ + * $Id: client_db.c,v 1.53.2.5 2005/03/26 02:50:52 hno Exp $ * * DEBUG: section 0 Client Database * AUTHOR: Duane Wessels @@ -77,7 +77,7 @@ } void -clientdbUpdate(struct in_addr addr, log_type ltype, protocol_t p, size_t size) +clientdbUpdate(struct in_addr addr, log_type ltype, protocol_t p, squid_off_t size) { char *key; ClientInfo *c; diff -ruN squid-2.5.STABLE9/src/client_side.c squid-2.5.STABLE10/src/client_side.c --- squid-2.5.STABLE9/src/client_side.c Sun Feb 20 12:07:45 2005 +++ squid-2.5.STABLE10/src/client_side.c Wed Apr 20 15:46:06 2005 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.561.2.71 2005/02/20 19:07:45 hno Exp $ + * $Id: client_side.c,v 1.561.2.76 2005/04/20 21:46:06 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -125,8 +125,8 @@ static int clientCheckContentLength(request_t * r); static DEFER httpAcceptDefer; static log_type clientProcessRequest2(clientHttpRequest * http); -static int clientReplyBodyTooLarge(clientHttpRequest *, ssize_t clen); -static int clientRequestBodyTooLarge(int clen); +static int clientReplyBodyTooLarge(clientHttpRequest *, squid_off_t clen); +static int clientRequestBodyTooLarge(squid_off_t clen); static void clientProcessBody(ConnStateData * conn); static void clientEatRequestBody(clientHttpRequest *); static BODY_HANDLER clientReadBody; @@ -572,6 +572,7 @@ } } else { /* the client can handle this reply, whatever it is */ + http->flags.hit = 0; http->log_type = LOG_TCP_REFRESH_MISS; if (HTTP_NOT_MODIFIED == mem->reply->sline.status) { httpReplyUpdateOnNotModified(http->old_entry->mem_obj->reply, @@ -602,7 +603,7 @@ int modifiedSince(StoreEntry * entry, request_t * request) { - int object_length; + squid_off_t object_length; MemObject *mem = entry->mem_obj; time_t mod_time = entry->lastmod; debug(33, 3) ("modifiedSince: '%s'\n", storeUrl(entry)); @@ -1224,10 +1225,10 @@ * warning: assumes that HTTP headers for individual ranges at the * time of the actuall assembly will be exactly the same as * the headers when clientMRangeCLen() is called */ -static int +static squid_off_t clientMRangeCLen(clientHttpRequest * http) { - int clen = 0; + squid_off_t clen = 0; HttpHdrRangePos pos = HttpHdrRangeInitPos; const HttpHdrRangeSpec *spec; MemBuf mb; @@ -1246,8 +1247,8 @@ /* account for range content */ clen += spec->length; - debug(33, 6) ("clientMRangeCLen: (clen += %ld + %ld) == %d\n", - (long int) mb.size, (long int) spec->length, clen); + debug(33, 6) ("clientMRangeCLen: (clen += %ld + %" PRINTF_OFF_T ") == %" PRINTF_OFF_T "\n", + (long int) mb.size, spec->length, clen); } /* account for the terminating boundary */ memBufReset(&mb); @@ -1265,7 +1266,6 @@ HttpHeader *hdr = rep ? &rep->header : 0; const char *range_err = NULL; request_t *request = http->request; - int is_hit = isTcpHit(http->log_type); assert(request->range); /* check if we still want to do ranges */ if (!rep) @@ -1286,7 +1286,7 @@ range_err = "too complex range header"; else if (!request->flags.cachable) /* from we_do_ranges in http.c */ range_err = "non-cachable request"; - else if (!is_hit && httpHdrRangeOffsetLimit(http->request->range)) + else if (!http->flags.hit && httpHdrRangeOffsetLimit(http->request->range)) range_err = "range outside range_offset_limit"; /* get rid of our range specs on error */ if (range_err) { @@ -1295,9 +1295,9 @@ http->request->range = NULL; } else { const int spec_count = http->request->range->specs.count; - int actual_clen = -1; + squid_off_t actual_clen = -1; - debug(33, 3) ("clientBuildRangeHeader: range spec count: %d virgin clen: %d\n", + debug(33, 3) ("clientBuildRangeHeader: range spec count: %d virgin clen: %" PRINTF_OFF_T "\n", spec_count, rep->content_length); assert(spec_count > 0); /* ETags should not be returned with Partial Content replies? */ @@ -1329,8 +1329,8 @@ /* replace Content-Length header */ assert(actual_clen >= 0); httpHeaderDelById(hdr, HDR_CONTENT_LENGTH); - httpHeaderPutInt(hdr, HDR_CONTENT_LENGTH, actual_clen); - debug(33, 3) ("clientBuildRangeHeader: actual content length: %d\n", actual_clen); + httpHeaderPutSize(hdr, HDR_CONTENT_LENGTH, actual_clen); + debug(33, 3) ("clientBuildRangeHeader: actual content length: %" PRINTF_OFF_T "\n", actual_clen); } } @@ -1343,7 +1343,6 @@ clientBuildReplyHeader(clientHttpRequest * http, HttpReply * rep) { HttpHeader *hdr = &rep->header; - int is_hit = isTcpHit(http->log_type); request_t *request = http->request; #if DONT_FILTER_THESE /* but you might want to if you run Squid as an HTTP accelerator */ @@ -1354,7 +1353,7 @@ /* here: Keep-Alive is a field-name, not a connection directive! */ httpHeaderDelByName(hdr, "Keep-Alive"); /* remove Set-Cookie if a hit */ - if (is_hit) + if (http->flags.hit) httpHeaderDelById(hdr, HDR_SET_COOKIE); /* handle Connection header */ if (httpHeaderHas(hdr, HDR_CONNECTION)) { @@ -1383,7 +1382,7 @@ /* * Add a estimated Age header on cache hits. */ - if (is_hit) { + if (http->flags.hit) { /* * Remove any existing Age header sent by upstream caches * (note that the existing header is passed along unmodified @@ -1431,7 +1430,7 @@ authenticateFixHeader(rep, request->auth_user_request, request, http->flags.accel, 0); /* Append X-Cache */ httpHeaderPutStrf(hdr, HDR_X_CACHE, "%s from %s", - is_hit ? "HIT" : "MISS", getMyHostname()); + http->flags.hit ? "HIT" : "MISS", getMyHostname()); #if USE_CACHE_DIGESTS /* Append X-Cache-Lookup: -- temporary hack, to be removed @?@ @?@ */ httpHeaderPutStrf(hdr, HDR_X_CACHE_LOOKUP, "%s from %s:%d", @@ -1505,6 +1504,7 @@ MemObject *mem; request_t *r = http->request; debug(33, 3) ("clientCacheHit: %s, %d bytes\n", http->uri, (int) size); + http->flags.hit = 0; if (http->entry == NULL) { memFree(buf, MEM_CLIENT_SOCK_BUF); debug(33, 3) ("clientCacheHit: request aborted\n"); @@ -1592,7 +1592,12 @@ clientPurgeRequest(http); return; } - if (checkNegativeHit(e)) { + http->flags.hit = 1; + if (checkNegativeHit(e) +#if HTTP_VIOLATIONS + && !r->flags.nocache_hack +#endif + ) { http->log_type = LOG_TCP_NEGATIVE_HIT; clientSendMoreData(data, buf, size); } else if (!Config.onoff.offline && refreshCheckHTTP(e, r) && !http->flags.internal) { @@ -1729,11 +1734,11 @@ clientPackRange(clientHttpRequest * http, HttpHdrRangeIter * i, const char **buf, - ssize_t * size, + size_t * size, MemBuf * mb) { - const ssize_t copy_sz = i->debt_size <= *size ? i->debt_size : *size; - off_t body_off = http->out.offset - i->prefix_size; + const size_t copy_sz = i->debt_size <= *size ? i->debt_size : *size; + squid_off_t body_off = http->out.offset - i->prefix_size; assert(*size > 0); assert(i->spec); /* @@ -1777,7 +1782,7 @@ * increments iterator "i" * used by clientPackMoreRanges */ static int -clientCanPackMoreRanges(const clientHttpRequest * http, HttpHdrRangeIter * i, ssize_t size) +clientCanPackMoreRanges(const clientHttpRequest * http, HttpHdrRangeIter * i, size_t size) { /* first update "i" if needed */ if (!i->debt_size) { @@ -1792,17 +1797,17 @@ /* extracts "ranges" from buf and appends them to mb, updating all offsets and such */ /* returns true if we need more data */ static int -clientPackMoreRanges(clientHttpRequest * http, const char *buf, ssize_t size, MemBuf * mb) +clientPackMoreRanges(clientHttpRequest * http, const char *buf, size_t size, MemBuf * mb) { HttpHdrRangeIter *i = &http->range_iter; /* offset in range specs does not count the prefix of an http msg */ - off_t body_off = http->out.offset - i->prefix_size; + squid_off_t body_off = http->out.offset - i->prefix_size; assert(size >= 0); /* check: reply was parsed and range iterator was initialized */ assert(i->prefix_size > 0); /* filter out data according to range specs */ while (clientCanPackMoreRanges(http, i, size)) { - off_t start; /* offset of still missing data */ + squid_off_t start; /* offset of still missing data */ assert(i->spec); start = i->spec->offset + i->spec->length - i->debt_size; debug(33, 3) ("clientPackMoreRanges: in: offset: %ld size: %ld\n", @@ -1876,7 +1881,7 @@ } static int -clientReplyBodyTooLarge(clientHttpRequest * http, ssize_t clen) +clientReplyBodyTooLarge(clientHttpRequest * http, squid_off_t clen) { if (0 == http->maxBodySize) return 0; /* disabled */ @@ -1888,7 +1893,7 @@ } static int -clientRequestBodyTooLarge(int clen) +clientRequestBodyTooLarge(squid_off_t clen) { if (0 == Config.maxRequestBodySize) return 0; /* disabled */ @@ -1939,9 +1944,9 @@ int fd = conn->fd; HttpReply *rep = NULL; const char *body_buf = buf; - ssize_t body_size = size; + squid_off_t body_size = size; MemBuf mb; - ssize_t check_size = 0; + squid_off_t check_size = 0; debug(33, 5) ("clientSendMoreData: %s, %d bytes\n", http->uri, (int) size); assert(size <= CLIENT_SOCK_SZ); assert(http->request != NULL); @@ -2184,14 +2189,14 @@ StoreEntry *entry = http->entry; int done; http->out.size += size; - debug(33, 5) ("clientWriteComplete: FD %d, sz %ld, err %d, off %ld, len %d\n", - fd, (long int) size, errflag, (long int) http->out.offset, entry ? objectLen(entry) : 0); + debug(33, 5) ("clientWriteComplete: FD %d, sz %d, err %d, off %" PRINTF_OFF_T ", len %" PRINTF_OFF_T "\n", + fd, (int) size, errflag, http->out.offset, entry ? objectLen(entry) : (squid_off_t) 0); if (size > 0) { kb_incr(&statCounter.client_http.kbytes_out, size); if (isTcpHit(http->log_type)) kb_incr(&statCounter.client_http.hit_kbytes_out, size); } -#if SIZEOF_SIZE_T == 4 +#if SIZEOF_SQUID_OFF_T <= 4 if (http->out.size > 0x7FFF0000) { debug(33, 1) ("WARNING: closing FD %d to prevent counter overflow\n", fd); debug(33, 1) ("\tclient %s\n", inet_ntoa(http->conn->peer.sin_addr)); @@ -2200,7 +2205,7 @@ comm_close(fd); } else #endif -#if SIZEOF_OFF_T == 4 +#if SIZEOF_SQUID_OFF_T <= 4 if (http->out.offset > 0x7FFF0000) { debug(33, 1) ("WARNING: closing FD %d to prevent counter overflow\n", fd); debug(33, 1) ("\tclient %s\n", inet_ntoa(http->conn->peer.sin_addr)); @@ -2276,6 +2281,7 @@ char *url = http->uri; request_t *r = http->request; ErrorState *err = NULL; + http->flags.hit = 0; debug(33, 4) ("clientProcessOnlyIfCachedMiss: '%s %s'\n", RequestMethodStr[r->method], url); http->al.http.code = HTTP_GATEWAY_TIMEOUT; @@ -2589,7 +2595,7 @@ static int pffd = -1; #endif #if LINUX_NETFILTER - size_t sock_sz = sizeof(conn->me); + socklen_t sock_sz = sizeof(conn->me); #endif /* pre-set these values to make aborting simpler */ @@ -2722,51 +2728,8 @@ } /* see if we running in Config2.Accel.on, if so got to convert it to URL */ else if (Config2.Accel.on && *url == '/') { - /* prepend the accel prefix */ - if (Config.onoff.accel_uses_host_header && (t = mime_get_header(req_hdr, "Host"))) { - int vport; - char *q; - const char *protocol_name = "http"; - if (vport_mode) - vport = (int) ntohs(http->conn->me.sin_port); - else - vport = (int) Config.Accel.port; - /* If a Host: header was specified, use it to build the URL - * instead of the one in the Config file. */ - /* - * XXX Use of the Host: header here opens a potential - * security hole. There are no checks that the Host: value - * corresponds to one of your servers. It might, for example, - * refer to www.playboy.com. The 'dst' and/or 'dst_domain' ACL - * types should be used to prevent httpd-accelerators - * handling requests for non-local servers */ - strtok(t, " /;@"); - if ((q = strchr(t, ':'))) { - *q++ = '\0'; - if (vport_mode) - vport = atoi(q); - } - url_sz = strlen(url) + 32 + Config.appendDomainLen + - strlen(t); - http->uri = xcalloc(url_sz, 1); - -#if SSL_FORWARDING_NOT_YET_DONE - if (Config.Sockaddr.https->s.sin_port == http->conn->me.sin_port) { - protocol_name = "https"; - vport = ntohs(http->conn->me.sin_port); - } -#endif - snprintf(http->uri, url_sz, "%s://%s:%d%s", - protocol_name, t, vport, url); - } else if (vhost_mode) { - int vport; - /* Put the local socket IP address as the hostname */ - url_sz = strlen(url) + 32 + Config.appendDomainLen; - http->uri = xcalloc(url_sz, 1); - if (vport_mode) - vport = (int) ntohs(http->conn->me.sin_port); - else - vport = (int) Config.Accel.port; + int vport; + if (vhost_mode) { #if IPF_TRANSPARENT natLookup.nl_inport = http->conn->me.sin_port; natLookup.nl_outport = http->conn->peer.sin_port; @@ -2776,7 +2739,11 @@ if (natfd < 0) { int save_errno; enter_suid(); +#ifdef IPL_NAME + natfd = open(IPL_NAME, O_RDONLY, 0); +#else natfd = open(IPL_NAT, O_RDONLY, 0); +#endif save_errno = errno; leave_suid(); errno = save_errno; @@ -2788,41 +2755,34 @@ xfree(http->uri); cbdataFree(http); xfree(inbuf); - return parseHttpRequestAbort(conn, "error:nat-open-failed"); - } - /* - * IP-Filter changed the type for SIOCGNATL between - * 3.3 and 3.4. It also changed the cmd value for - * SIOCGNATL, so at least we can detect it. We could - * put something in configure and use ifdefs here, but - * this seems simpler. - */ - if (63 == siocgnatl_cmd) { - struct natlookup *nlp = &natLookup; - x = ioctl(natfd, SIOCGNATL, &nlp); - } else { - x = ioctl(natfd, SIOCGNATL, &natLookup); - } - if (x < 0) { - if (errno != ESRCH) { - debug(50, 1) ("parseHttpRequest: NAT lookup failed: ioctl(SIOCGNATL)\n"); - close(natfd); - natfd = -1; - dlinkDelete(&http->active, &ClientActiveRequests); - xfree(http->uri); - cbdataFree(http); - xfree(inbuf); - return parseHttpRequestAbort(conn, "error:nat-lookup-failed"); - } else - snprintf(http->uri, url_sz, "http://%s:%d%s", - inet_ntoa(http->conn->me.sin_addr), - vport, url); } else { - if (vport_mode) - vport = ntohs(natLookup.nl_realport); - snprintf(http->uri, url_sz, "http://%s:%d%s", - inet_ntoa(natLookup.nl_realip), - vport, url); + /* + * IP-Filter changed the type for SIOCGNATL between + * 3.3 and 3.4. It also changed the cmd value for + * SIOCGNATL, so at least we can detect it. We could + * put something in configure and use ifdefs here, but + * this seems simpler. + */ + if (63 == siocgnatl_cmd) { + struct natlookup *nlp = &natLookup; + x = ioctl(natfd, SIOCGNATL, &nlp); + } else { + x = ioctl(natfd, SIOCGNATL, &natLookup); + } + if (x < 0) { + if (errno != ESRCH) { + debug(50, 1) ("parseHttpRequest: NAT lookup failed: ioctl(SIOCGNATL)\n"); + close(natfd); + natfd = -1; + dlinkDelete(&http->active, &ClientActiveRequests); + xfree(http->uri); + cbdataFree(http); + xfree(inbuf); + } + } else { + conn->me.sin_port = natLookup.nl_realport; + http->conn->me.sin_addr = natLookup.nl_realip; + } } #elif PF_TRANSPARENT if (pffd < 0) @@ -2845,32 +2805,61 @@ debug(50, 1) ("parseHttpRequest: PF lookup failed: ioctl(DIOCNATLOOK)\n"); close(pffd); pffd = -1; - return parseHttpRequestAbort(conn, "error:pf-lookup-failed"); - } else - snprintf(http->uri, url_sz, "http://%s:%d%s", - inet_ntoa(http->conn->me.sin_addr), - vport, url); - } else - snprintf(http->uri, url_sz, "http://%s:%d%s", - inet_ntoa(nl.rdaddr.v4), - ntohs(nl.rdport), url); -#else -#if LINUX_NETFILTER + } + } else { + conn->me.sin_port = nl.rdport; + http->conn->me.sin_addr = nl.rdaddr.v4; + } +#elif LINUX_NETFILTER /* If the call fails the address structure will be unchanged */ getsockopt(conn->fd, SOL_IP, SO_ORIGINAL_DST, &conn->me, &sock_sz); - debug(33, 5) ("parseHttpRequest: addr = %s", inet_ntoa(conn->me.sin_addr)); - if (vport_mode) - vport = (int) ntohs(http->conn->me.sin_port); #endif + } + if (vport_mode) + vport = (int) ntohs(http->conn->me.sin_port); + else + vport = (int) Config.Accel.port; + /* prepend the accel prefix */ + if (Config.onoff.accel_uses_host_header && (t = mime_get_header(req_hdr, "Host"))) { + char *q; + const char *protocol_name = "http"; + /* If a Host: header was specified, use it to build the URL + * instead of the one in the Config file. */ + /* + * XXX Use of the Host: header here opens a potential + * security hole. There are no checks that the Host: value + * corresponds to one of your servers. It might, for example, + * refer to www.playboy.com. The 'dst' and/or 'dst_domain' ACL + * types should be used to prevent httpd-accelerators + * handling requests for non-local servers */ + strtok(t, " /;@"); + if ((q = strchr(t, ':'))) { + *q++ = '\0'; + if (vport_mode) + vport = atoi(q); + } + url_sz = strlen(url) + 32 + Config.appendDomainLen + + strlen(t); + http->uri = xcalloc(url_sz, 1); + +#if SSL_FORWARDING_NOT_YET_DONE + if (Config.Sockaddr.https->s.sin_port == http->conn->me.sin_port) { + protocol_name = "https"; + vport = ntohs(http->conn->me.sin_port); + } +#endif + snprintf(http->uri, url_sz, "%s://%s:%d%s", + protocol_name, t, vport, url); + } else if (vhost_mode) { + /* Put the local socket IP address as the hostname */ + url_sz = strlen(url) + 32 + Config.appendDomainLen; + http->uri = xcalloc(url_sz, 1); snprintf(http->uri, url_sz, "http://%s:%d%s", inet_ntoa(http->conn->me.sin_addr), vport, url); -#endif debug(33, 5) ("VHOST REWRITE: '%s'\n", http->uri); } else if (vport_mode) { - int vport; const char *protocol_name = "http"; - vport = (int) ntohs(http->conn->me.sin_port); url_sz = strlen(url) + 32 + Config.appendDomainLen + strlen(Config.Accel.host); http->uri = xcalloc(url_sz, 1); @@ -3124,7 +3113,7 @@ /* * cache the Content-length value in request_t. */ - request->content_length = httpHeaderGetInt(&request->header, + request->content_length = httpHeaderGetSize(&request->header, HDR_CONTENT_LENGTH); request->flags.internal = http->flags.internal; safe_free(prefix); @@ -3636,7 +3625,7 @@ StoreEntry *entry = http->entry; MemObject *mem; http_reply *reply; - int sendlen; + squid_off_t sendlen; if (entry == NULL) return 0; /* @@ -3699,7 +3688,7 @@ static int clientGotNotEnough(clientHttpRequest * http) { - int cl = httpReplyBodySize(http->request->method, http->entry->mem_obj->reply); + squid_off_t cl = httpReplyBodySize(http->request->method, http->entry->mem_obj->reply); int hs = http->entry->mem_obj->reply->hdr_sz; assert(cl >= 0); if (http->out.offset < cl + hs) diff -ruN squid-2.5.STABLE9/src/debug.c squid-2.5.STABLE10/src/debug.c --- squid-2.5.STABLE9/src/debug.c Mon Dec 17 11:01:54 2001 +++ squid-2.5.STABLE10/src/debug.c Tue Apr 5 17:02:08 2005 @@ -1,6 +1,6 @@ /* - * $Id: debug.c,v 1.84 2001/12/17 18:01:54 wessels Exp $ + * $Id: debug.c,v 1.84.2.1 2005/04/05 23:02:08 hno Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -40,6 +40,9 @@ static const char *debugLogTime(time_t); static void ctx_print(void); #if HAVE_SYSLOG +#ifdef LOG_LOCAL4 +static int syslog_facility = 0; +#endif static void _db_print_syslog(const char *format, va_list args); #endif static void _db_print_stderr(const char *format, va_list args); @@ -182,6 +185,148 @@ #endif } +#if HAVE_SYSLOG +#ifdef LOG_LOCAL4 +static struct syslog_facility_name { + const char *name; + int facility; +} syslog_facility_names[] = { + +#ifdef LOG_AUTH + { + "auth", LOG_AUTH + }, +#endif +#ifdef LOG_AUTHPRIV + { + "authpriv", LOG_AUTHPRIV + }, +#endif +#ifdef LOG_CRON + { + "cron", LOG_CRON + }, +#endif +#ifdef LOG_DAEMON + { + "daemon", LOG_DAEMON + }, +#endif +#ifdef LOG_FTP + { + "ftp", LOG_FTP + }, +#endif +#ifdef LOG_KERN + { + "kern", LOG_KERN + }, +#endif +#ifdef LOG_LPR + { + "lpr", LOG_LPR + }, +#endif +#ifdef LOG_MAIL + { + "mail", LOG_MAIL + }, +#endif +#ifdef LOG_NEWS + { + "news", LOG_NEWS + }, +#endif +#ifdef LOG_SYSLOG + { + "syslog", LOG_SYSLOG + }, +#endif +#ifdef LOG_USER + { + "user", LOG_USER + }, +#endif +#ifdef LOG_UUCP + { + "uucp", LOG_UUCP + }, +#endif +#ifdef LOG_LOCAL0 + { + "local0", LOG_LOCAL0 + }, +#endif +#ifdef LOG_LOCAL1 + { + "local1", LOG_LOCAL1 + }, +#endif +#ifdef LOG_LOCAL2 + { + "local2", LOG_LOCAL2 + }, +#endif +#ifdef LOG_LOCAL3 + { + "local3", LOG_LOCAL3 + }, +#endif +#ifdef LOG_LOCAL4 + { + "local4", LOG_LOCAL4 + }, +#endif +#ifdef LOG_LOCAL5 + { + "local5", LOG_LOCAL5 + }, +#endif +#ifdef LOG_LOCAL6 + { + "local6", LOG_LOCAL6 + }, +#endif +#ifdef LOG_LOCAL7 + { + "local7", LOG_LOCAL7 + }, +#endif + { + NULL, 0 + } +}; + +#endif + +void +_db_set_syslog(const char *facility) +{ + opt_syslog_enable = 1; +#ifdef LOG_LOCAL4 +#ifdef LOG_DAEMON + syslog_facility = LOG_DAEMON; +#else + syslog_facility = LOG_LOCAL4; +#endif + if (facility) { + struct syslog_facility_name *n; + for (n = syslog_facility_names; n->name; n++) { + if (strcmp(n->name, facility) == 0) { + syslog_facility = n->facility; + return; + } + } + fprintf(stderr, "unknown syslog facility '%s'\n", facility); + exit(1); + } +#else + if (facility) + fprintf(stderr, "syslog facility type not supported on your system\n"); +#endif +} +#endif + void _db_init(const char *logfile, const char *options) { @@ -202,7 +347,7 @@ #if HAVE_SYSLOG && defined(LOG_LOCAL4) if (opt_syslog_enable) - openlog(appname, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); + openlog(appname, LOG_PID | LOG_NDELAY | LOG_CONS, syslog_facility); #endif /* HAVE_SYSLOG */ } diff -ruN squid-2.5.STABLE9/src/defines.h squid-2.5.STABLE10/src/defines.h --- squid-2.5.STABLE9/src/defines.h Thu Aug 8 14:17:39 2002 +++ squid-2.5.STABLE10/src/defines.h Fri Mar 25 19:50:52 2005 @@ -1,6 +1,6 @@ /* - * $Id: defines.h,v 1.97.2.3 2002/08/08 20:17:39 hno Exp $ + * $Id: defines.h,v 1.97.2.4 2005/03/26 02:50:52 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -200,7 +200,8 @@ #define SwapMetaType(x) (char)x[0] #define SwapMetaSize(x) &x[sizeof(char)] #define SwapMetaData(x) &x[STORE_META_TLD_START] -#define STORE_HDR_METASIZE (4*sizeof(time_t)+2*sizeof(u_short)+sizeof(size_t)) +#define STORE_HDR_METASIZE (4*sizeof(time_t)+2*sizeof(u_short)+sizeof(squid_file_sz)) +#define STORE_HDR_METASIZE_OLD (4*sizeof(time_t)+2*sizeof(u_short)+sizeof(size_t)) #define STORE_ENTRY_WITH_MEMOBJ 1 #define STORE_ENTRY_WITHOUT_MEMOBJ 0 diff -ruN squid-2.5.STABLE9/src/disk.c squid-2.5.STABLE10/src/disk.c --- squid-2.5.STABLE9/src/disk.c Sat Nov 6 14:37:12 2004 +++ squid-2.5.STABLE10/src/disk.c Sat Mar 26 16:27:10 2005 @@ -1,6 +1,6 @@ /* - * $Id: disk.c,v 1.157.2.2 2004/11/06 21:37:12 hno Exp $ + * $Id: disk.c,v 1.157.2.6 2005/03/26 23:27:10 serassio Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -91,7 +91,7 @@ read_callback(-1, F->read_data); } if (F->flags.write_daemon) { -#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_) /* * on some operating systems, you can not delete or rename * open files, so we won't allow delayed close. @@ -239,7 +239,7 @@ q->buf_offset += len; if (q->buf_offset > q->len) debug(50, 1) ("diskHandleWriteComplete: q->buf_offset > q->len (%p,%d, %d, %d FD %d)\n", - q, (int) q->buf_offset, q->len, len, fd); + q, (int) q->buf_offset, (int) q->len, len, fd); assert(q->buf_offset <= q->len); if (q->buf_offset == q->len) { /* complete write */ @@ -293,7 +293,7 @@ file_write(int fd, off_t file_offset, void *ptr_to_buf, - int len, + size_t len, DWCB * handle, void *handle_data, FREE * free_func) @@ -331,9 +331,9 @@ * in a snap */ void -file_write_mbuf(int fd, off_t off, MemBuf mb, DWCB * handler, void *handler_data) +file_write_mbuf(int fd, off_t file_offset, MemBuf mb, DWCB * handler, void *handler_data) { - file_write(fd, off, mb.buf, mb.size, handler, handler_data, memBufFreeFunc(&mb)); + file_write(fd, file_offset, mb.buf, mb.size, handler, handler_data, memBufFreeFunc(&mb)); } /* Read from FD */ @@ -352,12 +352,12 @@ memFree(ctrl_dat, MEM_DREAD_CTRL); return; } - if (F->disk.offset != ctrl_dat->offset) { + if (F->disk.offset != ctrl_dat->file_offset) { debug(6, 3) ("diskHandleRead: FD %d seeking to offset %d\n", - fd, (int) ctrl_dat->offset); - lseek(fd, ctrl_dat->offset, SEEK_SET); /* XXX ignore return? */ + fd, (int) ctrl_dat->file_offset); + lseek(fd, ctrl_dat->file_offset, SEEK_SET); /* XXX ignore return? */ statCounter.syscalls.disk.seeks++; - F->disk.offset = ctrl_dat->offset; + F->disk.offset = ctrl_dat->file_offset; } errno = 0; len = FD_READ_METHOD(fd, ctrl_dat->buf, ctrl_dat->req_len); @@ -388,13 +388,13 @@ * It must have at least req_len space in there. * call handler when a reading is complete. */ void -file_read(int fd, char *buf, int req_len, off_t offset, DRCB * handler, void *client_data) +file_read(int fd, char *buf, size_t req_len, off_t file_offset, DRCB * handler, void *client_data) { dread_ctrl *ctrl_dat; assert(fd >= 0); ctrl_dat = memAllocate(MEM_DREAD_CTRL); ctrl_dat->fd = fd; - ctrl_dat->offset = offset; + ctrl_dat->file_offset = file_offset; ctrl_dat->req_len = req_len; ctrl_dat->buf = buf; ctrl_dat->end_of_file = 0; diff -ruN squid-2.5.STABLE9/src/dns_internal.c squid-2.5.STABLE10/src/dns_internal.c --- squid-2.5.STABLE9/src/dns_internal.c Thu Jul 29 07:26:20 2004 +++ squid-2.5.STABLE10/src/dns_internal.c Wed May 11 13:18:47 2005 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.c,v 1.45.2.5 2004/07/29 13:26:20 hno Exp $ + * $Id: dns_internal.c,v 1.45.2.9 2005/05/11 19:18:47 hno Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -55,7 +55,7 @@ struct _idns_query { hash_link hash; - char query[RFC1035_MAXHOSTNAMESZ + 1]; + rfc1035_query query; char buf[512]; size_t sz; unsigned short id; @@ -280,8 +280,7 @@ t, &Size); token = strtok((char *) t, ", "); while (token) { - debug(78, - 1) ("Adding nameserver %s from Registry\n", + debug(78, 1) ("Adding nameserver %s from Registry\n", token); idnsAddNameserver(token); token = strtok(NULL, ", "); @@ -443,6 +442,25 @@ return NULL; } +static unsigned short +idnsQueryID(void) +{ + unsigned short id = squid_random() & 0xFFFF; + unsigned short first_id = id; + + while (idnsFindQuery(id)) { + id++; + + if (id == first_id) { + debug(78, 1) ("idnsQueryID: Warning, too many pending DNS requests\n"); + break; + } + } + + return id; +} + + static void idnsCallback(idns_query * q, rfc1035_rr * answers, int n, const char *error) { @@ -470,30 +488,34 @@ idnsGrokReply(const char *buf, size_t sz) { int n; - rfc1035_rr *answers = NULL; - unsigned short rid = 0xFFFF; + rfc1035_message *message = NULL; idns_query *q; - n = rfc1035AnswersUnpack(buf, + n = rfc1035MessageUnpack(buf, sz, - &answers, - &rid); - debug(78, 3) ("idnsGrokReply: ID %#hx, %d answers\n", rid, n); - if (rid == 0xFFFF) { - debug(78, 1) ("idnsGrokReply: Unknown error\n"); - /* XXX leak answers? */ + &message); + if (message == NULL) { + debug(78, 2) ("idnsGrokReply: Malformed DNS response\n"); return; } - q = idnsFindQuery(rid); + debug(78, 3) ("idnsGrokReply: ID %#hx, %d answers\n", message->id, n); + + q = idnsFindQuery(message->id); + if (q == NULL) { debug(78, 3) ("idnsGrokReply: Late response\n"); - rfc1035RRDestroy(answers, n); + rfc1035MessageDestroy(message); + return; + } + if (rfc1035QueryCompare(&q->query, message->query) != 0) { + debug(78, 3) ("idnsGrokReply: Query mismatch (%s != %s)\n", q->query.name, message->query->name); + rfc1035MessageDestroy(message); return; } dlinkDelete(&q->lru, &lru_list); idnsRcodeCount(n, q->attempt); q->error = NULL; if (n < 0) { - debug(78, 3) ("idnsGrokReply: error %d\n", rfc1035_errno); + debug(78, 3) ("idnsGrokReply: error %s (%d)\n", rfc1035_error_message, rfc1035_errno); q->error = rfc1035_error_message; q->rcode = -n; if (q->rcode == 2 && ++q->attempt < MAX_ATTEMPT) { @@ -502,15 +524,17 @@ * unable to process this query due to a problem with * the name server." */ - assert(NULL == answers); + rfc1035MessageDestroy(message); q->start_t = current_time; - q->id = rfc1035RetryQuery(q->buf); + q->id = idnsQueryID(); + rfc1035SetQueryID(q->buf, q->id); idnsSendQuery(q); return; } } - idnsCallback(q, answers, n, q->error); - rfc1035RRDestroy(answers, n); + idnsCallback(q, message->answer, n, q->error); + rfc1035MessageDestroy(message); + memFree(q, MEM_IDNS_QUERY); } @@ -528,7 +552,7 @@ from_len = sizeof(from); memset(&from, '\0', from_len); statCounter.syscalls.sock.recvfroms++; - len = recvfrom(fd, rbuf, 512, 0, (struct sockaddr *) &from, &from_len); + len = recvfrom(fd, rbuf, sizeof(rbuf), 0, (struct sockaddr *) &from, &from_len); if (len == 0) break; if (len < 0) { @@ -564,23 +588,6 @@ } continue; } - if (len > 512) { - /* - * Check for non-conforming replies. RFC 1035 says - * DNS/UDP messages must be 512 octets or less. If we - * get one that is too large, we generate a warning - * and then pretend that we only got 512 octets. This - * should prevent the rfc1035.c code from reading past - * the end of our buffer. - */ - static int other_large_pkts = 0; - int x; - x = (ns < 0) ? ++other_large_pkts : ++nameservers[ns].large_pkts; - if (isPowTen(x)) - debug(78, 1) ("WARNING: Got %d large DNS replies from %s\n", - x, inet_ntoa(from.sin_addr)); - len = 512; - } idnsGrokReply(rbuf, len); } if (lru_list.head) @@ -682,7 +689,7 @@ #else debug(78, 1) ("Please check your /etc/resolv.conf file\n"); #endif - debug(78, 1) ("or use the 'dns_nameservers' option in squid.conf."); + debug(78, 1) ("or use the 'dns_nameservers' option in squid.conf.\n"); idnsAddNameserver("127.0.0.1"); } if (!init) { @@ -723,10 +730,9 @@ } static void -idnsCacheQuery(idns_query * q, const char *key) +idnsCacheQuery(idns_query * q) { - xstrncpy(q->query, key, sizeof(q->query)); - q->hash.key = q->query; + q->hash.key = q->query.name; hash_join(idns_lookup_hash, &q->hash); } @@ -737,9 +743,9 @@ if (idnsCachedLookup(name, callback, data)) return; q = memAllocate(MEM_IDNS_QUERY); - q->sz = sizeof(q->buf); - q->id = rfc1035BuildAQuery(name, q->buf, &q->sz); - if (0 == q->id) { + q->id = idnsQueryID(); + q->sz = rfc1035BuildAQuery(name, q->buf, sizeof(q->buf), q->id, &q->query); + if (q->sz < 0) { /* problem with query data -- query not sent */ callback(data, NULL, 0, "Internal error"); memFree(q, MEM_IDNS_QUERY); @@ -751,7 +757,7 @@ q->callback_data = data; cbdataLock(q->callback_data); q->start_t = current_time; - idnsCacheQuery(q, name); + idnsCacheQuery(q); idnsSendQuery(q); } @@ -763,15 +769,21 @@ if (idnsCachedLookup(ip, callback, data)) return; q = memAllocate(MEM_IDNS_QUERY); - q->sz = sizeof(q->buf); - q->id = rfc1035BuildPTRQuery(addr, q->buf, &q->sz); + q->id = idnsQueryID(); + q->sz = rfc1035BuildPTRQuery(addr, q->buf, sizeof(q->buf), q->id, &q->query); debug(78, 3) ("idnsPTRLookup: buf is %d bytes for %s, id = %#hx\n", (int) q->sz, ip, q->id); + if (q->sz < 0) { + /* problem with query data -- query not sent */ + callback(data, NULL, 0, "Internal error"); + memFree(q, MEM_IDNS_QUERY); + return; + } q->callback = callback; q->callback_data = data; cbdataLock(q->callback_data); q->start_t = current_time; - idnsCacheQuery(q, ip); + idnsCacheQuery(q); idnsSendQuery(q); } diff -ruN squid-2.5.STABLE9/src/enums.h squid-2.5.STABLE10/src/enums.h --- squid-2.5.STABLE9/src/enums.h Mon Jan 17 15:13:04 2005 +++ squid-2.5.STABLE10/src/enums.h Fri Mar 25 19:50:52 2005 @@ -1,6 +1,6 @@ /* - * $Id: enums.h,v 1.203.2.14 2005/01/17 22:13:04 hno Exp $ + * $Id: enums.h,v 1.203.2.15 2005/03/26 02:50:52 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -274,7 +274,8 @@ ftPCc, ftPContRange, ftPRange, - ftDate_1123_or_ETag + ftDate_1123_or_ETag, + ftSize } field_type; /* possible owners of http header */ @@ -623,6 +624,7 @@ STORE_META_HITMETERING, /* reserved for hit metering */ STORE_META_VALID, STORE_META_VARY_HEADERS, /* Stores Vary request headers */ + STORE_META_STD_LFS, /* standard metadata in lfs format */ STORE_META_END }; @@ -638,6 +640,7 @@ SWAP_LOG_NOP, SWAP_LOG_ADD, SWAP_LOG_DEL, + SWAP_LOG_VERSION, SWAP_LOG_MAX } swap_log_op; diff -ruN squid-2.5.STABLE9/src/errorpage.c squid-2.5.STABLE10/src/errorpage.c --- squid-2.5.STABLE9/src/errorpage.c Fri Aug 6 05:05:05 2004 +++ squid-2.5.STABLE10/src/errorpage.c Wed Apr 20 15:33:48 2005 @@ -1,6 +1,6 @@ /* - * $Id: errorpage.c,v 1.167.2.12 2004/08/06 11:05:05 hno Exp $ + * $Id: errorpage.c,v 1.167.2.13 2005/04/20 21:33:48 hno Exp $ * * DEBUG: section 4 Error Generation * AUTHOR: Duane Wessels @@ -412,6 +412,7 @@ #define CVT_BUF_SZ 512 /* + * a - User identity x * B - URL with FTP %2f hack x * c - Squid error code x * e - errno x @@ -449,6 +450,12 @@ memBufReset(&mb); switch (token) { + case 'a': + if (r->auth_user_request) + p = authenticateUserRequestUsername(r->auth_user_request); + if (!p) + p = "-"; + break; case 'B': p = r ? ftpUrlWith2f(r) : "[no URL]"; break; diff -ruN squid-2.5.STABLE9/src/external_acl.c squid-2.5.STABLE10/src/external_acl.c --- squid-2.5.STABLE9/src/external_acl.c Sun Feb 20 04:02:56 2005 +++ squid-2.5.STABLE10/src/external_acl.c Wed Mar 30 15:46:41 2005 @@ -1,6 +1,6 @@ /* - * $Id: external_acl.c,v 1.1.2.33 2005/02/20 11:02:56 hno Exp $ + * $Id: external_acl.c,v 1.1.2.34 2005/03/30 22:46:41 hno Exp $ * * DEBUG: section 82 External ACL * AUTHOR: Henrik Nordstrom, MARA Systems AB @@ -836,6 +836,13 @@ external_acl_cache_add(def, key, -1, NULL, NULL); dlinkAdd(state, &state->list, &def->queue); memBufClean(&buf); +} + +int +externalAclRequiresAuth(void *acl_data) +{ + external_acl_data *acl = acl_data; + return acl->def->require_auth; } static void diff -ruN squid-2.5.STABLE9/src/forward.c squid-2.5.STABLE10/src/forward.c --- squid-2.5.STABLE9/src/forward.c Tue Feb 22 17:06:35 2005 +++ squid-2.5.STABLE10/src/forward.c Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.82.2.14 2005/02/23 00:06:35 hno Exp $ + * $Id: forward.c,v 1.82.2.15 2005/03/26 02:50:53 hno Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -693,9 +693,18 @@ #endif if (EBIT_TEST(e->flags, ENTRY_FWD_HDR_WAIT)) return rc; - if (mem->inmem_hi - storeLowestMemReaderOffset(e) < READ_AHEAD_GAP) - return rc; - return 1; + if (EBIT_TEST(e->flags, RELEASE_REQUEST)) { + /* Just a small safety cap to defer storing more data into the object + * if there already is way too much. This handles the case when there + * is disk clients pending on a too large object being fetched and a + * few other corner cases. + */ + if (mem->inmem_hi - mem->inmem_lo > SM_PAGE_SIZE + Config.Store.maxInMemObjSize + READ_AHEAD_GAP) + return 1; + } + if (mem->inmem_hi - storeLowestMemReaderOffset(e) > READ_AHEAD_GAP) + return 1; + return rc; } void diff -ruN squid-2.5.STABLE9/src/fs/Makefile.in squid-2.5.STABLE10/src/fs/Makefile.in --- squid-2.5.STABLE9/src/fs/Makefile.in Sun Feb 20 18:35:49 2005 +++ squid-2.5.STABLE10/src/fs/Makefile.in Fri Mar 18 17:55:55 2005 @@ -15,7 +15,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.8.2.11 2005/02/21 01:35:49 hno Exp $ +# $Id: Makefile.in,v 1.8.2.12 2005/03/19 00:55:55 hno Exp $ # SHELL = @SHELL@ @@ -85,6 +85,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/fs/aufs/Makefile.in squid-2.5.STABLE10/src/fs/aufs/Makefile.in --- squid-2.5.STABLE9/src/fs/aufs/Makefile.in Sat Jul 10 06:11:49 2004 +++ squid-2.5.STABLE10/src/fs/aufs/Makefile.in Fri Mar 18 17:55:55 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/fs/aufs/aiops.c squid-2.5.STABLE10/src/fs/aufs/aiops.c --- squid-2.5.STABLE9/src/fs/aufs/aiops.c Wed Aug 6 08:16:26 2003 +++ squid-2.5.STABLE10/src/fs/aufs/aiops.c Mon Apr 25 10:27:02 2005 @@ -1,5 +1,5 @@ /* - * $Id: aiops.c,v 1.12.2.8 2003/08/06 14:16:26 hno Exp $ + * $Id: aiops.c,v 1.12.2.11 2005/04/25 16:27:02 serassio Exp $ * * DEBUG: section 43 AIOPS * AUTHOR: Stewart Forster @@ -92,7 +92,6 @@ mode_t mode; int fd; char *bufferp; - char *tmpbufp; int buflen; off_t offset; int whence; @@ -121,7 +120,6 @@ unsigned long requests; }; -static void squidaio_init(void); static void squidaio_queue_request(squidaio_request_t *); static void squidaio_cleanup_request(squidaio_request_t *); static void *squidaio_thread_loop(void *); @@ -252,11 +250,11 @@ squidaio_fdhandler(int fd, void *data) { char junk[256]; - read(done_fd_read, junk, sizeof(junk)); + FD_READ_METHOD(done_fd_read, junk, sizeof(junk)); commSetSelect(fd, COMM_SELECT_READ, squidaio_fdhandler, NULL, 0); } -static void +void squidaio_init(void) { int i; @@ -308,8 +306,8 @@ pipe(done_pipe); done_fd = done_pipe[1]; done_fd_read = done_pipe[0]; - fd_open(done_pipe[0], FD_PIPE, "async-io completetion event: main"); - fd_open(done_pipe[1], FD_PIPE, "async-io completetion event: threads"); + fd_open(done_fd_read, FD_PIPE, "async-io completion event: main"); + fd_open(done_fd, FD_PIPE, "async-io completion event: threads"); commSetNonBlocking(done_pipe[0]); commSetNonBlocking(done_pipe[1]); commSetSelect(done_pipe[0], COMM_SELECT_READ, squidaio_fdhandler, NULL, 0); @@ -352,6 +350,23 @@ squidaio_initialised = 1; } +void +squidaio_shutdown(void) +{ + if (!squidaio_initialised) + return; + + /* This is the same as in squidaio_sync */ + do { + squidaio_poll_queues(); + } while (request_queue_len > 0); + + close(done_fd); + close(done_fd_read); + fd_close(done_fd); + fd_close(done_fd_read); +} + static void * squidaio_thread_loop(void *ptr) @@ -447,7 +462,7 @@ pthread_mutex_unlock(&done_queue.mutex); if (!done_signalled) { done_signalled = 1; - write(done_fd, "!", 1); + FD_WRITE_METHOD(done_fd, "!", 1); } threadp->requests++; } /* while forever */ @@ -573,7 +588,6 @@ case _AIO_OP_READ: break; case _AIO_OP_WRITE: - squidaio_xfree(requestp->tmpbufp, requestp->buflen); break; default: break; @@ -608,8 +622,6 @@ { squidaio_request_t *requestp; - if (!squidaio_initialised) - squidaio_init(); requestp = memPoolAlloc(squidaio_request_pool); requestp->path = (char *) squidaio_xstrdup(path); requestp->oflag = oflag; @@ -636,8 +648,6 @@ { squidaio_request_t *requestp; - if (!squidaio_initialised) - squidaio_init(); requestp = memPoolAlloc(squidaio_request_pool); requestp->fd = fd; requestp->bufferp = bufp; @@ -667,12 +677,9 @@ { squidaio_request_t *requestp; - if (!squidaio_initialised) - squidaio_init(); requestp = memPoolAlloc(squidaio_request_pool); requestp->fd = fd; - requestp->tmpbufp = (char *) squidaio_xmalloc(bufs); - xmemcpy(requestp->tmpbufp, bufp, bufs); + requestp->bufferp = bufp; requestp->buflen = bufs; requestp->offset = offset; requestp->whence = whence; @@ -688,7 +695,7 @@ static void squidaio_do_write(squidaio_request_t * requestp) { - requestp->ret = write(requestp->fd, requestp->tmpbufp, requestp->buflen); + requestp->ret = write(requestp->fd, requestp->bufferp, requestp->buflen); requestp->err = errno; } @@ -698,8 +705,6 @@ { squidaio_request_t *requestp; - if (!squidaio_initialised) - squidaio_init(); requestp = memPoolAlloc(squidaio_request_pool); requestp->fd = fd; requestp->resultp = resultp; @@ -724,8 +729,6 @@ { squidaio_request_t *requestp; - if (!squidaio_initialised) - squidaio_init(); requestp = memPoolAlloc(squidaio_request_pool); requestp->path = (char *) squidaio_xstrdup(path); requestp->statp = sb; @@ -752,8 +755,6 @@ { squidaio_request_t *requestp; - if (!squidaio_initialised) - squidaio_init(); requestp = memPoolAlloc(squidaio_request_pool); requestp->path = squidaio_xstrdup(path); requestp->resultp = resultp; @@ -777,8 +778,6 @@ { squidaio_request_t *requestp; - if (!squidaio_initialised) - squidaio_init(); requestp = memPoolAlloc(squidaio_request_pool); requestp->path = (char *) squidaio_xstrdup(path); requestp->offset = length; @@ -808,8 +807,6 @@ squidaio_request_t *requestp; int len; - if (!squidaio_initialised) - squidaio_init(); requestp = memPoolAlloc(squidaio_request_pool); return -1; } @@ -864,7 +861,7 @@ if (request == NULL && !polled) { if (done_signalled) { char junk[256]; - read(done_fd_read, junk, sizeof(junk)); + FD_READ_METHOD(done_fd_read, junk, sizeof(junk)); done_signalled = 0; } squidaio_poll_queues(); @@ -935,5 +932,21 @@ break; default: break; + } +} + +void +squidaio_stats(StoreEntry * sentry) +{ + squidaio_thread_t *threadp; + int i; + + storeAppendPrintf(sentry, "\n\nThreads Status:\n"); + storeAppendPrintf(sentry, "#\tID\t# Requests\n"); + + threadp = threads; + for (i = 0; i < squidaio_nthreads; i++) { + storeAppendPrintf(sentry, "%i\t0x%lx\t%ld\n", i + 1, (unsigned long) threadp->thread, threadp->requests); + threadp = threadp->next; } } diff -ruN squid-2.5.STABLE9/src/fs/aufs/async_io.c squid-2.5.STABLE10/src/fs/aufs/async_io.c --- squid-2.5.STABLE9/src/fs/aufs/async_io.c Fri Jan 3 18:19:42 2003 +++ squid-2.5.STABLE10/src/fs/aufs/async_io.c Mon Apr 25 10:27:03 2005 @@ -1,6 +1,6 @@ /* - * $Id: async_io.c,v 1.10.2.5 2003/01/04 01:19:42 hno Exp $ + * $Id: async_io.c,v 1.10.2.9 2005/04/25 16:27:03 serassio Exp $ * * DEBUG: section 32 Asynchronous Disk I/O * AUTHOR: Pete Bentley @@ -79,15 +79,6 @@ static int initialised = 0; static OBJH aioStats; static MemPool *squidaio_ctrl_pool; -static void aioFDWasClosed(int fd); - -static void -aioFDWasClosed(int fd) -{ - if (fd_table[fd].flags.closing) - fd_close(fd); -} - void aioInit(void) @@ -103,6 +94,7 @@ void aioDone(void) { + squidaio_shutdown(); memPoolDestroy(squidaio_ctrl_pool); initialised = 0; } @@ -185,7 +177,7 @@ void -aioWrite(int fd, int offset, char *bufp, int len, AIOCB * callback, void *callback_data, FREE * free_func) +aioWrite(int fd, off_t offset, char *bufp, int len, AIOCB * callback, void *callback_data, FREE * free_func) { squidaio_ctrl_t *ctrlp; int seekmode; @@ -213,7 +205,7 @@ void -aioRead(int fd, int offset, int len, AIOCB * callback, void *callback_data) +aioRead(int fd, off_t offset, int len, AIOCB * callback, void *callback_data) { squidaio_ctrl_t *ctrlp; int seekmode; @@ -336,8 +328,6 @@ /* free temporary read buffer */ if (ctrlp->operation == _AIO_READ) squidaio_xfree(ctrlp->bufp, ctrlp->len); - if (ctrlp->operation == _AIO_CLOSE) - aioFDWasClosed(ctrlp->fd); memPoolFree(squidaio_ctrl_pool, ctrlp); } return retval; @@ -357,6 +347,7 @@ storeAppendPrintf(sentry, "unlink\t%d\n", squidaio_counts.unlink); storeAppendPrintf(sentry, "check_callback\t%d\n", squidaio_counts.check_callback); storeAppendPrintf(sentry, "queue\t%d\n", squidaio_get_queue_len()); + squidaio_stats(sentry); } /* Flush all pending I/O */ diff -ruN squid-2.5.STABLE9/src/fs/aufs/store_asyncufs.h squid-2.5.STABLE10/src/fs/aufs/store_asyncufs.h --- squid-2.5.STABLE9/src/fs/aufs/store_asyncufs.h Wed Aug 6 08:16:26 2003 +++ squid-2.5.STABLE10/src/fs/aufs/store_asyncufs.h Mon Apr 25 10:27:03 2005 @@ -41,6 +41,8 @@ typedef void AIOCB(int fd, void *cbdata, const char *buf, int aio_return, int aio_errno); +void squidaio_init(void); +void squidaio_shutdown(void); int squidaio_cancel(squidaio_result_t *); int squidaio_open(const char *, int, mode_t, squidaio_result_t *); int squidaio_read(int, char *, int, off_t, int, squidaio_result_t *); @@ -56,14 +58,15 @@ int squidaio_get_queue_len(void); void *squidaio_xmalloc(int size); void squidaio_xfree(void *p, int size); +void squidaio_stats(StoreEntry *); void aioInit(void); void aioDone(void); void aioCancel(int); void aioOpen(const char *, int, mode_t, AIOCB *, void *); void aioClose(int); -void aioWrite(int, int offset, char *, int size, AIOCB *, void *, FREE *); -void aioRead(int, int offset, int size, AIOCB *, void *); +void aioWrite(int, off_t offset, char *, int size, AIOCB *, void *, FREE *); +void aioRead(int, off_t offset, int size, AIOCB *, void *); void aioStat(char *, struct stat *, AIOCB *, void *); void aioUnlink(const char *, AIOCB *, void *); void aioTruncate(const char *, off_t length, AIOCB *, void *); @@ -86,8 +89,9 @@ unsigned int reading:1; unsigned int writing:1; unsigned int opening:1; +#if !ASYNC_WRITE unsigned int write_kicking:1; - unsigned int read_kicking:1; +#endif unsigned int inreaddone:1; } flags; char *read_buf; diff -ruN squid-2.5.STABLE9/src/fs/aufs/store_dir_aufs.c squid-2.5.STABLE10/src/fs/aufs/store_dir_aufs.c --- squid-2.5.STABLE9/src/fs/aufs/store_dir_aufs.c Wed Aug 25 15:07:25 2004 +++ squid-2.5.STABLE10/src/fs/aufs/store_dir_aufs.c Sat Mar 26 16:27:10 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_aufs.c,v 1.40.2.9 2004/08/25 21:07:25 hno Exp $ + * $Id: store_dir_aufs.c,v 1.40.2.14 2005/03/26 23:27:10 serassio Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -82,7 +82,7 @@ static int storeAufsDirGetNextFile(RebuildState *, sfileno *, int *size); static StoreEntry *storeAufsDirAddDiskRestore(SwapDir * SD, const cache_key * key, sfileno file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -111,7 +111,6 @@ static QS rev_int_sort; static int storeAufsDirClean(int swap_index); static EVH storeAufsDirCleanEvent; -static int storeAufsDirIs(SwapDir * sd); static int storeAufsFilenoBelongsHere(int fn, int F0, int F1, int F2); static int storeAufsCleanupDoubleCheck(SwapDir *, StoreEntry *); static void storeAufsDirStats(SwapDir *, StoreEntry *); @@ -331,10 +330,6 @@ } debug(50, 3) ("Cache Dir #%d log opened on FD %d\n", sd->index, fd); aioinfo->swaplog_fd = fd; - if (0 == n_asyncufs_dirs) - assert(NULL == asyncufs_dir_index); - n_asyncufs_dirs++; - assert(n_asyncufs_dirs <= Config.cacheSwap.n_configured); } static void @@ -347,10 +342,6 @@ debug(47, 3) ("Cache Dir #%d log closed on FD %d\n", sd->index, aioinfo->swaplog_fd); aioinfo->swaplog_fd = -1; - n_asyncufs_dirs--; - assert(n_asyncufs_dirs >= 0); - if (0 == n_asyncufs_dirs) - safe_free(asyncufs_dir_index); } static void @@ -364,6 +355,7 @@ storeAufsDirInitBitmap(sd); if (storeAufsDirVerifyCacheDirs(sd) < 0) fatal(errmsg); + squidaio_init(); storeAufsDirOpenSwapLog(sd); storeAufsDirRebuild(sd); if (!started_clean_event) { @@ -374,6 +366,24 @@ } static void +storeAufsDirRebuildComplete(RebuildState * rb) +{ + if (rb->log) { + debug(47, 1) ("Done reading %s swaplog (%d entries)\n", + rb->sd->path, rb->n_read); + fclose(rb->log); + rb->log = NULL; + } else { + debug(47, 1) ("Done scanning %s (%d entries)\n", + rb->sd->path, rb->counts.scancount); + } + store_dirs_rebuilding--; + storeAufsDirCloseTmpSwapLog(rb->sd); + storeRebuildComplete(&rb->counts); + cbdataFree(rb); +} + +static void storeAufsDirRebuildFromDirectory(void *data) { RebuildState *rb = data; @@ -396,12 +406,7 @@ assert(fd == -1); fd = storeAufsDirGetNextFile(rb, &filn, &size); if (fd == -2) { - debug(47, 1) ("Done scanning %s swaplog (%d entries)\n", - rb->sd->path, rb->n_read); - store_dirs_rebuilding--; - storeAufsDirCloseTmpSwapLog(rb->sd); - storeRebuildComplete(&rb->counts); - cbdataFree(rb); + storeAufsDirRebuildComplete(rb); return; } else if (fd < 0) { continue; @@ -453,10 +458,39 @@ assert(t->length == MD5_DIGEST_CHARS); xmemcpy(key, t->value, MD5_DIGEST_CHARS); break; +#if SIZEOF_SQUID_FILE_SZ == SIZEOF_SIZE_T case STORE_META_STD: assert(t->length == STORE_HDR_METASIZE); xmemcpy(&tmpe.timestamp, t->value, STORE_HDR_METASIZE); break; +#else + case STORE_META_STD_LFS: + assert(t->length == STORE_HDR_METASIZE); + xmemcpy(&tmpe.timestamp, t->value, STORE_HDR_METASIZE); + break; + case STORE_META_STD: + assert(t->length == STORE_HDR_METASIZE_OLD); + { + struct { + time_t timestamp; + time_t lastref; + time_t expires; + time_t lastmod; + size_t swap_file_sz; + u_short refcount; + u_short flags; + } *tmp = t->value; + assert(sizeof(*tmp) == STORE_HDR_METASIZE_OLD); + tmpe.timestamp = tmp->timestamp; + tmpe.lastref = tmp->lastref; + tmpe.expires = tmp->expires; + tmpe.lastmod = tmp->lastmod; + tmpe.swap_file_sz = tmp->swap_file_sz; + tmpe.refcount = tmp->refcount; + tmpe.flags = tmp->flags; + } + break; +#endif default: break; } @@ -530,21 +564,178 @@ /* load a number of objects per invocation */ for (count = 0; count < rb->speed; count++) { if (fread(&s, ss, 1, rb->log) != 1) { - debug(47, 1) ("Done reading %s swaplog (%d entries)\n", - rb->sd->path, rb->n_read); - fclose(rb->log); - rb->log = NULL; - store_dirs_rebuilding--; - storeAufsDirCloseTmpSwapLog(rb->sd); - storeRebuildComplete(&rb->counts); - cbdataFree(rb); + storeAufsDirRebuildComplete(rb); return; } rb->n_read++; - if (s.op <= SWAP_LOG_NOP) + /* + * BC: during 2.4 development, we changed the way swap file + * numbers are assigned and stored. The high 16 bits used + * to encode the SD index number. There used to be a call + * to storeDirProperFileno here that re-assigned the index + * bits. Now, for backwards compatibility, we just need + * to mask it off. + */ + s.swap_filen &= 0x00FFFFFF; + debug(47, 3) ("storeAufsDirRebuildFromSwapLog: %s %s %08X\n", + swap_log_op_str[(int) s.op], + storeKeyText(s.key), + s.swap_filen); + if (s.op == SWAP_LOG_ADD) { + (void) 0; + } else if (s.op == SWAP_LOG_DEL) { + /* Delete unless we already have a newer copy */ + if ((e = storeGet(s.key)) != NULL && s.lastref > e->lastref) { + /* + * Make sure we don't unlink the file, it might be + * in use by a subsequent entry. Also note that + * we don't have to subtract from store_swap_size + * because adding to store_swap_size happens in + * the cleanup procedure. + */ + storeExpireNow(e); + storeReleaseRequest(e); + if (e->swap_filen > -1) { + storeAufsDirReplRemove(e); + storeAufsDirMapBitReset(SD, e->swap_filen); + e->swap_filen = -1; + e->swap_dirn = -1; + } + storeRelease(e); + rb->counts.objcount--; + rb->counts.cancelcount++; + } + continue; + } else { + x = log(++rb->counts.bad_log_op) / log(10.0); + if (0.0 == x - (double) (int) x) + debug(47, 1) ("WARNING: %d invalid swap log entries found\n", + rb->counts.bad_log_op); + rb->counts.invalid++; + continue; + } + if ((++rb->counts.scancount & 0xFFF) == 0) { + struct stat sb; + if (0 == fstat(fileno(rb->log), &sb)) + storeRebuildProgress(SD->index, + (int) sb.st_size / ss, rb->n_read); + } + if (!storeAufsDirValidFileno(SD, s.swap_filen, 0)) { + rb->counts.invalid++; + continue; + } + if (EBIT_TEST(s.flags, KEY_PRIVATE)) { + rb->counts.badflags++; + continue; + } + e = storeGet(s.key); + used = storeAufsDirMapBitTest(SD, s.swap_filen); + /* If this URL already exists in the cache, does the swap log + * appear to have a newer entry? Compare 'lastref' from the + * swap log to e->lastref. */ + disk_entry_newer = e ? (s.lastref > e->lastref ? 1 : 0) : 0; + if (used && !disk_entry_newer) { + /* log entry is old, ignore it */ + rb->counts.clashcount++; + continue; + } else if (used && e && e->swap_filen == s.swap_filen && e->swap_dirn == SD->index) { + /* swapfile taken, same URL, newer, update meta */ + if (e->store_status == STORE_OK) { + e->lastref = s.timestamp; + e->timestamp = s.timestamp; + e->expires = s.expires; + e->lastmod = s.lastmod; + e->flags = s.flags; + e->refcount += s.refcount; + storeAufsDirUnrefObj(SD, e); + } else { + debug_trap("storeAufsDirRebuildFromSwapLog: bad condition"); + debug(47, 1) ("\tSee %s:%d\n", __FILE__, __LINE__); + } + continue; + } else if (used) { + /* swapfile in use, not by this URL, log entry is newer */ + /* This is sorta bad: the log entry should NOT be newer at this + * point. If the log is dirty, the filesize check should have + * caught this. If the log is clean, there should never be a + * newer entry. */ + debug(47, 1) ("WARNING: newer swaplog entry for dirno %d, fileno %08X\n", + SD->index, s.swap_filen); + /* I'm tempted to remove the swapfile here just to be safe, + * but there is a bad race condition in the NOVM version if + * the swapfile has recently been opened for writing, but + * not yet opened for reading. Because we can't map + * swapfiles back to StoreEntrys, we don't know the state + * of the entry using that file. */ + /* We'll assume the existing entry is valid, probably because + * were in a slow rebuild and the the swap file number got taken + * and the validation procedure hasn't run. */ + assert(rb->flags.need_to_validate); + rb->counts.clashcount++; continue; - if (s.op >= SWAP_LOG_MAX) + } else if (e && !disk_entry_newer) { + /* key already exists, current entry is newer */ + /* keep old, ignore new */ + rb->counts.dupcount++; continue; + } else if (e) { + /* key already exists, this swapfile not being used */ + /* junk old, load new */ + storeExpireNow(e); + storeReleaseRequest(e); + if (e->swap_filen > -1) { + storeAufsDirReplRemove(e); + /* Make sure we don't actually unlink the file */ + storeAufsDirMapBitReset(SD, e->swap_filen); + e->swap_filen = -1; + e->swap_dirn = -1; + } + storeRelease(e); + rb->counts.dupcount++; + } else { + /* URL doesnt exist, swapfile not in use */ + /* load new */ + (void) 0; + } + /* update store_swap_size */ + rb->counts.objcount++; + e = storeAufsDirAddDiskRestore(SD, s.key, + s.swap_filen, + s.swap_file_sz, + s.expires, + s.timestamp, + s.lastref, + s.lastmod, + s.refcount, + s.flags, + (int) rb->flags.clean); + storeDirSwapLog(e, SWAP_LOG_ADD); + } + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLog, rb, 0.0, 1); +} + +#if SIZEOF_SQUID_FILE_SZ != SIZEOF_SIZE_T +/* This is an exact copy of the above, but using storeSwapLogDataOld entry type */ +static void +storeAufsDirRebuildFromSwapLogOld(void *data) +{ + RebuildState *rb = data; + SwapDir *SD = rb->sd; + StoreEntry *e = NULL; + storeSwapLogDataOld s; + size_t ss = sizeof(storeSwapLogDataOld); + int count; + int used; /* is swapfile already in use? */ + int disk_entry_newer; /* is the log entry newer than current entry? */ + double x; + assert(rb != NULL); + /* load a number of objects per invocation */ + for (count = 0; count < rb->speed; count++) { + if (fread(&s, ss, 1, rb->log) != 1) { + storeAufsDirRebuildComplete(rb); + return; + } + rb->n_read++; /* * BC: during 2.4 development, we changed the way swap file * numbers are assigned and stored. The high 16 bits used @@ -688,7 +879,49 @@ (int) rb->flags.clean); storeDirSwapLog(e, SWAP_LOG_ADD); } + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLogOld, rb, 0.0, 1); +} + +#endif + +static void +storeAufsDirRebuildFromSwapLogCheckVersion(void *data) +{ + RebuildState *rb = data; + storeSwapLogHeader hdr; + + if (fread(&hdr, sizeof(hdr), 1, rb->log) != 1) { + storeAufsDirRebuildComplete(rb); + return; + } + if (hdr.op == SWAP_LOG_VERSION) { + if (fseek(rb->log, hdr.record_size, SEEK_SET) != 0) { + storeAufsDirRebuildComplete(rb); + return; + } + if (hdr.version == 1 && hdr.record_size == sizeof(storeSwapLogData)) { + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLog, rb, 0.0, 1); + return; + } +#if SIZEOF_SQUID_FILE_SZ != SIZEOF_SIZE_T + if (hdr.version == 1 && hdr.record_size == sizeof(storeSwapLogDataOld)) { + debug(47, 1) ("storeAufsDirRebuildFromSwapLog: Found current version but without large file support. Upgrading\n"); + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLogOld, rb, 0.0, 1); + return; + } +#endif + debug(47, 1) ("storeAufsDirRebuildFromSwapLog: Unsupported swap.state version %d size %d\n", + hdr.version, hdr.record_size); + storeAufsDirRebuildComplete(rb); + return; + } + rewind(rb->log); + debug(47, 1) ("storeAufsDirRebuildFromSwapLog: Old version detected. Upgrading\n"); +#if SIZEOF_SQUID_FILE_SZ == SIZEOF_SIZE_T eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLog, rb, 0.0, 1); +#else + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLogOld, rb, 0.0, 1); +#endif } static int @@ -783,7 +1016,7 @@ static StoreEntry * storeAufsDirAddDiskRestore(SwapDir * SD, const cache_key * key, sfileno file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -847,7 +1080,7 @@ fclose(fp); func = storeAufsDirRebuildFromDirectory; } else { - func = storeAufsDirRebuildFromSwapLog; + func = storeAufsDirRebuildFromSwapLogCheckVersion; rb->log = fp; rb->flags.clean = (unsigned int) clean; } @@ -867,12 +1100,6 @@ char *new_path = xstrdup(storeAufsDirSwapLogFile(sd, ".new")); int fd; file_close(aioinfo->swaplog_fd); -#if defined (_SQUID_OS2_) || defined (_SQUID_CYGWIN_) - if (unlink(swaplog_path) < 0) { - debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror()); - fatal("storeAufsDirCloseTmpSwapLog: unlink failed"); - } -#endif if (xrename(new_path, swaplog_path) < 0) { fatal("storeAufsDirCloseTmpSwapLog: rename failed"); } @@ -887,6 +1114,31 @@ debug(47, 3) ("Cache Dir #%d log opened on FD %d\n", sd->index, fd); } +static void +storeSwapLogDataFree(void *s) +{ + memFree(s, MEM_SWAP_LOG_DATA); +} + +static void +storeAufsWriteSwapLogheader(int fd) +{ + storeSwapLogHeader *hdr = memAllocate(MEM_SWAP_LOG_DATA); + hdr->op = SWAP_LOG_VERSION; + hdr->version = 1; + hdr->record_size = sizeof(storeSwapLogData); + /* The header size is a full log record to keep some level of backward + * compatibility even if the actual header is smaller + */ + file_write(fd, + -1, + hdr, + sizeof(storeSwapLogData), + NULL, + NULL, + (FREE *) storeSwapLogDataFree); +} + static FILE * storeAufsDirOpenTmpSwapLog(SwapDir * sd, int *clean_flag, int *zero_flag) { @@ -916,6 +1168,7 @@ fatal("storeDirOpenTmpSwapLog: Failed to open swap log."); } aioinfo->swaplog_fd = fd; + storeAufsWriteSwapLogheader(fd); /* open a read-only stream of the old log */ fp = fopen(swaplog_path, "r"); if (fp == NULL) { @@ -944,7 +1197,7 @@ char *new; char *cln; char *outbuf; - off_t outbuf_offset; + int outbuf_offset; int fd; RemovalPolicyWalker *walker; }; @@ -975,6 +1228,7 @@ xfree(state); return -1; } + storeAufsWriteSwapLogheader(state->fd); state->cur = xstrdup(storeAufsDirSwapLogFile(sd, NULL)); state->cln = xstrdup(storeAufsDirSwapLogFile(sd, ".last-clean")); state->outbuf = xcalloc(CLEAN_BUF_SZ, 1); @@ -1077,9 +1331,6 @@ #if defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_) file_close(state->fd); state->fd = -1; - if (unlink(state->cur) < 0) - debug(50, 0) ("storeDirWriteCleanLogs: unlinkd failed: %s, %s\n", - xstrerror(), state->cur); #endif xrename(state->new, state->cur); } @@ -1103,12 +1354,6 @@ } static void -storeSwapLogDataFree(void *s) -{ - memFree(s, MEM_SWAP_LOG_DATA); -} - -static void storeAufsDirSwapLog(const SwapDir * sd, const StoreEntry * e, int op) { squidaioinfo_t *aioinfo = (squidaioinfo_t *) sd->fsdata; @@ -1227,55 +1472,38 @@ static void storeAufsDirCleanEvent(void *unused) { - static int swap_index = 0; - int i; + static int swap_index = -1; int j = 0; int n = 0; /* * Assert that there are AUFS cache_dirs configured, otherwise * we should never be called. */ - assert(n_asyncufs_dirs); - if (NULL == asyncufs_dir_index) { + if (swap_index == -1) { SwapDir *sd; squidaioinfo_t *aioinfo; /* - * Initialize the little array that translates AUFS cache_dir - * number into the Config.cacheSwap.swapDirs array index. - */ - asyncufs_dir_index = xcalloc(n_asyncufs_dirs, sizeof(*asyncufs_dir_index)); - for (i = 0, n = 0; i < Config.cacheSwap.n_configured; i++) { - sd = &Config.cacheSwap.swapDirs[i]; - if (!storeAufsDirIs(sd)) - continue; - asyncufs_dir_index[n++] = i; - aioinfo = (squidaioinfo_t *) sd->fsdata; - j += (aioinfo->l1 * aioinfo->l2); - } - assert(n == n_asyncufs_dirs); - /* * Start the storeAufsDirClean() swap_index with a random * value. j equals the total number of AUFS level 2 * swap directories */ + for (n = 0; n < n_asyncufs_dirs; n++) { + sd = &Config.cacheSwap.swapDirs[asyncufs_dir_index[n]]; + aioinfo = (squidaioinfo_t *) sd->fsdata; + j += (aioinfo->l1 * aioinfo->l2); + } swap_index = (int) (squid_random() % j); } if (0 == store_dirs_rebuilding) { n = storeAufsDirClean(swap_index); swap_index++; + if (swap_index < 0) + swap_index = 0; } eventAdd("storeDirClean", storeAufsDirCleanEvent, NULL, 15.0 * exp(-0.25 * n), 1); } -static int -storeAufsDirIs(SwapDir * sd) -{ - if (strncmp(sd->type, "aufs", 4) == 0) - return 1; - return 0; -} - /* * Does swapfile number 'fn' belong in cachedir #F0, * level1 dir #F1, level2 dir #F2? @@ -1689,6 +1917,9 @@ /* Initialise replacement policy stuff */ sd->repl = createRemovalPolicy(Config.replPolicy); + + asyncufs_dir_index = realloc(asyncufs_dir_index, (n_asyncufs_dirs + 1) * sizeof(*asyncufs_dir_index)); + asyncufs_dir_index[n_asyncufs_dirs++] = index; } /* diff -ruN squid-2.5.STABLE9/src/fs/aufs/store_io_aufs.c squid-2.5.STABLE10/src/fs/aufs/store_io_aufs.c --- squid-2.5.STABLE9/src/fs/aufs/store_io_aufs.c Sat Jun 5 13:42:14 2004 +++ squid-2.5.STABLE10/src/fs/aufs/store_io_aufs.c Fri Mar 25 19:50:54 2005 @@ -153,7 +153,7 @@ /* Read */ void -storeAufsRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +storeAufsRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; assert(sio->read.callback == NULL); @@ -167,7 +167,7 @@ q = memPoolAlloc(aufs_qread_pool); q->buf = buf; q->size = size; - q->offset = offset; + q->offset = (off_t) offset; q->callback = callback; q->callback_data = callback_data; cbdataLock(q->callback_data); @@ -183,10 +183,10 @@ sio->offset = offset; aiostate->flags.reading = 1; #if ASYNC_READ - aioRead(aiostate->fd, offset, size, storeAufsReadDone, sio); + aioRead(aiostate->fd, (off_t) offset, size, storeAufsReadDone, sio); statCounter.syscalls.disk.reads++; #else - file_read(aiostate->fd, buf, size, offset, storeAufsReadDone, sio); + file_read(aiostate->fd, buf, size, (off_t) offset, storeAufsReadDone, sio); /* file_read() increments syscalls.disk.reads */ #endif } @@ -194,7 +194,7 @@ /* Write */ void -storeAufsWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func) +storeAufsWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; debug(79, 3) ("storeAufsWrite: dirno %d, fileno %08X, FD %d\n", @@ -206,7 +206,7 @@ q = memPoolAlloc(aufs_qwrite_pool); q->buf = buf; q->size = size; - q->offset = offset; + q->offset = (off_t) offset; q->free_func = free_func; linklistPush(&(aiostate->pending_writes), q); return; @@ -218,17 +218,17 @@ q = memPoolAlloc(aufs_qwrite_pool); q->buf = buf; q->size = size; - q->offset = offset; + q->offset = (off_t) offset; q->free_func = free_func; linklistPush(&(aiostate->pending_writes), q); return; } aiostate->flags.writing = 1; - aioWrite(aiostate->fd, offset, buf, size, storeAufsWriteDone, sio, + aioWrite(aiostate->fd, (off_t) offset, buf, size, storeAufsWriteDone, sio, free_func); statCounter.syscalls.disk.writes++; #else - file_write(aiostate->fd, offset, buf, size, storeAufsWriteDone, sio, + file_write(aiostate->fd, (off_t) offset, buf, size, storeAufsWriteDone, sio, free_func); /* file_write() increments syscalls.disk.writes */ #endif @@ -330,7 +330,7 @@ debug(79, 3) ("storeAufsReadDone: got failure (%d)\n", errflag); rlen = -1; } else { - rlen = (ssize_t) len; + rlen = len; sio->offset += len; } #if ASYNC_READ @@ -393,18 +393,29 @@ } sio->offset += len; #if ASYNC_WRITE - if (!storeAufsKickWriteQueue(sio)) + if (storeAufsKickWriteQueue(sio)) (void) 0; else if (aiostate->flags.close_request) storeAufsIOCallback(sio, errflag); #else + /* loop around storeAufsKickWriteQueue to break recursion stack + * overflow when large amounts of data has been queued for write. + * As writes are blocking here we immediately get called again + * without going via the I/O event loop.. + */ if (!aiostate->flags.write_kicking) { + /* cbdataLock to protect us from the storeAufsIOCallback on error above */ + cbdataLock(sio); aiostate->flags.write_kicking = 1; while (storeAufsKickWriteQueue(sio)) - (void) 0; - aiostate->flags.write_kicking = 0; - if (aiostate->flags.close_request) - storeAufsIOCallback(sio, errflag); + if (!cbdataValid(sio)) + break; + if (cbdataValid(sio)) { + aiostate->flags.write_kicking = 0; + if (aiostate->flags.close_request) + storeAufsIOCallback(sio, errflag); + } + cbdataUnlock(sio); } #endif loop_detect--; @@ -433,8 +444,13 @@ if (fd < 0) return; debug(79, 9) ("%s:%d\n", __FILE__, __LINE__); +#if ASYNC_CLOSE aioClose(fd); fd_close(fd); +#else + aioCancel(fd); + file_close(fd); +#endif store_open_disk_fd--; statCounter.syscalls.disk.closes++; debug(79, 9) ("%s:%d\n", __FILE__, __LINE__); diff -ruN squid-2.5.STABLE9/src/fs/coss/Makefile.in squid-2.5.STABLE10/src/fs/coss/Makefile.in --- squid-2.5.STABLE9/src/fs/coss/Makefile.in Sat Jul 10 06:11:49 2004 +++ squid-2.5.STABLE10/src/fs/coss/Makefile.in Fri Mar 18 17:55:55 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/fs/coss/async_io.c squid-2.5.STABLE10/src/fs/coss/async_io.c --- squid-2.5.STABLE9/src/fs/coss/async_io.c Tue Jul 29 15:44:47 2003 +++ squid-2.5.STABLE10/src/fs/coss/async_io.c Sat Mar 26 16:40:21 2005 @@ -11,7 +11,7 @@ * supports are read/write, and since COSS works on a single file * per storedir it should work just fine. * - * $Id: async_io.c,v 1.7.2.4 2003/07/29 21:44:47 wessels Exp $ + * $Id: async_io.c,v 1.7.2.7 2005/03/26 23:40:21 hno Exp $ */ #include "squid.h" @@ -197,7 +197,7 @@ type = aqe->aq_e_type; /* Free slot */ - bzero(aqe, sizeof(async_queue_entry_t)); + memset(aqe, 0, sizeof(async_queue_entry_t)); aqe->aq_e_state = AQ_ENTRY_FREE; q->aq_numpending--; diff -ruN squid-2.5.STABLE9/src/fs/coss/store_dir_coss.c squid-2.5.STABLE10/src/fs/coss/store_dir_coss.c --- squid-2.5.STABLE9/src/fs/coss/store_dir_coss.c Mon Aug 4 06:41:51 2003 +++ squid-2.5.STABLE10/src/fs/coss/store_dir_coss.c Tue Apr 19 16:27:45 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.c,v 1.30.2.9 2003/08/04 12:41:51 adrian Exp $ + * $Id: store_dir_coss.c,v 1.30.2.13 2005/04/19 22:27:45 hno Exp $ * * DEBUG: section 47 Store COSS Directory Routines * AUTHOR: Eric Stern @@ -63,7 +63,7 @@ static EVH storeCossRebuildFromSwapLog; static StoreEntry *storeCossAddDiskRestore(SwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -318,7 +318,7 @@ static StoreEntry * storeCossAddDiskRestore(SwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -411,12 +411,6 @@ char *new_path = xstrdup(storeCossDirSwapLogFile(sd, ".new")); int fd; file_close(cs->swaplog_fd); -#ifdef _SQUID_OS2_ - if (unlink(swaplog_path) < 0) { - debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror()); - fatal("storeCossDirCloseTmpSwapLog: unlink failed"); - } -#endif if (xrename(new_path, swaplog_path) < 0) { fatal("storeCossDirCloseTmpSwapLog: rename failed"); } @@ -485,7 +479,7 @@ char *new; char *cln; char *outbuf; - off_t outbuf_offset; + int outbuf_offset; int fd; dlink_node *current; }; @@ -613,9 +607,6 @@ #ifdef _SQUID_OS2_ file_close(state->fd); state->fd = -1; - if (unlink(cur) < 0) - debug(50, 0) ("storeCossDirWriteCleanLogs: unlinkd failed: %s, %s\n", - xstrerror(), cur); #endif xrename(state->new, state->cur); } diff -ruN squid-2.5.STABLE9/src/fs/coss/store_io_coss.c squid-2.5.STABLE10/src/fs/coss/store_io_coss.c --- squid-2.5.STABLE9/src/fs/coss/store_io_coss.c Tue Jul 29 16:19:43 2003 +++ squid-2.5.STABLE10/src/fs/coss/store_io_coss.c Sat Mar 26 16:40:21 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_io_coss.c,v 1.13.2.8 2003/07/29 22:19:43 wessels Exp $ + * $Id: store_io_coss.c,v 1.13.2.11 2005/03/26 23:40:21 hno Exp $ * * DEBUG: section 79 Storage Manager COSS Interface * AUTHOR: Eric Stern @@ -296,7 +296,7 @@ } void -storeCossRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +storeCossRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { char *p; CossState *cstate = (CossState *) sio->fsstate; @@ -337,7 +337,7 @@ } void -storeCossWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func) +storeCossWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { char *dest; CossMemBuf *membuf; @@ -373,7 +373,7 @@ void *their_data = sio->read.callback_data; SwapDir *SD = INDEXSD(sio->swap_dirn); CossState *cstate = (CossState *) sio->fsstate; - size_t rlen; + ssize_t rlen; debug(79, 3) ("storeCossReadDone: fileno %d, FD %d, len %d\n", sio->swap_filen, fd, len); @@ -547,7 +547,7 @@ if (errflag) { coss_stats.stripe_write.fail++; debug(79, 1) ("storeCossWriteMemBufDone: got failure (%d)\n", errflag); - debug(79, 1) ("FD %d, size=%x\n", fd, t->diskend - t->diskstart); + debug(79, 1) ("FD %d, size=%x\n", fd, (int) (t->diskend - t->diskstart)); } else { coss_stats.stripe_write.success++; } diff -ruN squid-2.5.STABLE9/src/fs/diskd/Makefile.in squid-2.5.STABLE10/src/fs/diskd/Makefile.in --- squid-2.5.STABLE9/src/fs/diskd/Makefile.in Sat Jul 10 06:11:50 2004 +++ squid-2.5.STABLE10/src/fs/diskd/Makefile.in Fri Mar 18 17:55:56 2005 @@ -16,7 +16,7 @@ # # Makefile for the DISKD storage driver for the Squid Object Cache server # -# $Id: Makefile.in,v 1.6.2.9 2004/07/10 12:11:50 hno Exp $ +# $Id: Makefile.in,v 1.6.2.10 2005/03/19 00:55:56 hno Exp $ # SHELL = @SHELL@ @@ -86,6 +86,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/fs/diskd/diskd.c squid-2.5.STABLE10/src/fs/diskd/diskd.c --- squid-2.5.STABLE9/src/fs/diskd/diskd.c Wed Feb 7 11:56:54 2001 +++ squid-2.5.STABLE10/src/fs/diskd/diskd.c Sat Mar 26 16:29:56 2005 @@ -1,5 +1,5 @@ /* - * $Id: diskd.c,v 1.10 2001/02/07 18:56:54 hno Exp $ + * $Id: diskd.c,v 1.10.2.2 2005/03/26 23:29:56 hno Exp $ * * DEBUG: section -- External DISKD process implementation. * AUTHOR: Harvest Derived @@ -135,18 +135,18 @@ } if (r->offset > -1 && r->offset != fs->offset) { DEBUG(2) - fprintf(stderr, "seeking to %d\n", r->offset); + fprintf(stderr, "seeking to %" PRINTF_OFF_T "\n", (squid_off_t) r->offset); if (lseek(fs->fd, r->offset, SEEK_SET) < 0) { DEBUG(1) { - fprintf(stderr, "%d FD %d, offset %d: ", (int) mypid, fs->fd, r->offset); + fprintf(stderr, "%d FD %d, offset %" PRINTF_OFF_T ": ", (int) mypid, fs->fd, (squid_off_t) r->offset); perror("lseek"); } } } x = read(fs->fd, buf, readlen); DEBUG(2) - fprintf(stderr, "%d READ %d,%d,%d ret %d\n", (int) mypid, - fs->fd, readlen, r->offset, x); + fprintf(stderr, "%d READ %d,%d,%" PRINTF_OFF_T " ret %d\n", (int) mypid, + fs->fd, readlen, (squid_off_t) r->offset, x); if (x < 0) { DEBUG(1) { fprintf(stderr, "%d FD %d: ", (int) mypid, fs->fd); @@ -176,14 +176,14 @@ if (r->offset > -1 && r->offset != fs->offset) { if (lseek(fs->fd, r->offset, SEEK_SET) < 0) { DEBUG(1) { - fprintf(stderr, "%d FD %d, offset %d: ", (int) mypid, fs->fd, r->offset); + fprintf(stderr, "%d FD %d, offset %" PRINTF_OFF_T ": ", (int) mypid, fs->fd, (squid_off_t) r->offset); perror("lseek"); } } } DEBUG(2) - fprintf(stderr, "%d WRITE %d,%d,%d\n", (int) mypid, - fs->fd, wrtlen, r->offset); + fprintf(stderr, "%d WRITE %d,%d,%" PRINTF_OFF_T "\n", (int) mypid, + fs->fd, wrtlen, (squid_off_t) r->offset); x = write(fs->fd, buf, wrtlen); if (x < 0) { DEBUG(1) { diff -ruN squid-2.5.STABLE9/src/fs/diskd/store_dir_diskd.c squid-2.5.STABLE10/src/fs/diskd/store_dir_diskd.c --- squid-2.5.STABLE9/src/fs/diskd/store_dir_diskd.c Wed Jul 23 15:00:34 2003 +++ squid-2.5.STABLE10/src/fs/diskd/store_dir_diskd.c Sun May 1 04:48:07 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_diskd.c,v 1.58.2.8 2003/07/23 21:00:34 wessels Exp $ + * $Id: store_dir_diskd.c,v 1.58.2.12 2005/05/01 10:48:07 serassio Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -86,7 +86,7 @@ static int storeDiskdDirGetNextFile(RebuildState *, sfileno *, int *size); static StoreEntry *storeDiskdDirAddDiskRestore(SwapDir * SD, const cache_key * key, sfileno file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -452,18 +452,18 @@ storeAppendPrintf(sentry, "open_fail_queue_len: %d\n", diskd_stats.open_fail_queue_len); storeAppendPrintf(sentry, "block_queue_len: %d\n", diskd_stats.block_queue_len); diskd_stats.max_away = diskd_stats.max_shmuse = 0; - storeAppendPrintf(sentry, "\n OPS SUCCESS FAIL\n"); - storeAppendPrintf(sentry, "%7s %7d %7d %7d\n", + storeAppendPrintf(sentry, "\n OPS SUCCESS FAIL\n"); + storeAppendPrintf(sentry, "%7s %9d %9d %7d\n", "open", diskd_stats.open.ops, diskd_stats.open.success, diskd_stats.open.fail); - storeAppendPrintf(sentry, "%7s %7d %7d %7d\n", + storeAppendPrintf(sentry, "%7s %9d %9d %7d\n", "create", diskd_stats.create.ops, diskd_stats.create.success, diskd_stats.create.fail); - storeAppendPrintf(sentry, "%7s %7d %7d %7d\n", + storeAppendPrintf(sentry, "%7s %9d %9d %7d\n", "close", diskd_stats.close.ops, diskd_stats.close.success, diskd_stats.close.fail); - storeAppendPrintf(sentry, "%7s %7d %7d %7d\n", + storeAppendPrintf(sentry, "%7s %9d %9d %7d\n", "unlink", diskd_stats.unlink.ops, diskd_stats.unlink.success, diskd_stats.unlink.fail); - storeAppendPrintf(sentry, "%7s %7d %7d %7d\n", + storeAppendPrintf(sentry, "%7s %9d %9d %7d\n", "read", diskd_stats.read.ops, diskd_stats.read.success, diskd_stats.read.fail); - storeAppendPrintf(sentry, "%7s %7d %7d %7d\n", + storeAppendPrintf(sentry, "%7s %9d %9d %7d\n", "write", diskd_stats.write.ops, diskd_stats.write.success, diskd_stats.write.fail); } @@ -528,7 +528,7 @@ storeDiskdHandle(&M); retval = 1; /* Return that we've actually done some work */ if (M.shm_offset > -1) - storeDiskdShmPut(SD, (off_t) M.shm_offset); + storeDiskdShmPut(SD, M.shm_offset); } return retval; } @@ -536,6 +536,24 @@ static void +storeDiskdDirRebuildComplete(RebuildState * rb) +{ + if (rb->log) { + debug(47, 1) ("Done reading %s swaplog (%d entries)\n", + rb->sd->path, rb->n_read); + fclose(rb->log); + rb->log = NULL; + } else { + debug(47, 1) ("Done scanning %s (%d entries)\n", + rb->sd->path, rb->counts.scancount); + } + store_dirs_rebuilding--; + storeDiskdDirCloseTmpSwapLog(rb->sd); + storeRebuildComplete(&rb->counts); + cbdataFree(rb); +} + +static void storeDiskdDirRebuildFromDirectory(void *data) { RebuildState *rb = data; @@ -558,12 +576,7 @@ assert(fd == -1); fd = storeDiskdDirGetNextFile(rb, &filn, &size); if (fd == -2) { - debug(20, 1) ("Done scanning %s swaplog (%d entries)\n", - rb->sd->path, rb->n_read); - store_dirs_rebuilding--; - storeDiskdDirCloseTmpSwapLog(rb->sd); - storeRebuildComplete(&rb->counts); - cbdataFree(rb); + storeDiskdDirRebuildComplete(rb); return; } else if (fd < 0) { continue; @@ -615,10 +628,39 @@ assert(t->length == MD5_DIGEST_CHARS); xmemcpy(key, t->value, MD5_DIGEST_CHARS); break; +#if SIZEOF_SQUID_FILE_SZ == SIZEOF_SIZE_T case STORE_META_STD: assert(t->length == STORE_HDR_METASIZE); xmemcpy(&tmpe.timestamp, t->value, STORE_HDR_METASIZE); break; +#else + case STORE_META_STD_LFS: + assert(t->length == STORE_HDR_METASIZE); + xmemcpy(&tmpe.timestamp, t->value, STORE_HDR_METASIZE); + break; + case STORE_META_STD: + assert(t->length == STORE_HDR_METASIZE_OLD); + { + struct { + time_t timestamp; + time_t lastref; + time_t expires; + time_t lastmod; + size_t swap_file_sz; + u_short refcount; + u_short flags; + } *tmp = t->value; + assert(sizeof(*tmp) == STORE_HDR_METASIZE_OLD); + tmpe.timestamp = tmp->timestamp; + tmpe.lastref = tmp->lastref; + tmpe.expires = tmp->expires; + tmpe.lastmod = tmp->lastmod; + tmpe.swap_file_sz = tmp->swap_file_sz; + tmpe.refcount = tmp->refcount; + tmpe.flags = tmp->flags; + } + break; +#endif default: break; } @@ -692,21 +734,203 @@ /* load a number of objects per invocation */ for (count = 0; count < rb->speed; count++) { if (fread(&s, ss, 1, rb->log) != 1) { - debug(20, 1) ("Done reading %s swaplog (%d entries)\n", - rb->sd->path, rb->n_read); - fclose(rb->log); - rb->log = NULL; - store_dirs_rebuilding--; - storeDiskdDirCloseTmpSwapLog(rb->sd); - storeRebuildComplete(&rb->counts); - cbdataFree(rb); + storeDiskdDirRebuildComplete(rb); return; } rb->n_read++; - if (s.op <= SWAP_LOG_NOP) + /* + * BC: during 2.4 development, we changed the way swap file + * numbers are assigned and stored. The high 16 bits used + * to encode the SD index number. There used to be a call + * to storeDirProperFileno here that re-assigned the index + * bits. Now, for backwards compatibility, we just need + * to mask it off. + */ + s.swap_filen &= 0x00FFFFFF; + debug(20, 3) ("storeDiskdDirRebuildFromSwapLog: %s %s %08X\n", + swap_log_op_str[(int) s.op], + storeKeyText(s.key), + s.swap_filen); + if (s.op == SWAP_LOG_ADD) { + /* + * Here we have some special checks for large files. + * I've been seeing a system crash followed by a reboot + * that seems to corrupt the swap log. Squid believes + * that the disk holds some really large files. It + * complains about using being over the high water mark + * and proceeds to delete files as fast as it can. To + * prevent that, we call stat() on sufficiently large + * files (>128KB) and reject those that are missing or + * have the wrong size. + */ + struct stat sb; + char *p = storeDiskdDirFullPath(SD, s.swap_filen, NULL); + if (s.swap_file_sz < (1 << 17)) { + (void) 0; + } else if (stat(p, &sb) < 0) { + debug(47, 2) ("its missing!: %s\n", p); + continue; + } else if (sb.st_size != s.swap_file_sz) { + debug(47, 2) ("size mismatch!: stat=%d, log=%d\n", + (int) sb.st_size, (int) s.swap_file_sz); + continue; + } else { + debug(47, 2) ("big file (%d bytes) checks out\n", + (int) s.swap_file_sz); + } + } else if (s.op == SWAP_LOG_DEL) { + /* Delete unless we already have a newer copy */ + if ((e = storeGet(s.key)) != NULL && s.lastref > e->lastref) { + /* + * Make sure we don't unlink the file, it might be + * in use by a subsequent entry. Also note that + * we don't have to subtract from store_swap_size + * because adding to store_swap_size happens in + * the cleanup procedure. + */ + storeExpireNow(e); + storeReleaseRequest(e); + if (e->swap_filen > -1) { + storeDiskdDirReplRemove(e); + storeDiskdDirMapBitReset(SD, e->swap_filen); + e->swap_filen = -1; + e->swap_dirn = -1; + } + storeRelease(e); + rb->counts.objcount--; + rb->counts.cancelcount++; + } + continue; + } else { + x = log(++rb->counts.bad_log_op) / log(10.0); + if (0.0 == x - (double) (int) x) + debug(20, 1) ("WARNING: %d invalid swap log entries found\n", + rb->counts.bad_log_op); + rb->counts.invalid++; + continue; + } + if ((++rb->counts.scancount & 0xFFF) == 0) { + struct stat sb; + if (0 == fstat(fileno(rb->log), &sb)) + storeRebuildProgress(SD->index, + (int) sb.st_size / ss, rb->n_read); + } + if (!storeDiskdDirValidFileno(SD, s.swap_filen, 0)) { + rb->counts.invalid++; + continue; + } + if (EBIT_TEST(s.flags, KEY_PRIVATE)) { + rb->counts.badflags++; + continue; + } + e = storeGet(s.key); + used = storeDiskdDirMapBitTest(SD, s.swap_filen); + /* If this URL already exists in the cache, does the swap log + * appear to have a newer entry? Compare 'lastref' from the + * swap log to e->lastref. */ + disk_entry_newer = e ? (s.lastref > e->lastref ? 1 : 0) : 0; + if (used && !disk_entry_newer) { + /* log entry is old, ignore it */ + rb->counts.clashcount++; + continue; + } else if (used && e && e->swap_filen == s.swap_filen && e->swap_dirn == SD->index) { + /* swapfile taken, same URL, newer, update meta */ + if (e->store_status == STORE_OK) { + e->lastref = s.timestamp; + e->timestamp = s.timestamp; + e->expires = s.expires; + e->lastmod = s.lastmod; + e->flags = s.flags; + e->refcount += s.refcount; + storeDiskdDirUnrefObj(SD, e); + } else { + debug_trap("storeDiskdDirRebuildFromSwapLog: bad condition"); + debug(20, 1) ("\tSee %s:%d\n", __FILE__, __LINE__); + } continue; - if (s.op >= SWAP_LOG_MAX) + } else if (used) { + /* swapfile in use, not by this URL, log entry is newer */ + /* This is sorta bad: the log entry should NOT be newer at this + * point. If the log is dirty, the filesize check should have + * caught this. If the log is clean, there should never be a + * newer entry. */ + debug(20, 1) ("WARNING: newer swaplog entry for dirno %d, fileno %08X\n", + SD->index, s.swap_filen); + /* I'm tempted to remove the swapfile here just to be safe, + * but there is a bad race condition in the NOVM version if + * the swapfile has recently been opened for writing, but + * not yet opened for reading. Because we can't map + * swapfiles back to StoreEntrys, we don't know the state + * of the entry using that file. */ + /* We'll assume the existing entry is valid, probably because + * were in a slow rebuild and the the swap file number got taken + * and the validation procedure hasn't run. */ + assert(rb->flags.need_to_validate); + rb->counts.clashcount++; + continue; + } else if (e && !disk_entry_newer) { + /* key already exists, current entry is newer */ + /* keep old, ignore new */ + rb->counts.dupcount++; continue; + } else if (e) { + /* key already exists, this swapfile not being used */ + /* junk old, load new */ + storeExpireNow(e); + storeReleaseRequest(e); + if (e->swap_filen > -1) { + storeDiskdDirReplRemove(e); + /* Make sure we don't actually unlink the file */ + storeDiskdDirMapBitReset(SD, e->swap_filen); + e->swap_filen = -1; + e->swap_dirn = -1; + } + storeRelease(e); + rb->counts.dupcount++; + } else { + /* URL doesnt exist, swapfile not in use */ + /* load new */ + (void) 0; + } + /* update store_swap_size */ + rb->counts.objcount++; + e = storeDiskdDirAddDiskRestore(SD, s.key, + s.swap_filen, + s.swap_file_sz, + s.expires, + s.timestamp, + s.lastref, + s.lastmod, + s.refcount, + s.flags, + (int) rb->flags.clean); + storeDirSwapLog(e, SWAP_LOG_ADD); + } + eventAdd("storeRebuild", storeDiskdDirRebuildFromSwapLog, rb, 0.0, 1); +} + +#if SIZEOF_SQUID_FILE_SZ != SIZEOF_SIZE_T +/* This is an exact copy of the above, but using storeSwapLogDataOld entry type */ +static void +storeDiskdDirRebuildFromSwapLogOld(void *data) +{ + RebuildState *rb = data; + SwapDir *SD = rb->sd; + StoreEntry *e = NULL; + storeSwapLogDataOld s; + size_t ss = sizeof(storeSwapLogDataOld); + int count; + int used; /* is swapfile already in use? */ + int disk_entry_newer; /* is the log entry newer than current entry? */ + double x; + assert(rb != NULL); + /* load a number of objects per invocation */ + for (count = 0; count < rb->speed; count++) { + if (fread(&s, ss, 1, rb->log) != 1) { + storeDiskdDirRebuildComplete(rb); + return; + } + rb->n_read++; /* * BC: during 2.4 development, we changed the way swap file * numbers are assigned and stored. The high 16 bits used @@ -875,7 +1099,49 @@ (int) rb->flags.clean); storeDirSwapLog(e, SWAP_LOG_ADD); } + eventAdd("storeRebuild", storeDiskdDirRebuildFromSwapLogOld, rb, 0.0, 1); +} + +#endif + +static void +storeDiskdDirRebuildFromSwapLogCheckVersion(void *data) +{ + RebuildState *rb = data; + storeSwapLogHeader hdr; + + if (fread(&hdr, sizeof(hdr), 1, rb->log) != 1) { + storeDiskdDirRebuildComplete(rb); + return; + } + if (hdr.op == SWAP_LOG_VERSION) { + if (fseek(rb->log, hdr.record_size, SEEK_SET) != 0) { + storeDiskdDirRebuildComplete(rb); + return; + } + if (hdr.version == 1 && hdr.record_size == sizeof(storeSwapLogData)) { + eventAdd("storeRebuild", storeDiskdDirRebuildFromSwapLog, rb, 0.0, 1); + return; + } +#if SIZEOF_SQUID_FILE_SZ != SIZEOF_SIZE_T + if (hdr.version == 1 && hdr.record_size == sizeof(storeSwapLogDataOld)) { + debug(47, 1) ("storeDiskdDirRebuildFromSwapLog: Found current version but without large file support. Upgrading\n"); + eventAdd("storeRebuild", storeDiskdDirRebuildFromSwapLogOld, rb, 0.0, 1); + return; + } +#endif + debug(47, 1) ("storeDiskdDirRebuildFromSwapLog: Unsupported swap.state version %d size %d\n", + hdr.version, hdr.record_size); + storeDiskdDirRebuildComplete(rb); + return; + } + rewind(rb->log); + debug(47, 1) ("storeDiskdDirRebuildFromSwapLog: Old version detected. Upgrading\n"); +#if SIZEOF_SQUID_FILE_SZ == SIZEOF_SIZE_T eventAdd("storeRebuild", storeDiskdDirRebuildFromSwapLog, rb, 0.0, 1); +#else + eventAdd("storeRebuild", storeDiskdDirRebuildFromSwapLogOld, rb, 0.0, 1); +#endif } static int @@ -970,7 +1236,7 @@ static StoreEntry * storeDiskdDirAddDiskRestore(SwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -1034,7 +1300,7 @@ fclose(fp); func = storeDiskdDirRebuildFromDirectory; } else { - func = storeDiskdDirRebuildFromSwapLog; + func = storeDiskdDirRebuildFromSwapLogCheckVersion; rb->log = fp; rb->flags.clean = (unsigned int) clean; } @@ -1054,12 +1320,6 @@ char *new_path = xstrdup(storeDiskdDirSwapLogFile(sd, ".new")); int fd; file_close(diskdinfo->swaplog_fd); -#ifdef _SQUID_OS2_ - if (unlink(swaplog_path) < 0) { - debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror()); - fatal("storeDiskdDirCloseTmpSwapLog: unlink failed"); - } -#endif if (xrename(new_path, swaplog_path) < 0) { fatal("storeDiskdDirCloseTmpSwapLog: rename failed"); } @@ -1074,6 +1334,31 @@ debug(47, 3) ("Cache Dir #%d log opened on FD %d\n", sd->index, fd); } +static void +storeSwapLogDataFree(void *s) +{ + memFree(s, MEM_SWAP_LOG_DATA); +} + +static void +storeDiskdWriteSwapLogheader(int fd) +{ + storeSwapLogHeader *hdr = memAllocate(MEM_SWAP_LOG_DATA); + hdr->op = SWAP_LOG_VERSION; + hdr->version = 1; + hdr->record_size = sizeof(storeSwapLogData); + /* The header size is a full log record to keep some level of backward + * compatibility even if the actual header is smaller + */ + file_write(fd, + -1, + hdr, + sizeof(storeSwapLogData), + NULL, + NULL, + (FREE *) storeSwapLogDataFree); +} + static FILE * storeDiskdDirOpenTmpSwapLog(SwapDir * sd, int *clean_flag, int *zero_flag) { @@ -1103,6 +1388,7 @@ fatal("storeDirOpenTmpSwapLog: Failed to open swap log."); } diskdinfo->swaplog_fd = fd; + storeDiskdWriteSwapLogheader(fd); /* open a read-only stream of the old log */ fp = fopen(swaplog_path, "r"); if (fp == NULL) { @@ -1128,7 +1414,7 @@ char *new; char *cln; char *outbuf; - off_t outbuf_offset; + int outbuf_offset; int fd; RemovalPolicyWalker *walker; }; @@ -1165,6 +1451,7 @@ } debug(20, 3) ("storeDirWriteCleanLogs: opened %s, FD %d\n", state->new, state->fd); + storeDiskdWriteSwapLogheader(state->fd); #if HAVE_FCHMOD if (stat(state->cur, &sb) == 0) fchmod(state->fd, sb.st_mode); @@ -1256,9 +1543,6 @@ #ifdef _SQUID_OS2_ file_close(state->fd); state->fd = -1; - if (unlink(cur) < 0) - debug(50, 0) ("storeDirWriteCleanLogs: unlinkd failed: %s, %s\n", - xstrerror(), cur); #endif xrename(state->new, state->cur); } @@ -1282,12 +1566,6 @@ } static void -storeSwapLogDataFree(void *s) -{ - memFree(s, MEM_SWAP_LOG_DATA); -} - -static void storeDiskdDirSwapLog(const SwapDir * sd, const StoreEntry * e, int op) { diskdinfo_t *diskdinfo = sd->fsdata; @@ -1636,7 +1914,7 @@ */ void * -storeDiskdShmGet(SwapDir * sd, off_t * shm_offset) +storeDiskdShmGet(SwapDir * sd, int *shm_offset) { char *buf = NULL; diskdinfo_t *diskdinfo = sd->fsdata; @@ -1659,7 +1937,7 @@ } void -storeDiskdShmPut(SwapDir * sd, off_t offset) +storeDiskdShmPut(SwapDir * sd, int offset) { int i; diskdinfo_t *diskdinfo = sd->fsdata; diff -ruN squid-2.5.STABLE9/src/fs/diskd/store_diskd.h squid-2.5.STABLE10/src/fs/diskd/store_diskd.h --- squid-2.5.STABLE9/src/fs/diskd/store_diskd.h Tue Jul 10 09:35:45 2001 +++ squid-2.5.STABLE10/src/fs/diskd/store_diskd.h Sat Mar 26 16:29:56 2005 @@ -59,7 +59,7 @@ int seq_no; void *callback_data; int size; - int offset; + off_t offset; int status; int shm_offset; } diomsg; @@ -95,8 +95,8 @@ extern void storeDiskdDirUnlinkFile(SwapDir *, sfileno); extern void storeDiskdDirReplAdd(SwapDir *, StoreEntry *); extern void storeDiskdDirReplRemove(StoreEntry *); -extern void storeDiskdShmPut(SwapDir *, off_t); -extern void *storeDiskdShmGet(SwapDir *, off_t *); +extern void storeDiskdShmPut(SwapDir *, int); +extern void *storeDiskdShmGet(SwapDir *, int *); extern void storeDiskdHandle(diomsg * M); extern int storeDiskdDirCallback(SwapDir *); diff -ruN squid-2.5.STABLE9/src/fs/diskd/store_io_diskd.c squid-2.5.STABLE10/src/fs/diskd/store_io_diskd.c --- squid-2.5.STABLE9/src/fs/diskd/store_io_diskd.c Thu Aug 8 14:17:41 2002 +++ squid-2.5.STABLE10/src/fs/diskd/store_io_diskd.c Fri Mar 25 19:50:55 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_io_diskd.c,v 1.22.2.3 2002/08/08 20:17:41 hno Exp $ + * $Id: store_io_diskd.c,v 1.22.2.4 2005/03/26 02:50:55 hno Exp $ * * DEBUG: section 79 Squid-side DISKD I/O functions. * AUTHOR: Duane Wessels @@ -42,7 +42,7 @@ #include "store_diskd.h" -static int storeDiskdSend(int, SwapDir *, int, storeIOState *, int, int, off_t); +static int storeDiskdSend(int, SwapDir *, int, storeIOState *, int, off_t, int); static void storeDiskdIOCallback(storeIOState * sio, int errflag); static CBDUNL storeDiskdIOFreeEntry; @@ -59,7 +59,7 @@ storeIOState *sio; char *buf; diskdstate_t *diskdstate; - off_t shm_offset; + int shm_offset; diskdinfo_t *diskdinfo = SD->fsdata; debug(79, 3) ("storeDiskdOpen: fileno %08X\n", f); /* @@ -115,7 +115,7 @@ int x; storeIOState *sio; char *buf; - off_t shm_offset; + int shm_offset; diskdinfo_t *diskdinfo = SD->fsdata; diskdstate_t *diskdstate; /* @@ -191,10 +191,10 @@ } void -storeDiskdRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +storeDiskdRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { int x; - off_t shm_offset; + int shm_offset; char *rbuf; diskdstate_t *diskdstate = sio->fsstate; debug(79, 3) ("storeDiskdRead: dirno %d, fileno %08X\n", sio->swap_dirn, sio->swap_filen); @@ -219,8 +219,8 @@ SD, diskdstate->id, sio, - (int) size, - (int) offset, + size, + (off_t) offset, shm_offset); if (x < 0) { debug(79, 1) ("storeDiskdSend READ: %s\n", xstrerror()); @@ -231,11 +231,11 @@ } void -storeDiskdWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func) +storeDiskdWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { int x; char *sbuf; - off_t shm_offset; + int shm_offset; diskdstate_t *diskdstate = sio->fsstate; debug(79, 3) ("storeDiskdWrite: dirno %d, fileno %08X\n", SD->index, sio->swap_filen); assert(!diskdstate->flags.close_request); @@ -252,8 +252,8 @@ SD, diskdstate->id, sio, - (int) size, - (int) offset, + size, + (off_t) offset, shm_offset); if (x < 0) { debug(79, 1) ("storeDiskdSend WRITE: %s\n", xstrerror()); @@ -267,7 +267,7 @@ storeDiskdUnlink(SwapDir * SD, StoreEntry * e) { int x; - off_t shm_offset; + int shm_offset; char *buf; diskdinfo_t *diskdinfo = SD->fsdata; @@ -462,7 +462,7 @@ } static int -storeDiskdSend(int mtype, SwapDir * sd, int id, storeIOState * sio, int size, int offset, off_t shm_offset) +storeDiskdSend(int mtype, SwapDir * sd, int id, storeIOState * sio, int size, off_t offset, int shm_offset) { int x; diomsg M; diff -ruN squid-2.5.STABLE9/src/fs/null/Makefile.in squid-2.5.STABLE10/src/fs/null/Makefile.in --- squid-2.5.STABLE9/src/fs/null/Makefile.in Sat Jul 10 06:11:50 2004 +++ squid-2.5.STABLE10/src/fs/null/Makefile.in Fri Mar 18 17:55:56 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/fs/ufs/Makefile.in squid-2.5.STABLE10/src/fs/ufs/Makefile.in --- squid-2.5.STABLE9/src/fs/ufs/Makefile.in Sat Jul 10 06:11:50 2004 +++ squid-2.5.STABLE10/src/fs/ufs/Makefile.in Fri Mar 18 17:55:56 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/fs/ufs/store_dir_ufs.c squid-2.5.STABLE10/src/fs/ufs/store_dir_ufs.c --- squid-2.5.STABLE9/src/fs/ufs/store_dir_ufs.c Wed Aug 25 15:07:25 2004 +++ squid-2.5.STABLE10/src/fs/ufs/store_dir_ufs.c Sat Mar 26 16:27:11 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.c,v 1.39.2.10 2004/08/25 21:07:25 hno Exp $ + * $Id: store_dir_ufs.c,v 1.39.2.13 2005/03/26 23:27:11 serassio Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -80,7 +80,7 @@ static int storeUfsDirGetNextFile(RebuildState *, sfileno *, int *size); static StoreEntry *storeUfsDirAddDiskRestore(SwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -373,6 +373,24 @@ } static void +storeUfsDirRebuildComplete(RebuildState * rb) +{ + if (rb->log) { + debug(47, 1) ("Done reading %s swaplog (%d entries)\n", + rb->sd->path, rb->n_read); + fclose(rb->log); + rb->log = NULL; + } else { + debug(47, 1) ("Done scanning %s (%d entries)\n", + rb->sd->path, rb->counts.scancount); + } + store_dirs_rebuilding--; + storeUfsDirCloseTmpSwapLog(rb->sd); + storeRebuildComplete(&rb->counts); + cbdataFree(rb); +} + +static void storeUfsDirRebuildFromDirectory(void *data) { RebuildState *rb = data; @@ -395,12 +413,7 @@ assert(fd == -1); fd = storeUfsDirGetNextFile(rb, &filn, &size); if (fd == -2) { - debug(47, 1) ("Done scanning %s swaplog (%d entries)\n", - rb->sd->path, rb->n_read); - store_dirs_rebuilding--; - storeUfsDirCloseTmpSwapLog(rb->sd); - storeRebuildComplete(&rb->counts); - cbdataFree(rb); + storeUfsDirRebuildComplete(rb); return; } else if (fd < 0) { continue; @@ -452,10 +465,39 @@ assert(t->length == MD5_DIGEST_CHARS); xmemcpy(key, t->value, MD5_DIGEST_CHARS); break; +#if SIZEOF_SQUID_FILE_SZ == SIZEOF_SIZE_T case STORE_META_STD: assert(t->length == STORE_HDR_METASIZE); xmemcpy(&tmpe.timestamp, t->value, STORE_HDR_METASIZE); break; +#else + case STORE_META_STD_LFS: + assert(t->length == STORE_HDR_METASIZE); + xmemcpy(&tmpe.timestamp, t->value, STORE_HDR_METASIZE); + break; + case STORE_META_STD: + assert(t->length == STORE_HDR_METASIZE_OLD); + { + struct { + time_t timestamp; + time_t lastref; + time_t expires; + time_t lastmod; + size_t swap_file_sz; + u_short refcount; + u_short flags; + } *tmp = t->value; + assert(sizeof(*tmp) == STORE_HDR_METASIZE_OLD); + tmpe.timestamp = tmp->timestamp; + tmpe.lastref = tmp->lastref; + tmpe.expires = tmp->expires; + tmpe.lastmod = tmp->lastmod; + tmpe.swap_file_sz = tmp->swap_file_sz; + tmpe.refcount = tmp->refcount; + tmpe.flags = tmp->flags; + } + break; +#endif default: break; } @@ -529,21 +571,178 @@ /* load a number of objects per invocation */ for (count = 0; count < rb->speed; count++) { if (fread(&s, ss, 1, rb->log) != 1) { - debug(47, 1) ("Done reading %s swaplog (%d entries)\n", - rb->sd->path, rb->n_read); - fclose(rb->log); - rb->log = NULL; - store_dirs_rebuilding--; - storeUfsDirCloseTmpSwapLog(rb->sd); - storeRebuildComplete(&rb->counts); - cbdataFree(rb); + storeUfsDirRebuildComplete(rb); return; } rb->n_read++; - if (s.op <= SWAP_LOG_NOP) + /* + * BC: during 2.4 development, we changed the way swap file + * numbers are assigned and stored. The high 16 bits used + * to encode the SD index number. There used to be a call + * to storeDirProperFileno here that re-assigned the index + * bits. Now, for backwards compatibility, we just need + * to mask it off. + */ + s.swap_filen &= 0x00FFFFFF; + debug(47, 3) ("storeUfsDirRebuildFromSwapLog: %s %s %08X\n", + swap_log_op_str[(int) s.op], + storeKeyText(s.key), + s.swap_filen); + if (s.op == SWAP_LOG_ADD) { + (void) 0; + } else if (s.op == SWAP_LOG_DEL) { + /* Delete unless we already have a newer copy */ + if ((e = storeGet(s.key)) != NULL && s.lastref > e->lastref) { + /* + * Make sure we don't unlink the file, it might be + * in use by a subsequent entry. Also note that + * we don't have to subtract from store_swap_size + * because adding to store_swap_size happens in + * the cleanup procedure. + */ + storeExpireNow(e); + storeReleaseRequest(e); + if (e->swap_filen > -1) { + storeUfsDirReplRemove(e); + storeUfsDirMapBitReset(SD, e->swap_filen); + e->swap_filen = -1; + e->swap_dirn = -1; + } + storeRelease(e); + rb->counts.objcount--; + rb->counts.cancelcount++; + } continue; - if (s.op >= SWAP_LOG_MAX) + } else { + x = log(++rb->counts.bad_log_op) / log(10.0); + if (0.0 == x - (double) (int) x) + debug(47, 1) ("WARNING: %d invalid swap log entries found\n", + rb->counts.bad_log_op); + rb->counts.invalid++; + continue; + } + if ((++rb->counts.scancount & 0xFFF) == 0) { + struct stat sb; + if (0 == fstat(fileno(rb->log), &sb)) + storeRebuildProgress(SD->index, + (int) sb.st_size / ss, rb->n_read); + } + if (!storeUfsDirValidFileno(SD, s.swap_filen, 0)) { + rb->counts.invalid++; + continue; + } + if (EBIT_TEST(s.flags, KEY_PRIVATE)) { + rb->counts.badflags++; + continue; + } + e = storeGet(s.key); + used = storeUfsDirMapBitTest(SD, s.swap_filen); + /* If this URL already exists in the cache, does the swap log + * appear to have a newer entry? Compare 'lastref' from the + * swap log to e->lastref. */ + disk_entry_newer = e ? (s.lastref > e->lastref ? 1 : 0) : 0; + if (used && !disk_entry_newer) { + /* log entry is old, ignore it */ + rb->counts.clashcount++; continue; + } else if (used && e && e->swap_filen == s.swap_filen && e->swap_dirn == SD->index) { + /* swapfile taken, same URL, newer, update meta */ + if (e->store_status == STORE_OK) { + e->lastref = s.timestamp; + e->timestamp = s.timestamp; + e->expires = s.expires; + e->lastmod = s.lastmod; + e->flags = s.flags; + e->refcount += s.refcount; + storeUfsDirUnrefObj(SD, e); + } else { + debug_trap("storeUfsDirRebuildFromSwapLog: bad condition"); + debug(47, 1) ("\tSee %s:%d\n", __FILE__, __LINE__); + } + continue; + } else if (used) { + /* swapfile in use, not by this URL, log entry is newer */ + /* This is sorta bad: the log entry should NOT be newer at this + * point. If the log is dirty, the filesize check should have + * caught this. If the log is clean, there should never be a + * newer entry. */ + debug(47, 1) ("WARNING: newer swaplog entry for dirno %d, fileno %08X\n", + SD->index, s.swap_filen); + /* I'm tempted to remove the swapfile here just to be safe, + * but there is a bad race condition in the NOVM version if + * the swapfile has recently been opened for writing, but + * not yet opened for reading. Because we can't map + * swapfiles back to StoreEntrys, we don't know the state + * of the entry using that file. */ + /* We'll assume the existing entry is valid, probably because + * were in a slow rebuild and the the swap file number got taken + * and the validation procedure hasn't run. */ + assert(rb->flags.need_to_validate); + rb->counts.clashcount++; + continue; + } else if (e && !disk_entry_newer) { + /* key already exists, current entry is newer */ + /* keep old, ignore new */ + rb->counts.dupcount++; + continue; + } else if (e) { + /* key already exists, this swapfile not being used */ + /* junk old, load new */ + storeExpireNow(e); + storeReleaseRequest(e); + if (e->swap_filen > -1) { + storeUfsDirReplRemove(e); + /* Make sure we don't actually unlink the file */ + storeUfsDirMapBitReset(SD, e->swap_filen); + e->swap_filen = -1; + e->swap_dirn = -1; + } + storeRelease(e); + rb->counts.dupcount++; + } else { + /* URL doesnt exist, swapfile not in use */ + /* load new */ + (void) 0; + } + /* update store_swap_size */ + rb->counts.objcount++; + e = storeUfsDirAddDiskRestore(SD, s.key, + s.swap_filen, + s.swap_file_sz, + s.expires, + s.timestamp, + s.lastref, + s.lastmod, + s.refcount, + s.flags, + (int) rb->flags.clean); + storeDirSwapLog(e, SWAP_LOG_ADD); + } + eventAdd("storeRebuild", storeUfsDirRebuildFromSwapLog, rb, 0.0, 1); +} + +#if SIZEOF_SQUID_FILE_SZ != SIZEOF_SIZE_T +/* This is an exact copy of the above, but using storeSwapLogDataOld entry type */ +static void +storeUfsDirRebuildFromSwapLogOld(void *data) +{ + RebuildState *rb = data; + SwapDir *SD = rb->sd; + StoreEntry *e = NULL; + storeSwapLogDataOld s; + size_t ss = sizeof(storeSwapLogDataOld); + int count; + int used; /* is swapfile already in use? */ + int disk_entry_newer; /* is the log entry newer than current entry? */ + double x; + assert(rb != NULL); + /* load a number of objects per invocation */ + for (count = 0; count < rb->speed; count++) { + if (fread(&s, ss, 1, rb->log) != 1) { + storeUfsDirRebuildComplete(rb); + return; + } + rb->n_read++; /* * BC: during 2.4 development, we changed the way swap file * numbers are assigned and stored. The high 16 bits used @@ -687,7 +886,49 @@ (int) rb->flags.clean); storeDirSwapLog(e, SWAP_LOG_ADD); } + eventAdd("storeRebuild", storeUfsDirRebuildFromSwapLogOld, rb, 0.0, 1); +} + +#endif + +static void +storeUfsDirRebuildFromSwapLogCheckVersion(void *data) +{ + RebuildState *rb = data; + storeSwapLogHeader hdr; + + if (fread(&hdr, sizeof(hdr), 1, rb->log) != 1) { + storeUfsDirRebuildComplete(rb); + return; + } + if (hdr.op == SWAP_LOG_VERSION) { + if (fseek(rb->log, hdr.record_size, SEEK_SET) != 0) { + storeUfsDirRebuildComplete(rb); + return; + } + if (hdr.version == 1 && hdr.record_size == sizeof(storeSwapLogData)) { + eventAdd("storeRebuild", storeUfsDirRebuildFromSwapLog, rb, 0.0, 1); + return; + } +#if SIZEOF_SQUID_FILE_SZ != SIZEOF_SIZE_T + if (hdr.version == 1 && hdr.record_size == sizeof(storeSwapLogDataOld)) { + debug(47, 1) ("storeUfsDirRebuildFromSwapLog: Found current version but without large file support. Upgrading\n"); + eventAdd("storeRebuild", storeUfsDirRebuildFromSwapLogOld, rb, 0.0, 1); + return; + } +#endif + debug(47, 1) ("storeUfsDirRebuildFromSwapLog: Unsupported swap.state version %d size %d\n", + hdr.version, hdr.record_size); + storeUfsDirRebuildComplete(rb); + return; + } + rewind(rb->log); + debug(47, 1) ("storeUfsDirRebuildFromSwapLog: Old version detected. Upgrading\n"); +#if SIZEOF_SQUID_FILE_SZ == SIZEOF_SIZE_T eventAdd("storeRebuild", storeUfsDirRebuildFromSwapLog, rb, 0.0, 1); +#else + eventAdd("storeRebuild", storeUfsDirRebuildFromSwapLogOld, rb, 0.0, 1); +#endif } static int @@ -782,7 +1023,7 @@ static StoreEntry * storeUfsDirAddDiskRestore(SwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -845,7 +1086,7 @@ fclose(fp); func = storeUfsDirRebuildFromDirectory; } else { - func = storeUfsDirRebuildFromSwapLog; + func = storeUfsDirRebuildFromSwapLogCheckVersion; rb->log = fp; rb->flags.clean = (unsigned int) clean; } @@ -865,12 +1106,6 @@ char *new_path = xstrdup(storeUfsDirSwapLogFile(sd, ".new")); int fd; file_close(ufsinfo->swaplog_fd); -#if defined (_SQUID_OS2_) || defined (_SQUID_CYGWIN_) - if (unlink(swaplog_path) < 0) { - debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror()); - fatal("storeUfsDirCloseTmpSwapLog: unlink failed"); - } -#endif if (xrename(new_path, swaplog_path) < 0) { fatal("storeUfsDirCloseTmpSwapLog: rename failed"); } @@ -885,6 +1120,31 @@ debug(47, 3) ("Cache Dir #%d log opened on FD %d\n", sd->index, fd); } +static void +storeSwapLogDataFree(void *s) +{ + memFree(s, MEM_SWAP_LOG_DATA); +} + +static void +storeUfsWriteSwapLogheader(int fd) +{ + storeSwapLogHeader *hdr = memAllocate(MEM_SWAP_LOG_DATA); + hdr->op = SWAP_LOG_VERSION; + hdr->version = 1; + hdr->record_size = sizeof(storeSwapLogData); + /* The header size is a full log record to keep some level of backward + * compatibility even if the actual header is smaller + */ + file_write(fd, + -1, + hdr, + sizeof(storeSwapLogData), + NULL, + NULL, + (FREE *) storeSwapLogDataFree); +} + static FILE * storeUfsDirOpenTmpSwapLog(SwapDir * sd, int *clean_flag, int *zero_flag) { @@ -914,6 +1174,7 @@ fatal("storeDirOpenTmpSwapLog: Failed to open swap log."); } ufsinfo->swaplog_fd = fd; + storeUfsWriteSwapLogheader(fd); /* open a read-only stream of the old log */ fp = fopen(swaplog_path, "r"); if (fp == NULL) { @@ -942,7 +1203,7 @@ char *new; char *cln; char *outbuf; - off_t outbuf_offset; + int outbuf_offset; int fd; RemovalPolicyWalker *walker; }; @@ -973,6 +1234,7 @@ xfree(state); return -1; } + storeUfsWriteSwapLogheader(state->fd); state->cur = xstrdup(storeUfsDirSwapLogFile(sd, NULL)); state->cln = xstrdup(storeUfsDirSwapLogFile(sd, ".last-clean")); state->outbuf = xcalloc(CLEAN_BUF_SZ, 1); @@ -1072,12 +1334,9 @@ fd = state->fd; /* rename */ if (state->fd >= 0) { -#if defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_) +#if defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) file_close(state->fd); state->fd = -1; - if (unlink(state->cur) < 0) - debug(50, 0) ("storeDirWriteCleanLogs: unlinkd failed: %s, %s\n", - xstrerror(), state->cur); #endif xrename(state->new, state->cur); } @@ -1098,12 +1357,6 @@ safe_free(state); sd->log.clean.state = NULL; sd->log.clean.write = NULL; -} - -static void -storeSwapLogDataFree(void *s) -{ - memFree(s, MEM_SWAP_LOG_DATA); } static void diff -ruN squid-2.5.STABLE9/src/fs/ufs/store_io_ufs.c squid-2.5.STABLE10/src/fs/ufs/store_io_ufs.c --- squid-2.5.STABLE9/src/fs/ufs/store_io_ufs.c Sat Jul 17 13:44:20 2004 +++ squid-2.5.STABLE10/src/fs/ufs/store_io_ufs.c Sat Mar 26 15:44:10 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_io_ufs.c,v 1.9.2.4 2004/07/17 19:44:20 hno Exp $ + * $Id: store_io_ufs.c,v 1.9.2.6 2005/03/26 22:44:10 hno Exp $ * * DEBUG: section 79 Storage Manager UFS Interface * AUTHOR: Duane Wessels @@ -150,7 +150,7 @@ } void -storeUfsRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +storeUfsRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { ufsstate_t *ufsstate = (ufsstate_t *) sio->fsstate; @@ -166,19 +166,19 @@ file_read(ufsstate->fd, buf, size, - offset, + (off_t) offset, storeUfsReadDone, sio); } void -storeUfsWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func) +storeUfsWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { ufsstate_t *ufsstate = (ufsstate_t *) sio->fsstate; debug(79, 3) ("storeUfsWrite: dirn %d, fileno %08X, FD %d\n", sio->swap_dirn, sio->swap_filen, ufsstate->fd); ufsstate->flags.writing = 1; file_write(ufsstate->fd, - offset, + (off_t) offset, buf, size, storeUfsWriteDone, @@ -213,7 +213,7 @@ debug(79, 3) ("storeUfsReadDone: got failure (%d)\n", errflag); rlen = -1; } else { - rlen = (ssize_t) len; + rlen = len; sio->offset += len; } assert(callback); @@ -221,7 +221,7 @@ sio->read.callback = NULL; sio->read.callback_data = NULL; if (cbdataValid(their_data)) - callback(their_data, buf, (size_t) rlen); + callback(their_data, buf, rlen); cbdataUnlock(their_data); } diff -ruN squid-2.5.STABLE9/src/ftp.c squid-2.5.STABLE10/src/ftp.c --- squid-2.5.STABLE9/src/ftp.c Sun Feb 20 20:35:08 2005 +++ squid-2.5.STABLE10/src/ftp.c Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.316.2.21 2005/02/21 03:35:08 hno Exp $ + * $Id: ftp.c,v 1.316.2.25 2005/03/26 02:50:53 hno Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -93,14 +93,14 @@ int login_att; ftp_state_t state; time_t mdtm; - int size; + squid_off_t size; wordlist *pathcomps; char *filepath; - int restart_offset; - int restarted_offset; + squid_off_t restart_offset; + squid_off_t restarted_offset; int rest_att; char *proxy_host; - size_t list_width; + int list_width; wordlist *cwd_message; char *old_request; char *old_reply; @@ -110,7 +110,7 @@ int fd; char *buf; size_t size; - off_t offset; + size_t offset; FREE *freefunc; wordlist *message; char *last_command; @@ -121,7 +121,7 @@ int fd; char *buf; size_t size; - off_t offset; + size_t offset; FREE *freefunc; char *host; u_short port; @@ -132,7 +132,7 @@ typedef struct { char type; - int size; + squid_off_t size; char *date; char *name; char *showname; @@ -537,7 +537,7 @@ month, day, year); if ((t = strstr(buf, tbuf))) { p->type = *tokens[0]; - p->size = atoi(size); + p->size = strto_off_t(size, NULL, 10); p->date = xstrdup(tbuf); if (flags.skip_whitespace) { t += strlen(tbuf); @@ -566,7 +566,7 @@ p->type = 'd'; } else { p->type = '-'; - p->size = atoi(tokens[2]); + p->size = strto_off_t(tokens[2], NULL, 10); } snprintf(tbuf, 128, "%s %s", tokens[0], tokens[1]); p->date = xstrdup(tbuf); @@ -595,7 +595,7 @@ p->type = 0; while (ct && *ct) { time_t t; - int l = strcspn(ct + 1, ","); + int l = strcspn(ct, ","); char *tmp; if (l < 1) goto blank; @@ -604,11 +604,11 @@ p->name = xstrndup(ct + 1, l + 1); break; case 's': - p->size = atoi(ct + 1); + p->size = strto_off_t(ct + 1, NULL, 10); break; case 'm': - t = (time_t) strtol(ct + 1, &tmp, 0); - if (*tmp || (tmp == ct + 1)) + t = (time_t) strto_off_t(ct + 1, &tmp, 0); + if (tmp != ct + l) break; /* not a valid integer */ p->date = xstrdup(ctime(&t)); *(strstr(p->date, "\n")) = '\0'; @@ -728,8 +728,6 @@ ftpListPartsFree(&parts); return html; } - parts->size += 1023; - parts->size >>= 10; parts->showname = xstrdup(parts->name); if (!Config.Ftp.list_wrap) { if (strlen(parts->showname) > width - 1) { @@ -771,10 +769,26 @@ break; case '-': default: - snprintf(icon, 2048, "\"%-6s\"", - mimeGetIconURL(parts->name), - "[FILE]"); - snprintf(size, 2048, " %6dk", parts->size); + { + squid_off_t sz = parts->size; + char units = ' '; + snprintf(icon, 2048, "\"%-6s\"", + mimeGetIconURL(parts->name), + "[FILE]"); + if (sz > 10 * 1024) { + sz = (sz + 1023) >> 10; + units = 'K'; + } + if (sz > 10 * 1024) { + sz = (sz + 1023) >> 10; + units = 'M'; + } + if (sz > 10 * 1024) { + sz = (sz + 1023) >> 10; + units = 'G'; + } + snprintf(size, 2048, " %6" PRINTF_OFF_T "%c", sz, units); + } break; } if (parts->type != 'd') { @@ -818,7 +832,7 @@ size_t linelen; size_t usable; StoreEntry *e = ftpState->entry; - int len = ftpState->data.offset; + size_t len = ftpState->data.offset; /* * We need a NULL-terminated buffer for scanning, ick */ @@ -834,7 +848,7 @@ xfree(sbuf); return; } - debug(9, 3) ("ftpParseListing: %d bytes to play with\n", len); + debug(9, 3) ("ftpParseListing: %d bytes to play with\n", (int) len); line = memAllocate(MEM_4K_BUF); end++; storeBuffer(e); @@ -1224,8 +1238,8 @@ wordlist *head = NULL; wordlist *list; wordlist **tail = &head; - off_t offset; - size_t linelen; + int offset; + int linelen; int code = -1; debug(9, 5) ("ftpParseControlReply\n"); /* @@ -1648,6 +1662,7 @@ debug(9, 3) ("Directory path did not end in /\n"); strCat(ftpState->title_url, "/"); ftpState->flags.isdir = 1; + ftpState->flags.use_base = 1; } ftpSendPasv(ftpState); } @@ -1698,7 +1713,7 @@ debug(9, 3) ("This is ftpReadSize\n"); if (code == 213) { ftpUnhack(ftpState); - ftpState->size = atoi(ftpState->ctrl.last_reply); + ftpState->size = strto_off_t(ftpState->ctrl.last_reply, NULL, 10); if (ftpState->size == 0) { debug(9, 2) ("ftpReadSize: SIZE reported %s on %s\n", ftpState->ctrl.last_reply, @@ -1800,16 +1815,10 @@ /* 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2). */ /* ANSI sez [^0-9] is undefined, it breaks on Watcom cc */ debug(9, 5) ("scanning: %s\n", ftpState->ctrl.last_reply); - buf = strstr(ftpState->ctrl.last_reply, "("); - if (!buf) { - debug(9, 1) ("Unsafe PASV reply from %s: '%s'\n", fd_table[ftpState->ctrl.fd].ipaddr, ftpState->ctrl.last_reply); - ftpSendPort(ftpState); - return; - } - buf++; /* skip ( */ + buf = ftpState->ctrl.last_reply + strcspn(ftpState->ctrl.last_reply, "0123456789"); n = sscanf(buf, "%d,%d,%d,%d,%d,%d", &h1, &h2, &h3, &h4, &p1, &p2); if (n != 6 || p1 < 0 || p2 < 0 || p1 > 255 || p2 > 255) { - debug(9, 1) ("Unsafe PASV reply from %s: %s\n", fd_table[ftpState->ctrl.fd].ipaddr, ftpState->ctrl.last_reply); + debug(9, 1) ("Odd PASV reply from %s: %s\n", fd_table[ftpState->ctrl.fd].ipaddr, ftpState->ctrl.last_reply); ftpSendPort(ftpState); return; } @@ -1826,23 +1835,21 @@ return; } if (Config.Ftp.sanitycheck) { - if (strcmp(fd_table[ftpState->ctrl.fd].ipaddr, ipaddr) != 0) { - debug(9, 1) ("Unsafe PASV reply from %s: %s\n", fd_table[ftpState->ctrl.fd].ipaddr, ftpState->ctrl.last_reply); - ftpSendPort(ftpState); - return; - } if (port < 1024) { debug(9, 1) ("Unsafe PASV reply from %s: %s\n", fd_table[ftpState->ctrl.fd].ipaddr, ftpState->ctrl.last_reply); ftpSendPort(ftpState); return; } } - debug(9, 5) ("ftpReadPasv: connecting to %s, port %d\n", ipaddr, port); ftpState->data.port = port; - ftpState->data.host = xstrdup(ipaddr); + if (Config.Ftp.sanitycheck) + ftpState->data.host = xstrdup(fd_table[ftpState->ctrl.fd].ipaddr); + else + ftpState->data.host = xstrdup(ipaddr); safe_free(ftpState->ctrl.last_command); safe_free(ftpState->ctrl.last_reply); ftpState->ctrl.last_command = xstrdup("Connect to server data port"); + debug(9, 5) ("ftpReadPasv: connecting to %s, port %d\n", ftpState->data.host, ftpState->data.port); commConnectStart(fd, ipaddr, port, ftpPasvCallback, ftpState); } @@ -1984,7 +1991,7 @@ } } if (fd < 0) { - debug(9, 1) ("ftpHandleDataAccept: comm_accept(%d): %s", fd, xstrerror()); + debug(9, 1) ("ftpHandleDataAccept: comm_accept(%d): %s\n", fd, xstrerror()); /* XXX Need to set error message */ ftpFail(ftpState); return; @@ -2036,7 +2043,7 @@ snprintf(cbuf, 1024, "STOR %s\r\n", ftpState->filepath); ftpWriteCommand(cbuf, ftpState); ftpState->state = SENT_STOR; - } else if (httpHeaderGetInt(&ftpState->request->header, HDR_CONTENT_LENGTH) > 0) { + } else if (httpHeaderGetSize(&ftpState->request->header, HDR_CONTENT_LENGTH) > 0) { /* File upload without a filename. use STOU to generate one */ snprintf(cbuf, 1024, "STOU\r\n"); ftpWriteCommand(cbuf, ftpState); @@ -2086,7 +2093,7 @@ static void ftpSendRest(FtpStateData * ftpState) { - snprintf(cbuf, 1024, "REST %d\r\n", ftpState->restart_offset); + snprintf(cbuf, 1024, "REST %" PRINTF_OFF_T "\r\n", ftpState->restart_offset); ftpWriteCommand(cbuf, ftpState); ftpState->state = SENT_REST; } @@ -2131,7 +2138,6 @@ ftpSendList(FtpStateData * ftpState) { if (ftpState->filepath) { - ftpState->flags.use_base = 1; snprintf(cbuf, 1024, "LIST %s\r\n", ftpState->filepath); } else { snprintf(cbuf, 1024, "LIST\r\n"); diff -ruN squid-2.5.STABLE9/src/globals.h squid-2.5.STABLE10/src/globals.h --- squid-2.5.STABLE9/src/globals.h Fri Jan 21 04:48:25 2005 +++ squid-2.5.STABLE10/src/globals.h Wed Apr 20 15:52:26 2005 @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.108.2.4 2005/01/21 11:48:25 hno Exp $ + * $Id: globals.h,v 1.108.2.6 2005/04/20 21:52:26 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -154,7 +154,7 @@ extern int store_swap_low; /* 0 */ extern int store_swap_high; /* 0 */ extern int store_pages_max; /* 0 */ -extern ssize_t store_maxobjsize; /* -1 */ +extern squid_off_t store_maxobjsize; /* -1 */ extern RemovalPolicy *mem_policy; extern hash_table *proxy_auth_username_cache; /* NULL */ extern int incoming_sockets_accepted; @@ -165,5 +165,6 @@ #if HAVE_SBRK extern void *sbrk_start; /* 0 */ #endif +extern int opt_send_signal; /* -1 */ #endif /* SQUID_GLOBALS_H */ diff -ruN squid-2.5.STABLE9/src/helper.c squid-2.5.STABLE10/src/helper.c --- squid-2.5.STABLE9/src/helper.c Sat Nov 6 08:24:51 2004 +++ squid-2.5.STABLE10/src/helper.c Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: helper.c,v 1.34.2.17 2004/11/06 15:24:51 hno Exp $ + * $Id: helper.c,v 1.34.2.18 2005/03/26 02:50:53 hno Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Harvest Derived? @@ -374,7 +374,7 @@ srv->flags.closing ? 'C' : ' ', srv->flags.shutdown ? 'S' : ' ', tt < 0.0 ? 0.0 : tt, - (int) srv->offset, + srv->offset, srv->request ? log_quote(srv->request->buf) : "(none)"); } storeAppendPrintf(sentry, "\nFlags key:\n\n"); @@ -423,7 +423,7 @@ srv->flags.reserved ? 'R' : ' ', srv->flags.shutdown ? 'S' : ' ', tt < 0.0 ? 0.0 : tt, - (int) srv->offset, + srv->offset, srv->request ? log_quote(srv->request->buf) : "(none)"); } storeAppendPrintf(sentry, "\nFlags key:\n\n"); diff -ruN squid-2.5.STABLE9/src/htcp.c squid-2.5.STABLE10/src/htcp.c --- squid-2.5.STABLE9/src/htcp.c Sun Feb 20 12:07:45 2005 +++ squid-2.5.STABLE10/src/htcp.c Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: htcp.c,v 1.38.2.5 2005/02/20 19:07:45 hno Exp $ + * $Id: htcp.c,v 1.38.2.6 2005/03/26 02:50:53 hno Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -227,14 +227,14 @@ { u_short length; size_t len; - off_t off = 0; + int off = 0; if (buflen - off < 2) return -1; if (s) len = strlen(s); else len = 0; - debug(31, 3) ("htcpBuildCountstr: LENGTH = %d\n", len); + debug(31, 3) ("htcpBuildCountstr: LENGTH = %d\n", (int) len); debug(31, 3) ("htcpBuildCountstr: TEXT = {%s}\n", s ? s : ""); length = htons((u_short) len); xmemcpy(buf + off, &length, 2); diff -ruN squid-2.5.STABLE9/src/http.c squid-2.5.STABLE10/src/http.c --- squid-2.5.STABLE9/src/http.c Fri Feb 11 03:52:59 2005 +++ squid-2.5.STABLE10/src/http.c Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.384.2.28 2005/02/11 10:52:59 hno Exp $ + * $Id: http.c,v 1.384.2.30 2005/03/26 02:50:53 hno Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -528,9 +528,9 @@ /* return 1 if we got the last of the data on a persistent connection */ MemObject *mem = httpState->entry->mem_obj; HttpReply *reply = mem->reply; - int clen; + squid_off_t clen; debug(11, 3) ("httpPconnTransferDone: FD %d\n", httpState->fd); - debug(11, 5) ("httpPconnTransferDone: content_length=%d\n", + debug(11, 5) ("httpPconnTransferDone: content_length=%" PRINTF_OFF_T "\n", reply->content_length); /* If we haven't seen the end of reply headers, we are not done */ if (httpState->reply_hdr_state < 2) @@ -744,7 +744,8 @@ if ((len < 0 && !ignoreErrno(errno)) || len == 0) { keep_alive = 0; } else if (len > 0) { - debug(11, 1) ("httpReadReply: Excess data from \"%s %s\"\n", + debug(11, Config.onoff.relaxed_header_parser <= 0 || keep_alive ? 1 : 2) + ("httpReadReply: Excess data from \"%s %s\"\n", RequestMethodStr[httpState->orig_request->method], storeUrl(entry)); storeAppend(entry, buf, len); @@ -782,7 +783,8 @@ return; case -1: /* Server is nasty on us. Shut down */ - debug(11, 1) ("httpReadReply: Excess data from \"%s %s\"\n", + debug(11, Config.onoff.relaxed_header_parser <= 0 || entry->mem_obj->reply->keep_alive ? 1 : 2) + ("httpReadReply: Excess data from \"%s %s\"\n", RequestMethodStr[httpState->orig_request->method], storeUrl(entry)); fwdComplete(httpState->fwd); @@ -1059,7 +1061,7 @@ /* build request prefix and append it to a given MemBuf; * return the length of the prefix */ -mb_size_t +int httpBuildRequestPrefix(request_t * request, request_t * orig_request, StoreEntry * entry, diff -ruN squid-2.5.STABLE9/src/main.c squid-2.5.STABLE10/src/main.c --- squid-2.5.STABLE9/src/main.c Sun Feb 20 19:55:04 2005 +++ squid-2.5.STABLE10/src/main.c Wed Apr 20 15:52:26 2005 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.345.2.19 2005/02/21 02:55:04 hno Exp $ + * $Id: main.c,v 1.345.2.25 2005/04/20 21:52:26 hno Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -38,9 +38,9 @@ /* for error reporting from xmalloc and friends */ extern void (*failure_notify) (const char *); -static int opt_send_signal = -1; static int opt_no_daemon = 0; static int opt_parse_cfg_only = 0; +static char *opt_syslog_facility = NULL; static int httpPortNumOverride = 1; static int icpPortNumOverride = 1; /* Want to detect "-u 0" */ static int configured_once = 0; @@ -83,7 +83,7 @@ usage(void) { fprintf(stderr, - "Usage: %s [-dhsvzCDFNRVYX] [-f config-file] [-[au] port] [-k signal]\n" + "Usage: %s [-dhvzCDFNRVYX] [-s | -l facility] [-f config-file] [-[au] port] [-k signal]\n" " -a port Specify HTTP port number (default: %d).\n" " -d level Write debugging to stderr also.\n" " -f file Use given config-file instead of\n" @@ -92,7 +92,8 @@ " -k reconfigure|rotate|shutdown|interrupt|kill|debug|check|parse\n" " Parse configuration file, then send signal to \n" " running copy (except -k parse) and exit.\n" - " -s Enable logging to syslog.\n" + " -s | -l facility\n" + " Enable logging to syslog.\n" " -u port Specify ICP port number (default: %d), disable with 0.\n" " -v Print version.\n" " -z Create swap directories\n" @@ -115,7 +116,7 @@ extern char *optarg; int c; - while ((c = getopt(argc, argv, "CDFNRSVYXa:d:f:hk:m::su:vz?")) != -1) { + while ((c = getopt(argc, argv, "CDFNRSVYXa:d:f:hk:m::sl:u:vz?")) != -1) { switch (c) { case 'C': opt_catch_signals = 0; @@ -205,9 +206,11 @@ fatal("Need to configure --enable-xmalloc-debug-trace to use -m option"); #endif } + case 'l': + opt_syslog_facility = xstrdup(optarg); case 's': #if HAVE_SYSLOG - opt_syslog_enable = 1; + _db_set_syslog(opt_syslog_facility); break; #else fatal("Logging to syslog not available on this platform"); @@ -272,9 +275,9 @@ do_shutdown = sig == SIGINT ? -1 : 1; #ifdef KILL_PARENT_OPT if (getppid() > 1) { - debug(1, 1) ("Killing RunCache, pid %d\n", getppid()); + debug(1, 1) ("Killing RunCache, pid %ld\n", (long) getppid()); if (kill(getppid(), sig) < 0) - debug(1, 1) ("kill %d: %s\n", getppid(), xstrerror()); + debug(1, 1) ("kill %ld: %s\n", (long) getppid(), xstrerror()); } #endif #if SA_RESETHAND == 0 @@ -660,7 +663,7 @@ cbdataInit(); eventInit(); /* eventInit() is required for config parsing */ storeFsInit(); /* required for config parsing */ - authenticateSchemeInit(); /* required for config parsign */ + authenticateSchemeInit(); /* required for config parsing */ parse_err = parseConfigFile(ConfigFile); if (opt_parse_cfg_only) @@ -988,8 +991,8 @@ fwdUninit(); #endif storeDirSync(); /* Flush log close */ -#if PURIFY || XMALLOC_TRACE storeFsDone(); +#if PURIFY || XMALLOC_TRACE configFreeMemory(); storeFreeMemory(); /*stmemFreeMemory(); */ @@ -1006,9 +1009,9 @@ #endif #if !XMALLOC_TRACE if (opt_no_daemon) { - file_close(0); - file_close(1); - file_close(2); + fd_close(0); + fd_close(1); + fd_close(2); } #endif fdDumpOpen(); diff -ruN squid-2.5.STABLE9/src/mime.c squid-2.5.STABLE10/src/mime.c --- squid-2.5.STABLE9/src/mime.c Fri Jan 21 17:56:14 2005 +++ squid-2.5.STABLE10/src/mime.c Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: mime.c,v 1.102.2.4 2005/01/22 00:56:14 hno Exp $ + * $Id: mime.c,v 1.102.2.5 2005/03/26 02:50:53 hno Exp $ * * DEBUG: section 25 MIME Parsing * AUTHOR: Harvest Derived @@ -442,7 +442,7 @@ httpReplyReset(reply = e->mem_obj->reply); httpBuildVersion(&version, 1, 0); httpReplySetHeaders(reply, version, HTTP_OK, NULL, - type, (int) sb.st_size, sb.st_mtime, -1); + type, sb.st_size, sb.st_mtime, -1); reply->cache_control = httpHdrCcCreate(); httpHdrCcSetMaxAge(reply->cache_control, 86400); httpHeaderPutCc(&reply->header, reply->cache_control); diff -ruN squid-2.5.STABLE9/src/neighbors.c squid-2.5.STABLE10/src/neighbors.c --- squid-2.5.STABLE9/src/neighbors.c Sun Feb 20 19:55:04 2005 +++ squid-2.5.STABLE10/src/neighbors.c Wed Mar 9 07:34:24 2005 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.299.2.5 2005/02/21 02:55:04 hno Exp $ + * $Id: neighbors.c,v 1.299.2.6 2005/03/09 14:34:24 hno Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -589,6 +589,9 @@ if (!p->digest) { debug(15, 5) ("peerDigestLookup: gone!\n"); return LOOKUP_NONE; + } else if (!peerHTTPOkay(p, request)) { + debug(15, 5) ("peerDigestLookup: !peerHTTPOkay\n"); + return LOOKUP_NONE; } else if (!p->digest->flags.needed) { debug(15, 5) ("peerDigestLookup: note need\n"); peerDigestNeeded(p->digest); @@ -596,9 +599,6 @@ } else if (!p->digest->flags.usable) { debug(15, 5) ("peerDigestLookup: !ready && %srequested\n", p->digest->flags.requested ? "" : "!"); - return LOOKUP_NONE; - } else if (!peerHTTPOkay(p, request)) { - debug(15, 5) ("peerDigestLookup: !peerHTTPOkay\n"); return LOOKUP_NONE; } debug(15, 5) ("peerDigestLookup: OK to lookup peer %s\n", p->host); diff -ruN squid-2.5.STABLE9/src/net_db.c squid-2.5.STABLE10/src/net_db.c --- squid-2.5.STABLE9/src/net_db.c Sun Feb 13 14:23:19 2005 +++ squid-2.5.STABLE10/src/net_db.c Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: net_db.c,v 1.158.2.5 2005/02/13 21:23:19 serassio Exp $ + * $Id: net_db.c,v 1.158.2.9 2005/03/26 02:50:53 hno Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -42,8 +42,8 @@ StoreEntry *e; store_client *sc; request_t *r; - off_t seen; - off_t used; + squid_off_t seen; + squid_off_t used; size_t buf_sz; char *buf; } netdbExchangeState; @@ -247,7 +247,7 @@ hostname, n->network, na->network); x = (net_db_name *) hash_lookup(host_table, hostname); if (x == NULL) { - debug(38, 1) ("netdbSendPing: net_db_name list bug: %s not found", hostname); + debug(38, 1) ("netdbSendPing: net_db_name list bug: %s not found\n", hostname); xfree(hostname); return; } @@ -531,7 +531,7 @@ { netdbExchangeState *ex = data; int rec_sz = 0; - off_t o; + ssize_t o; struct in_addr addr; double rtt; double hops; @@ -792,6 +792,13 @@ } xfree(list); #else + http_reply *reply = sentry->mem_obj->reply; + http_version_t version; + httpReplyReset(reply); + httpBuildVersion(&version, 1, 0); + httpReplySetHeaders(reply, version, HTTP_BAD_REQUEST, "Bad Request", + NULL, -1, squid_curtime, -2); + httpReplySwapOut(reply, sentry); storeAppendPrintf(sentry, "NETDB support not compiled into this Squid cache.\n"); #endif @@ -963,6 +970,7 @@ httpBuildVersion(&version, 1, 0); httpReplySetHeaders(reply, version, HTTP_BAD_REQUEST, "Bad Request", NULL, -1, squid_curtime, -2); + httpReplySwapOut(reply, s); storeAppendPrintf(s, "NETDB support not compiled into this Squid cache.\n"); #endif storeComplete(s); diff -ruN squid-2.5.STABLE9/src/peer_digest.c squid-2.5.STABLE10/src/peer_digest.c --- squid-2.5.STABLE9/src/peer_digest.c Wed Jul 16 14:22:39 2003 +++ squid-2.5.STABLE10/src/peer_digest.c Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: peer_digest.c,v 1.83.2.1 2003/07/16 20:22:39 wessels Exp $ + * $Id: peer_digest.c,v 1.83.2.2 2005/03/26 02:50:53 hno Exp $ * * DEBUG: section 72 Peer Digest Routines * AUTHOR: Alex Rousskov @@ -453,7 +453,7 @@ if (size >= StoreDigestCBlockSize) { PeerDigest *pd = fetch->pd; HttpReply *rep = fetch->entry->mem_obj->reply; - const int seen = fetch->offset + size; + const squid_off_t seen = fetch->offset + size; assert(pd && rep); if (peerDigestSetCBlock(pd, buf)) { @@ -498,7 +498,7 @@ fetch->offset += size; fetch->mask_offset += size; if (fetch->mask_offset >= pd->cd->mask_size) { - debug(72, 2) ("peerDigestSwapInMask: Done! Got %d, expected %d\n", + debug(72, 2) ("peerDigestSwapInMask: Done! Got %" PRINTF_OFF_T ", expected %d\n", fetch->mask_offset, pd->cd->mask_size); assert(fetch->mask_offset == pd->cd->mask_size); assert(peerDigestFetchedEnough(fetch, NULL, 0, "peerDigestSwapInMask")); @@ -540,8 +540,8 @@ else host = strBuf(pd->host); } - debug(72, 6) ("%s: peer %s, offset: %d size: %d.\n", - step_name, host, fcb_valid ? fetch->offset : -1, size); + debug(72, 6) ("%s: peer %s, offset: %" PRINTF_OFF_T " size: %d.\n", + step_name, host, fcb_valid ? fetch->offset : (squid_off_t) - 1, (int) size); /* continue checking (with pd and host known and valid) */ if (!reason) { @@ -778,7 +778,7 @@ /* check consistency further */ if (cblock.mask_size != cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry)) { debug(72, 0) ("%s digest cblock is corrupted (mask size mismatch: %d ? %d).\n", - host, cblock.mask_size, cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry)); + host, cblock.mask_size, (int) cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry)); return 0; } /* there are some things we cannot do yet */ diff -ruN squid-2.5.STABLE9/src/protos.h squid-2.5.STABLE10/src/protos.h --- squid-2.5.STABLE9/src/protos.h Sun Feb 20 19:55:04 2005 +++ squid-2.5.STABLE10/src/protos.h Tue Apr 19 16:19:27 2005 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.420.2.27 2005/02/21 02:55:04 hno Exp $ + * $Id: protos.h,v 1.420.2.34 2005/04/19 22:19:27 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -125,7 +125,7 @@ extern int cbdataLocked(const void *p); extern void clientdbInit(void); -extern void clientdbUpdate(struct in_addr, log_type, protocol_t, size_t); +extern void clientdbUpdate(struct in_addr, log_type, protocol_t, squid_off_t); extern int clientdbCutoffDenied(struct in_addr); extern void clientdbDump(StoreEntry *); extern void clientdbFreeMemory(void); @@ -206,6 +206,7 @@ extern Ctx ctx_enter(const char *descr); extern void ctx_exit(Ctx ctx); +extern void _db_set_syslog(const char *facility); extern void _db_init(const char *logfile, const char *options); extern void _db_rotate_log(void); @@ -223,24 +224,12 @@ /* disk.c */ extern int file_open(const char *path, int mode); extern void file_close(int fd); -extern void file_write(int, off_t, void *, int len, DWCB *, void *, FREE *); +extern void file_write(int, off_t, void *, size_t len, DWCB *, void *, FREE *); extern void file_write_mbuf(int fd, off_t, MemBuf mb, DWCB * handler, void *handler_data); -extern void file_read(int, char *, int, off_t, DRCB *, void *); +extern void file_read(int, char *, size_t, off_t, DRCB *, void *); extern void disk_init(void); -/* diskd.c */ -extern diskd_queue *afile_create_queue(void); -extern void afile_destroy_queue(diskd_queue *); -extern void afile_sync_queue(diskd_queue *); -extern void afile_sync(void); -extern void afile_open(const char *path, int mode, DOCB *, void *); -extern void afile_close(int fd, DCCB * callback, void *data); -extern void afile_write(int, off_t, void *, int len, DWCB *, void *, FREE *); -extern void afile_write_mbuf(int fd, off_t, MemBuf, DWCB *, void *); -extern void afile_read(int, char *, int, off_t, DRCB *, void *); -extern void afile_unlink(const char *path, DUCB *, void *); -extern void afile_truncate(const char *path, DTCB *, void *); - +/* dns.s */ extern void dnsShutdown(void); extern void dnsInit(void); extern void dnsSubmit(const char *lookup, HLPCB * callback, void *data); @@ -303,7 +292,7 @@ /* http.c */ extern int httpCachable(method_t); extern void httpStart(FwdState *); -extern mb_size_t httpBuildRequestPrefix(request_t * request, +extern int httpBuildRequestPrefix(request_t * request, request_t * orig_request, StoreEntry * entry, MemBuf * mb, @@ -371,13 +360,13 @@ /* iterate through specs */ extern HttpHdrRangeSpec *httpHdrRangeGetSpec(const HttpHdrRange * range, HttpHdrRangePos * pos); /* adjust specs after the length is known */ -extern int httpHdrRangeCanonize(HttpHdrRange *, ssize_t); +extern int httpHdrRangeCanonize(HttpHdrRange *, squid_off_t); /* other */ extern String httpHdrRangeBoundaryStr(clientHttpRequest * http); extern int httpHdrRangeIsComplex(const HttpHdrRange * range); extern int httpHdrRangeWillBeComplex(const HttpHdrRange * range); -extern ssize_t httpHdrRangeFirstOffset(const HttpHdrRange * range); -extern ssize_t httpHdrRangeLowestOffset(const HttpHdrRange * range, ssize_t); +extern squid_off_t httpHdrRangeFirstOffset(const HttpHdrRange * range); +extern squid_off_t httpHdrRangeLowestOffset(const HttpHdrRange * range, squid_off_t); extern int httpHdrRangeOffsetLimit(HttpHdrRange *); @@ -390,7 +379,7 @@ extern HttpHdrContRange *httpHdrContRangeDup(const HttpHdrContRange * crange); extern void httpHdrContRangePackInto(const HttpHdrContRange * crange, Packer * p); /* inits with given spec */ -extern void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, ssize_t); +extern void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, squid_off_t); /* Http Header Tools */ extern HttpHeaderFieldInfo *httpHeaderBuildFieldsInfo(const HttpHeaderFieldAttrs * attrs, int count); @@ -401,14 +390,14 @@ extern void httpHeaderMaskInit(HttpHeaderMask * mask, int value); extern void httpHeaderCalcMask(HttpHeaderMask * mask, const int *enums, int count); extern int httpHeaderHasConnDir(const HttpHeader * hdr, const char *directive); -extern void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, ssize_t); +extern void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, squid_off_t); extern void strListAdd(String * str, const char *item, char del); extern int strListIsMember(const String * str, const char *item, char del); extern int strListIsSubstr(const String * list, const char *s, char del); extern int strListGetItem(const String * str, char del, const char **item, int *ilen, const char **pos); extern const char *getStringPrefix(const char *str, const char *end); extern int httpHeaderParseInt(const char *start, int *val); -extern int httpHeaderParseSize(const char *start, ssize_t * sz); +extern squid_off_t httpHeaderParseSize(const char *start, squid_off_t * sz); extern int httpHeaderReset(HttpHeader * hdr); #if STDC_HEADERS extern void @@ -433,6 +422,7 @@ /* field manipulation */ extern int httpHeaderHas(const HttpHeader * hdr, http_hdr_type type); extern void httpHeaderPutInt(HttpHeader * hdr, http_hdr_type type, int number); +extern void httpHeaderPutSize(HttpHeader * hdr, http_hdr_type type, squid_off_t number); extern void httpHeaderPutTime(HttpHeader * hdr, http_hdr_type type, time_t htime); extern void httpHeaderPutStr(HttpHeader * hdr, http_hdr_type type, const char *str); extern void httpHeaderPutAuth(HttpHeader * hdr, const char *auth_scheme, const char *realm); @@ -441,6 +431,7 @@ extern void httpHeaderPutRange(HttpHeader * hdr, const HttpHdrRange * range); extern void httpHeaderPutExt(HttpHeader * hdr, const char *name, const char *value); extern int httpHeaderGetInt(const HttpHeader * hdr, http_hdr_type id); +extern squid_off_t httpHeaderGetSize(const HttpHeader * hdr, http_hdr_type id); extern time_t httpHeaderGetTime(const HttpHeader * hdr, http_hdr_type id); extern TimeOrTag httpHeaderGetTimeOrTag(const HttpHeader * hdr, http_hdr_type id); extern HttpHdrCc *httpHeaderGetCc(const HttpHeader * hdr); @@ -482,7 +473,7 @@ /* absorb: copy the contents of a new reply to the old one, destroy new one */ extern void httpReplyAbsorb(HttpReply * rep, HttpReply * new_rep); /* parse returns -1,0,+1 on error,need-more-data,success */ -extern int httpReplyParse(HttpReply * rep, const char *buf, ssize_t); +extern int httpReplyParse(HttpReply * rep, const char *buf, size_t); extern void httpReplyPackInto(const HttpReply * rep, Packer * p); /* ez-routines */ /* mem-pack: returns a ready to use mem buffer with a packed reply */ @@ -491,10 +482,10 @@ extern void httpReplySwapOut(const HttpReply * rep, StoreEntry * e); /* set commonly used info with one call */ extern void httpReplySetHeaders(HttpReply * rep, http_version_t ver, http_status status, - const char *reason, const char *ctype, int clen, time_t lmt, time_t expires); + const char *reason, const char *ctype, squid_off_t clen, time_t lmt, time_t expires); /* do everything in one call: init, set, pack, clean, return MemBuf */ extern MemBuf httpPackedReply(http_version_t ver, http_status status, const char *ctype, - int clen, time_t lmt, time_t expires); + squid_off_t clen, time_t lmt, time_t expires); /* construct 304 reply and pack it into MemBuf, return MemBuf */ extern MemBuf httpPacked304Reply(const HttpReply * rep); /* update when 304 reply is received for a cached object */ @@ -505,7 +496,7 @@ extern time_t httpReplyExpires(const HttpReply * rep); extern int httpReplyHasCc(const HttpReply * rep, http_hdr_cc_type type); extern void httpRedirectReply(HttpReply *, http_status, const char *); -extern int httpReplyBodySize(method_t, const HttpReply *); +extern squid_off_t httpReplyBodySize(method_t, const HttpReply *); /* Http Request */ extern request_t *requestCreate(method_t, protocol_t, const char *urlpath); @@ -607,7 +598,7 @@ /* unfirtunate hack to test if the buffer has been Init()ialized */ extern int memBufIsNull(MemBuf * mb); /* calls memcpy, appends exactly size bytes, extends buffer if needed */ -extern void memBufAppend(MemBuf * mb, const char *buf, mb_size_t size); +extern void memBufAppend(MemBuf * mb, const char *buf, int size); /* calls snprintf, extends buffer if needed */ #if STDC_HEADERS extern void @@ -756,7 +747,7 @@ extern int authenticateAuthUserInuse(auth_user_t * auth_user); extern void authenticateAuthUserRequestRemoveIp(auth_user_request_t *, struct in_addr); extern void authenticateAuthUserRequestClearIp(auth_user_request_t *); -extern size_t authenticateAuthUserRequestIPCount(auth_user_request_t *); +extern int authenticateAuthUserRequestIPCount(auth_user_request_t *); extern int authenticateDirection(auth_user_request_t *); extern FREE authenticateFreeProxyAuthUser; extern void authenticateFreeProxyAuthUserACLResults(void *data); @@ -788,7 +779,7 @@ extern void start_announce(void *unused); -extern void sslStart(clientHttpRequest *, size_t *, int *); +extern void sslStart(clientHttpRequest *, squid_off_t *, int *); extern void waisStart(FwdState *); /* ident.c */ @@ -851,7 +842,7 @@ extern void memFree32K(void *); extern void memFree64K(void *); extern int memInUse(mem_type); -extern size_t memTotalAllocated(void); +extern int memTotalAllocated(void); extern void memDataInit(mem_type, const char *, size_t, int); extern void memCheckInit(void); @@ -869,11 +860,13 @@ /* Mem */ extern void memReport(StoreEntry * e); -extern int stmemFreeDataUpto(mem_hdr *, int); +extern squid_off_t stmemFreeDataUpto(mem_hdr *, squid_off_t); extern void stmemAppend(mem_hdr *, const char *, int); -extern ssize_t stmemCopy(const mem_hdr *, off_t, char *, size_t); +extern ssize_t stmemCopy(const mem_hdr *, squid_off_t, char *, size_t); extern void stmemFree(mem_hdr *); extern void stmemFreeData(mem_hdr *); +extern void stmemNodeFree(void *); +extern char *stmemNodeGet(mem_node *); /* ----------------------------------------------------------------- */ @@ -924,8 +917,8 @@ extern void storeAppendVPrintf(StoreEntry *, const char *, va_list ap); extern int storeCheckCachable(StoreEntry * e); extern void storeSetPrivateKey(StoreEntry *); -extern int objectLen(const StoreEntry * e); -extern int contentLen(const StoreEntry * e); +extern squid_off_t objectLen(const StoreEntry * e); +extern squid_off_t contentLen(const StoreEntry * e); extern HttpReply *storeEntryReply(StoreEntry *); extern int storeTooManyDiskFilesOpen(void); extern void storeEntryReset(StoreEntry *); @@ -946,10 +939,10 @@ extern storeIOState *storeCreate(StoreEntry *, STFNCB *, STIOCB *, void *); extern storeIOState *storeOpen(StoreEntry *, STFNCB *, STIOCB *, void *); extern void storeClose(storeIOState *); -extern void storeRead(storeIOState *, char *, size_t, off_t, STRCB *, void *); -extern void storeWrite(storeIOState *, char *, size_t, off_t, FREE *); +extern void storeRead(storeIOState *, char *, size_t, squid_off_t, STRCB *, void *); +extern void storeWrite(storeIOState *, char *, size_t, squid_off_t, FREE *); extern void storeUnlink(StoreEntry *); -extern off_t storeOffset(storeIOState *); +extern squid_off_t storeOffset(storeIOState *); /* * store_log.c @@ -1007,7 +1000,7 @@ extern void storeDirInit(void); extern void storeDirOpenSwapLogs(void); extern void storeDirSwapLog(const StoreEntry *, int op); -extern void storeDirUpdateSwapSize(SwapDir *, size_t size, int sign); +extern void storeDirUpdateSwapSize(SwapDir *, squid_off_t size, int sign); extern void storeDirSync(void); extern void storeDirCallback(void); extern void storeDirLRUDelete(StoreEntry *); @@ -1040,7 +1033,8 @@ */ extern void storeSwapOut(StoreEntry * e); extern void storeSwapOutFileClose(StoreEntry * e); -extern int storeSwapOutAble(const StoreEntry * e); +extern int /* swapout_able */ storeSwapOutMaintainMemObject(StoreEntry * e); +extern squid_off_t storeSwapOutObjectBytesOnDisk(const MemObject * mem); /* * store_client.c @@ -1049,10 +1043,10 @@ extern store_client *storeClientListSearch(const MemObject * mem, void *data); #endif extern store_client *storeClientListAdd(StoreEntry * e, void *data); -extern void storeClientCopy(store_client *, StoreEntry *, off_t, off_t, size_t, char *, STCB *, void *); +extern void storeClientCopy(store_client *, StoreEntry *, squid_off_t, squid_off_t, size_t, char *, STCB *, void *); extern int storeClientCopyPending(store_client *, StoreEntry * e, void *data); extern int storeUnregister(store_client * sc, StoreEntry * e, void *data); -extern off_t storeLowestMemReaderOffset(const StoreEntry * entry); +extern squid_off_t storeLowestMemReaderOffset(const StoreEntry * entry); extern void InvokeHandlers(StoreEntry * e); extern int storePendingNClients(const StoreEntry * e); @@ -1152,7 +1146,7 @@ extern void dlinkNodeDelete(dlink_node * m); extern dlink_node *dlinkNodeNew(void); -extern void kb_incr(kb_t *, size_t); +extern void kb_incr(kb_t *, squid_off_t); extern double gb_to_double(const gb_t *); extern const char *gb_to_str(const gb_t *); extern void gb_flush(gb_t *); /* internal, do not use this */ @@ -1342,6 +1336,7 @@ extern void externalAclLookup(aclCheck_t * ch, void *acl_data, EAH * handler, void *data); extern void externalAclInit(void); extern void externalAclShutdown(void); +extern int externalAclRequiresAuth(void *acl_data); extern char *strtokFile(void); #endif /* SQUID_PROTOS_H */ diff -ruN squid-2.5.STABLE9/src/repl/Makefile.in squid-2.5.STABLE10/src/repl/Makefile.in --- squid-2.5.STABLE9/src/repl/Makefile.in Sun Feb 20 18:35:51 2005 +++ squid-2.5.STABLE10/src/repl/Makefile.in Fri Mar 18 17:55:56 2005 @@ -15,7 +15,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.7.2.11 2005/02/21 01:35:51 hno Exp $ +# $Id: Makefile.in,v 1.7.2.12 2005/03/19 00:55:56 hno Exp $ # SHELL = @SHELL@ @@ -85,6 +85,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/repl/heap/Makefile.in squid-2.5.STABLE10/src/repl/heap/Makefile.in --- squid-2.5.STABLE9/src/repl/heap/Makefile.in Sat Jul 10 06:11:50 2004 +++ squid-2.5.STABLE10/src/repl/heap/Makefile.in Fri Mar 18 17:55:56 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/repl/lru/Makefile.in squid-2.5.STABLE10/src/repl/lru/Makefile.in --- squid-2.5.STABLE9/src/repl/lru/Makefile.in Sat Jul 10 06:11:51 2004 +++ squid-2.5.STABLE10/src/repl/lru/Makefile.in Fri Mar 18 17:55:56 2005 @@ -80,6 +80,7 @@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ LIBSASL = @LIBSASL@ +LIB_LBER = @LIB_LBER@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ diff -ruN squid-2.5.STABLE9/src/snmp_core.c squid-2.5.STABLE10/src/snmp_core.c --- squid-2.5.STABLE9/src/snmp_core.c Wed Jun 18 17:53:35 2003 +++ squid-2.5.STABLE10/src/snmp_core.c Wed May 4 12:03:47 2005 @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.c,v 1.51.2.3 2003/06/18 23:53:35 hno Exp $ + * $Id: snmp_core.c,v 1.51.2.5 2005/05/04 18:03:47 hno Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -496,7 +496,6 @@ snmpDecodePacket(snmp_request_t * rq) { struct snmp_pdu *PDU; - struct snmp_session Session; aclCheck_t checklist; u_char *Community; u_char *buf = rq->buf; @@ -506,8 +505,8 @@ debug(49, 5) ("snmpDecodePacket: Called.\n"); /* Now that we have the data, turn it into a PDU */ PDU = snmp_pdu_create(0); - Session.Version = SNMP_VERSION_1; - Community = snmp_parse(&Session, PDU, buf, len); + rq->session.Version = SNMP_VERSION_1; + Community = snmp_parse(&rq->session, PDU, buf, len); memset(&checklist, '\0', sizeof(checklist)); checklist.src_addr = rq->from.sin_addr; checklist.snmp_community = (char *) Community; @@ -534,17 +533,13 @@ static void snmpConstructReponse(snmp_request_t * rq) { - struct snmp_session Session; struct snmp_pdu *RespPDU; debug(49, 5) ("snmpConstructReponse: Called.\n"); RespPDU = snmpAgentResponse(rq->PDU); snmp_free_pdu(rq->PDU); if (RespPDU != NULL) { - Session.Version = SNMP_VERSION_1; - Session.community = rq->community; - Session.community_len = strlen((char *) rq->community); - snmp_build(&Session, RespPDU, rq->outbuf, &rq->outlen); + snmp_build(&rq->session, RespPDU, rq->outbuf, &rq->outlen); sendto(rq->sock, rq->outbuf, rq->outlen, 0, (struct sockaddr *) &rq->from, sizeof(rq->from)); snmp_free_pdu(RespPDU); } @@ -558,45 +553,59 @@ snmpAgentResponse(struct snmp_pdu *PDU) { struct snmp_pdu *Answer = NULL; - oid_ParseFn *ParseFn = NULL; - - variable_list *VarPtr, *VarNew = NULL, **VarPtrP; - int index = 0; debug(49, 5) ("snmpAgentResponse: Called.\n"); if ((Answer = snmp_pdu_create(SNMP_PDU_RESPONSE))) { Answer->reqid = PDU->reqid; Answer->errindex = 0; - if (PDU->command == SNMP_PDU_GET) { - variable_list **RespVars; - - RespVars = &(Answer->variables); + if (PDU->command == SNMP_PDU_GET || PDU->command == SNMP_PDU_GETNEXT) { + int get_next = (PDU->command == SNMP_PDU_GETNEXT); + variable_list *VarPtr_; + variable_list **RespVars = &(Answer->variables); + oid_ParseFn *ParseFn; + int index = 0; /* Loop through all variables */ - for (VarPtrP = &(PDU->variables); - *VarPtrP; - VarPtrP = &((*VarPtrP)->next_variable)) { - VarPtr = *VarPtrP; + for (VarPtr_ = PDU->variables; VarPtr_; VarPtr_ = VarPtr_->next_variable) { + variable_list *VarPtr = VarPtr_; + variable_list *VarNew = NULL; + oid *NextOidName = NULL; + snint NextOidNameLen = 0; index++; /* Find the parsing function for this variable */ - ParseFn = snmpTreeGet(VarPtr->name, VarPtr->name_length); - + if (get_next) + ParseFn = snmpTreeNext(VarPtr->name, VarPtr->name_length, &NextOidName, &NextOidNameLen); + else + ParseFn = snmpTreeGet(VarPtr->name, VarPtr->name_length); if (ParseFn == NULL) { Answer->errstat = SNMP_ERR_NOSUCHNAME; - debug(49, 5) ("snmpAgentResponse: No such oid. "); - } else + debug(49, 5) ("snmpAgentResponse: No such oid.\n"); + } else { + if (get_next) { + VarPtr = snmp_var_new(NextOidName, NextOidNameLen); + xfree(NextOidName); + } VarNew = (*ParseFn) (VarPtr, (snint *) & (Answer->errstat)); + if (get_next) + snmp_var_free(VarPtr); + } /* Was there an error? */ - if ((Answer->errstat != SNMP_ERR_NOERROR) || - (VarNew == NULL)) { + if ((Answer->errstat != SNMP_ERR_NOERROR) || (VarNew == NULL)) { Answer->errindex = index; - debug(49, 5) ("snmpAgentParse: successful.\n"); - /* Just copy the rest of the variables. Quickly. */ - *RespVars = VarPtr; - *VarPtrP = NULL; + debug(49, 5) ("snmpAgentResponse: error.\n"); + if (VarNew) + snmp_var_free(VarNew); + /* Free the already processed results, if any */ + while ((VarPtr = Answer->variables) != NULL) { + Answer->variables = VarPtr->next_variable; + snmp_var_free(VarPtr); + } + /* Steal the original PDU list of variables for the error response */ + Answer->variables = PDU->variables; + PDU->variables = NULL; return (Answer); } /* No error. Insert this var at the end, and move on to the next. @@ -604,37 +613,6 @@ *RespVars = VarNew; RespVars = &(VarNew->next_variable); } - return (Answer); - } else if (PDU->command == SNMP_PDU_GETNEXT) { - oid *NextOidName = NULL; - snint NextOidNameLen = 0; - - ParseFn = snmpTreeNext(PDU->variables->name, PDU->variables->name_length, - &NextOidName, &NextOidNameLen); - - if (ParseFn == NULL) { - Answer->errstat = SNMP_ERR_NOSUCHNAME; - debug(49, 5) ("snmpAgentResponse: No such oid: "); - snmpDebugOid(5, PDU->variables->name, PDU->variables->name_length); - } else { - xfree(PDU->variables->name); - PDU->variables->name = NextOidName; - PDU->variables->name_length = NextOidNameLen; - VarNew = (*ParseFn) (PDU->variables, (snint *) & Answer->errstat); - } - - /* Was there an error? */ - if (Answer->errstat != SNMP_ERR_NOERROR) { - Answer->errindex = 1; - Answer->variables = PDU->variables; - PDU->variables = NULL; - } else { - Answer->variables = VarNew; - } - - } else { - snmp_free_pdu(Answer); - Answer = NULL; } } return (Answer); @@ -1043,7 +1021,7 @@ static void snmpSnmplibDebug(int lvl, char *buf) { - debug(49, lvl) ("%s", buf); + debug(49, lvl) ("%s\n", buf); } void diff -ruN squid-2.5.STABLE9/src/squid.h squid-2.5.STABLE10/src/squid.h --- squid-2.5.STABLE9/src/squid.h Mon Aug 9 07:54:23 2004 +++ squid-2.5.STABLE10/src/squid.h Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.216.2.7 2004/08/09 13:54:23 hno Exp $ + * $Id: squid.h,v 1.216.2.8 2005/03/26 02:50:53 hno Exp $ * * AUTHOR: Duane Wessels * @@ -480,5 +480,13 @@ #define FD_READ_METHOD(fd, buf, len) (*fd_table[fd].read_method)(fd, buf, len) #define FD_WRITE_METHOD(fd, buf, len) (*fd_table[fd].write_method)(fd, buf, len) + +/* + * Trap attempts to build large file cache support without support for + * large objects + */ +#if LARGE_CACHE_FILES && SIZEOF_SQUID_OFF_T <= 4 +#error Your platform does not support large integers. Can not build with --enable-large-cache-files +#endif #endif /* SQUID_H */ diff -ruN squid-2.5.STABLE9/src/ssl.c squid-2.5.STABLE10/src/ssl.c --- squid-2.5.STABLE9/src/ssl.c Mon Sep 27 12:07:30 2004 +++ squid-2.5.STABLE10/src/ssl.c Sun Apr 17 18:54:30 2005 @@ -1,6 +1,6 @@ /* - * $Id: ssl.c,v 1.118.2.7 2004/09/27 18:07:30 hno Exp $ + * $Id: ssl.c,v 1.118.2.11 2005/04/18 00:54:30 hno Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -46,7 +46,7 @@ int len; char *buf; } client, server; - size_t *size_ptr; /* pointer to size in an ConnStateData for logging */ + squid_off_t *size_ptr; /* pointer to size in an ConnStateData for logging */ int *status_ptr; /* pointer to status for logging */ #if DELAY_POOLS delay_id delay_id; @@ -75,6 +75,18 @@ #endif static void +sslAbort(SslStateData * sslState) +{ + debug(26, 3) ("sslAbort: FD %d/%d\n", sslState->client.fd, sslState->server.fd); + cbdataLock(sslState); + if (sslState->client.fd > -1) + comm_close(sslState->client.fd); + if (sslState->server.fd > -1) + comm_close(sslState->server.fd); + cbdataUnlock(sslState); +} + +static void sslServerClosed(int fd, void *data) { SslStateData *sslState = data; @@ -92,9 +104,7 @@ debug(26, 3) ("sslClientClosed: FD %d\n", fd); assert(fd == sslState->client.fd); sslState->client.fd = -1; - if (sslState->server.fd != -1) - comm_close(sslState->server.fd); - else + if (sslState->server.fd == -1) sslStateFree(sslState); } @@ -152,7 +162,7 @@ sslState, Config.Timeout.read); } - } else if (sslState->client.len == 0) { + } else if (sslState->client.len == 0 && sslState->server.fd > -1) { comm_close(sslState->server.fd); } if (!sslState->connected) { @@ -183,9 +193,7 @@ sslState, Config.Timeout.read); } - } else if (sslState->client.fd == -1) { - /* client already closed, nothing more to do */ - } else if (sslState->server.len == 0) { + } else if (sslState->server.len == 0 && sslState->client.fd > -1) { comm_close(sslState->client.fd); } } @@ -262,7 +270,7 @@ debug(50, level) ("sslReadClient: FD %d: read failure: %s\n", fd, xstrerror()); if (!ignoreErrno(errno)) - comm_close(fd); + sslAbort(sslState); } else if (len == 0) { comm_close(fd); } @@ -289,6 +297,12 @@ fd_bytes(fd, len, FD_WRITE); kb_incr(&statCounter.server.all.kbytes_out, len); kb_incr(&statCounter.server.other.kbytes_out, len); + /* increment total object size */ + if (sslState->size_ptr && sslState->client.fd != -1) +#if SIZEOF_SQUID_OFF_T <= 4 + if (*sslState->size_ptr < 0x7FFF0000) +#endif + *sslState->size_ptr += len; assert(len <= sslState->client.len); sslState->client.len -= len; if (sslState->client.len > 0) { @@ -303,7 +317,7 @@ debug(50, ignoreErrno(errno) ? 3 : 1) ("sslWriteServer: FD %d: write failure: %s.\n", fd, xstrerror()); if (!ignoreErrno(errno)) - comm_close(fd); + sslAbort(sslState); } if (cbdataValid(sslState)) sslSetSelect(sslState); @@ -331,7 +345,7 @@ sslState->server.len -= len; /* increment total object size */ if (sslState->size_ptr) -#if SIZEOF_SIZE_T == 4 +#if SIZEOF_SQUID_OFF_T <= 4 if (*sslState->size_ptr < 0x7FFF0000) #endif *sslState->size_ptr += len; @@ -347,7 +361,7 @@ debug(50, ignoreErrno(errno) ? 3 : 1) ("sslWriteClient: FD %d: write failure: %s.\n", fd, xstrerror()); if (!ignoreErrno(errno)) - comm_close(fd); + sslAbort(sslState); } if (cbdataValid(sslState)) sslSetSelect(sslState); @@ -359,7 +373,7 @@ { SslStateData *sslState = data; debug(26, 3) ("sslTimeout: FD %d\n", fd); - comm_close(sslState->client.fd); + sslAbort(sslState); } static void @@ -383,7 +397,7 @@ static void -sslConnectDone(int fdnotused, int status, void *data) +sslConnectDone(int fd, int status, void *data) { SslStateData *sslState = data; request_t *request = sslState->request; @@ -399,6 +413,7 @@ sslState->host); if (status == COMM_ERR_DNS) { debug(26, 4) ("sslConnect: Unknown host: %s\n", sslState->host); + comm_close(fd); err = errorCon(ERR_DNS_FAIL, HTTP_NOT_FOUND); *sslState->status_ptr = HTTP_NOT_FOUND; err->request = requestLink(request); @@ -407,6 +422,7 @@ err->callback_data = sslState; errorSend(sslState->client.fd, err); } else if (status != COMM_OK) { + comm_close(fd); err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE); *sslState->status_ptr = HTTP_SERVICE_UNAVAILABLE; err->xerrno = errno; @@ -461,7 +477,7 @@ CBDATA_TYPE(SslStateData); void -sslStart(clientHttpRequest * http, size_t * size_ptr, int *status_ptr) +sslStart(clientHttpRequest * http, squid_off_t * size_ptr, int *status_ptr) { /* Create state structure. */ SslStateData *sslState = NULL; diff -ruN squid-2.5.STABLE9/src/stat.c squid-2.5.STABLE10/src/stat.c --- squid-2.5.STABLE9/src/stat.c Sun Feb 13 14:19:44 2005 +++ squid-2.5.STABLE10/src/stat.c Tue Mar 29 02:52:00 2005 @@ -1,6 +1,6 @@ /* - * $Id: stat.c,v 1.351.2.12 2005/02/13 21:19:44 serassio Exp $ + * $Id: stat.c,v 1.351.2.16 2005/03/29 09:52:00 hno Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -36,8 +36,6 @@ #include "squid.h" -#define DEBUG_OPENFD 1 - typedef int STOBJFLT(const StoreEntry *); typedef struct { StoreEntry *sentry; @@ -63,9 +61,7 @@ static OBJH stat_io_get; static OBJH stat_objects_get; static OBJH stat_vmobjects_get; -#if DEBUG_OPENFD static OBJH statOpenfdObj; -#endif static EVH statObjects; static OBJH info_get; static OBJH statFiledescriptors; @@ -274,22 +270,22 @@ memBufPrintf(mb, "\tSwap Dir %d, File %#08X\n", e->swap_dirn, e->swap_filen); if (mem != NULL) { - memBufPrintf(mb, "\tinmem_lo: %d\n", (int) mem->inmem_lo); - memBufPrintf(mb, "\tinmem_hi: %d\n", (int) mem->inmem_hi); - memBufPrintf(mb, "\tswapout: %d bytes queued\n", - (int) mem->swapout.queue_offset); + memBufPrintf(mb, "\tinmem_lo: %" PRINTF_OFF_T "\n", mem->inmem_lo); + memBufPrintf(mb, "\tinmem_hi: %" PRINTF_OFF_T "\n", mem->inmem_hi); + memBufPrintf(mb, "\tswapout: %" PRINTF_OFF_T " bytes queued\n", + mem->swapout.queue_offset); if (mem->swapout.sio) - memBufPrintf(mb, "\tswapout: %d bytes written\n", - (int) storeOffset(mem->swapout.sio)); + memBufPrintf(mb, "\tswapout: %" PRINTF_OFF_T " bytes written\n", + storeOffset(mem->swapout.sio)); for (i = 0, node = mem->clients.head; node; node = node->next, i++) { sc = (store_client *) node->data; if (sc->callback_data == NULL) continue; memBufPrintf(mb, "\tClient #%d, %p\n", i, sc->callback_data); - memBufPrintf(mb, "\t\tcopy_offset: %d\n", - (int) sc->copy_offset); - memBufPrintf(mb, "\t\tseen_offset: %d\n", - (int) sc->seen_offset); + memBufPrintf(mb, "\t\tcopy_offset: %" PRINTF_OFF_T "\n", + sc->copy_offset); + memBufPrintf(mb, "\t\tseen_offset: %" PRINTF_OFF_T "\n", + sc->seen_offset); memBufPrintf(mb, "\t\tcopy_size: %d\n", (int) sc->copy_size); memBufPrintf(mb, "\t\tflags:"); @@ -374,7 +370,6 @@ statObjectsStart(sentry, statObjectsVmFilter); } -#if DEBUG_OPENFD static int statObjectsOpenfdFilter(const StoreEntry * e) { @@ -391,7 +386,35 @@ statObjectsStart(sentry, statObjectsOpenfdFilter); } -#endif +static int +statObjectsPendingFilter(const StoreEntry * e) +{ + if (e->store_status != STORE_PENDING) + return 0; + return 1; +} + +static void +statPendingObj(StoreEntry * sentry) +{ + statObjectsStart(sentry, statObjectsPendingFilter); +} + +static int +statObjectsClientsFilter(const StoreEntry * e) +{ + if (e->mem_obj == NULL) + return 0; + if (e->mem_obj->clients.head == NULL) + return 0; + return 1; +} + +static void +statClientsObj(StoreEntry * sentry) +{ + statObjectsStart(sentry, statObjectsClientsFilter); +} #ifdef XMALLOC_STATISTICS static void @@ -432,7 +455,7 @@ f = &fd_table[i]; if (!f->flags.open) continue; - storeAppendPrintf(sentry, "%4d %-6.6s %4d %7d%c %7d%c %-21s %s\n", + storeAppendPrintf(sentry, "%4d %-6.6s %4d %7" PRINTF_OFF_T "%c %7" PRINTF_OFF_T "%c %-21s %s\n", i, fdTypeStr[f->type], f->timeout_handler ? (int) (f->timeout - squid_curtime) / 60 : 0, @@ -863,11 +886,15 @@ cachemgrRegister("vm_objects", "In-Memory and In-Transit Objects", stat_vmobjects_get, 0, 0); -#if DEBUG_OPENFD cachemgrRegister("openfd_objects", "Objects with Swapout files open", statOpenfdObj, 0, 0); -#endif + cachemgrRegister("pending_objects", + "Objects being retreived from the network", + statPendingObj, 0, 0); + cachemgrRegister("client_objects", + "Objects being sent to clients", + statClientsObj, 0, 0); cachemgrRegister("io", "Server-side network read() size histograms", stat_io_get, 0, 1); @@ -1397,7 +1424,7 @@ */ cd = CountHist[0].cd.kbytes_recv.kb - CountHist[minutes].cd.kbytes_recv.kb; if (s < cd) - debug(18, 1) ("STRANGE: srv_kbytes=%d, cd_kbytes=%d\n", s, cd); + debug(18, 1) ("STRANGE: srv_kbytes=%d, cd_kbytes=%d\n", (int) s, (int) cd); s -= cd; #endif if (c > s) @@ -1421,7 +1448,7 @@ storeAppendPrintf(s, "Connection: %p\n", conn); if (conn) { fd = conn->fd; - storeAppendPrintf(s, "\tFD %d, read %d, wrote %d\n", fd, + storeAppendPrintf(s, "\tFD %d, read %" PRINTF_OFF_T ", wrote %" PRINTF_OFF_T "\n", fd, fd_table[fd].bytes_read, fd_table[fd].bytes_written); storeAppendPrintf(s, "\tFD desc: %s\n", fd_table[fd].desc); storeAppendPrintf(s, "\tin: buf %p, offset %ld, size %ld\n", diff -ruN squid-2.5.STABLE9/src/stmem.c squid-2.5.STABLE10/src/stmem.c --- squid-2.5.STABLE9/src/stmem.c Wed Oct 24 02:19:08 2001 +++ squid-2.5.STABLE10/src/stmem.c Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: stmem.c,v 1.70 2001/10/24 08:19:08 hno Exp $ + * $Id: stmem.c,v 1.70.2.3 2005/03/26 02:50:53 hno Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Harvest Derived @@ -36,26 +36,39 @@ #include "squid.h" void +stmemNodeFree(void *buf) +{ + mem_node *p = (mem_node *) buf; + if (!p->uses) + memFree(p, MEM_MEM_NODE); + else + p->uses--; +} + +char * +stmemNodeGet(mem_node * p) +{ + p->uses++; + return p->data; +} + +void stmemFree(mem_hdr * mem) { mem_node *p; while ((p = mem->head)) { mem->head = p->next; store_mem_size -= SM_PAGE_SIZE; - if (p) { - memFree(p, MEM_MEM_NODE); - p = NULL; - } + stmemNodeFree(p); } mem->head = mem->tail = NULL; mem->origin_offset = 0; } -int -stmemFreeDataUpto(mem_hdr * mem, int target_offset) +squid_off_t +stmemFreeDataUpto(mem_hdr * mem, squid_off_t target_offset) { - int current_offset = mem->origin_offset; - mem_node *lastp; + squid_off_t current_offset = mem->origin_offset; mem_node *p = mem->head; while (p && ((current_offset + p->len) <= target_offset)) { if (p == mem->tail) { @@ -64,14 +77,11 @@ mem->origin_offset = current_offset; return current_offset; } else { - lastp = p; + mem_node *lastp = p; p = p->next; current_offset += lastp->len; store_mem_size -= SM_PAGE_SIZE; - if (lastp) { - memFree(lastp, MEM_MEM_NODE); - lastp = NULL; - } + stmemNodeFree(lastp); } } mem->head = p; @@ -125,15 +135,15 @@ } ssize_t -stmemCopy(const mem_hdr * mem, off_t offset, char *buf, size_t size) +stmemCopy(const mem_hdr * mem, squid_off_t offset, char *buf, size_t size) { mem_node *p = mem->head; - off_t t_off = mem->origin_offset; + squid_off_t t_off = mem->origin_offset; size_t bytes_to_go = size; char *ptr_to_buf = NULL; int bytes_from_this_packet = 0; int bytes_into_this_packet = 0; - debug(19, 6) ("memCopy: offset %ld: size %d\n", (long int) offset, (int) size); + debug(19, 6) ("memCopy: offset %" PRINTF_OFF_T ": size %d\n", offset, (int) size); if (p == NULL) return 0; assert(size > 0); diff -ruN squid-2.5.STABLE9/src/store.c squid-2.5.STABLE10/src/store.c --- squid-2.5.STABLE9/src/store.c Fri Jan 21 04:57:38 2005 +++ squid-2.5.STABLE10/src/store.c Fri Mar 25 19:50:53 2005 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.544.2.7 2005/01/21 11:57:38 hno Exp $ + * $Id: store.c,v 1.544.2.8 2005/03/26 02:50:53 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -606,7 +606,7 @@ if (mem->object_sz < Config.Store.minObjectSize) return 1; if (mem->reply->content_length > -1) - if (mem->reply->content_length < (int) Config.Store.minObjectSize) + if (mem->reply->content_length < Config.Store.minObjectSize) return 1; return 0; } @@ -638,9 +638,6 @@ e->mem_obj->inmem_hi > Config.Store.maxObjectSize) { debug(20, 2) ("storeCheckCachable: NO: too big\n"); store_check_cachable_hist.no.too_big++; - } else if (e->mem_obj->reply->content_length > (int) Config.Store.maxObjectSize) { - debug(20, 2) ("storeCheckCachable: NO: too big\n"); - store_check_cachable_hist.no.too_big++; } else if (storeCheckTooSmall(e)) { debug(20, 2) ("storeCheckCachable: NO: too small\n"); store_check_cachable_hist.no.too_small++; @@ -939,18 +936,18 @@ static int storeEntryValidLength(const StoreEntry * e) { - int diff; - int clen; + squid_off_t diff; + squid_off_t clen; const HttpReply *reply; assert(e->mem_obj != NULL); reply = e->mem_obj->reply; debug(20, 3) ("storeEntryValidLength: Checking '%s'\n", storeKeyText(e->hash.key)); - debug(20, 5) ("storeEntryValidLength: object_len = %d\n", + debug(20, 5) ("storeEntryValidLength: object_len = %" PRINTF_OFF_T "\n", objectLen(e)); debug(20, 5) ("storeEntryValidLength: hdr_sz = %d\n", reply->hdr_sz); clen = httpReplyBodySize(e->mem_obj->method, reply); - debug(20, 5) ("storeEntryValidLength: content_length = %d\n", + debug(20, 5) ("storeEntryValidLength: content_length = %" PRINTF_OFF_T "\n", clen); if (clen < 0) { debug(20, 5) ("storeEntryValidLength: Unspecified content length: %s\n", @@ -960,7 +957,7 @@ diff = reply->hdr_sz + clen - objectLen(e); if (diff == 0) return 1; - debug(20, 2) ("storeEntryValidLength: %d bytes too %s; '%s'\n", + debug(20, 2) ("storeEntryValidLength: %" PRINTF_OFF_T " bytes too %s; '%s'\n", diff < 0 ? -diff : diff, diff < 0 ? "big" : "small", storeKeyText(e->hash.key)); @@ -1128,15 +1125,15 @@ mem->data_hdr.head); debug(20, 1) ("MemObject->data.tail: %p\n", mem->data_hdr.tail); - debug(20, 1) ("MemObject->data.origin_offset: %d\n", + debug(20, 1) ("MemObject->data.origin_offset: %" PRINTF_OFF_T "\n", mem->data_hdr.origin_offset); - debug(20, 1) ("MemObject->start_ping: %d.%06d\n", - (int) mem->start_ping.tv_sec, + debug(20, 1) ("MemObject->start_ping: %ld.%06d\n", + (long int) mem->start_ping.tv_sec, (int) mem->start_ping.tv_usec); - debug(20, 1) ("MemObject->inmem_hi: %d\n", - (int) mem->inmem_hi); - debug(20, 1) ("MemObject->inmem_lo: %d\n", - (int) mem->inmem_lo); + debug(20, 1) ("MemObject->inmem_hi: %" PRINTF_OFF_T "\n", + mem->inmem_hi); + debug(20, 1) ("MemObject->inmem_lo: %" PRINTF_OFF_T "\n", + mem->inmem_lo); debug(20, 1) ("MemObject->nclients: %d\n", mem->nclients); debug(20, 1) ("MemObject->reply: %p\n", @@ -1154,11 +1151,11 @@ debug(20, l) ("StoreEntry->key: %s\n", storeKeyText(e->hash.key)); debug(20, l) ("StoreEntry->next: %p\n", e->hash.next); debug(20, l) ("StoreEntry->mem_obj: %p\n", e->mem_obj); - debug(20, l) ("StoreEntry->timestamp: %d\n", (int) e->timestamp); - debug(20, l) ("StoreEntry->lastref: %d\n", (int) e->lastref); - debug(20, l) ("StoreEntry->expires: %d\n", (int) e->expires); - debug(20, l) ("StoreEntry->lastmod: %d\n", (int) e->lastmod); - debug(20, l) ("StoreEntry->swap_file_sz: %d\n", (int) e->swap_file_sz); + debug(20, l) ("StoreEntry->timestamp: %ld\n", (long int) e->timestamp); + debug(20, l) ("StoreEntry->lastref: %ld\n", (long int) e->lastref); + debug(20, l) ("StoreEntry->expires: %ld\n", (long int) e->expires); + debug(20, l) ("StoreEntry->lastmod: %ld\n", (long int) e->lastmod); + debug(20, l) ("StoreEntry->swap_file_sz: %" PRINTF_OFF_T "\n", (squid_off_t) e->swap_file_sz); debug(20, l) ("StoreEntry->refcount: %d\n", e->refcount); debug(20, l) ("StoreEntry->flags: %s\n", storeEntryFlags(e)); debug(20, l) ("StoreEntry->swap_dirn: %d\n", (int) e->swap_dirn); @@ -1240,14 +1237,14 @@ storeSwapOut(e); } -int +squid_off_t objectLen(const StoreEntry * e) { assert(e->mem_obj != NULL); return e->mem_obj->object_sz; } -int +squid_off_t contentLen(const StoreEntry * e) { assert(e->mem_obj != NULL); diff -ruN squid-2.5.STABLE9/src/store_client.c squid-2.5.STABLE10/src/store_client.c --- squid-2.5.STABLE9/src/store_client.c Wed Aug 6 07:49:03 2003 +++ squid-2.5.STABLE10/src/store_client.c Tue Apr 19 16:19:27 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_client.c,v 1.105.2.2 2003/08/06 13:49:03 hno Exp $ + * $Id: store_client.c,v 1.105.2.4 2005/04/19 22:19:27 hno Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -141,10 +141,6 @@ sc->flags.disk_io_pending = 0; sc->entry = e; sc->type = storeClientType(e); - if (sc->type == STORE_DISK_CLIENT) - /* assert we'll be able to get the data we want */ - /* maybe we should open swapin_fd here */ - assert(e->swap_filen > -1 || storeSwapOutAble(e)); dlinkAdd(sc, &sc->node, &mem->clients); #if DELAY_POOLS sc->delay_id = 0; @@ -179,18 +175,18 @@ void storeClientCopy(store_client * sc, StoreEntry * e, - off_t seen_offset, - off_t copy_offset, + squid_off_t seen_offset, + squid_off_t copy_offset, size_t size, char *buf, STCB * callback, void *data) { assert(!EBIT_TEST(e->flags, ENTRY_ABORTED)); - debug(20, 3) ("storeClientCopy: %s, seen %d, want %d, size %d, cb %p, cbdata %p\n", + debug(20, 3) ("storeClientCopy: %s, seen %" PRINTF_OFF_T ", want %" PRINTF_OFF_T ", size %d, cb %p, cbdata %p\n", storeKeyText(e->hash.key), - (int) seen_offset, - (int) copy_offset, + seen_offset, + copy_offset, (int) size, callback, data); @@ -220,7 +216,7 @@ static int storeClientNoMoreToSend(StoreEntry * e, store_client * sc) { - ssize_t len; + squid_off_t len; if (e->store_status == STORE_PENDING) return 0; if ((len = objectLen(e)) < 0) @@ -265,7 +261,7 @@ storeClientCopy3(StoreEntry * e, store_client * sc) { MemObject *mem = e->mem_obj; - size_t sz; + ssize_t sz; if (storeClientNoMoreToSend(e, sc)) { /* There is no more to send! */ @@ -316,6 +312,8 @@ debug(20, 3) ("storeClientCopy3: Copying from memory\n"); sz = stmemCopy(&mem->data_hdr, sc->copy_offset, sc->copy_buf, sc->copy_size); + if (EBIT_TEST(e->flags, RELEASE_REQUEST)) + storeSwapOutMaintainMemObject(e); storeClientCallback(sc, sz); return; } @@ -342,7 +340,7 @@ sc); } else { if (sc->entry->swap_status == SWAPOUT_WRITING) - assert(storeOffset(mem->swapout.sio) > sc->copy_offset + mem->swap_hdr_sz); + assert(storeSwapOutObjectBytesOnDisk(mem) > sc->copy_offset); storeRead(sc->swapin_sio, sc->copy_buf, sc->copy_size, @@ -431,6 +429,7 @@ } break; case STORE_META_STD: + case STORE_META_STD_LFS: break; case STORE_META_VARY_HEADERS: if (mem->vary_headers) { @@ -534,16 +533,18 @@ /*assert(!sc->flags.disk_io_pending); */ cbdataFree(sc); assert(e->lock_count > 0); + storeSwapOutMaintainMemObject(e); if (mem->nclients == 0) CheckQuickAbort(e); return 1; } -off_t +squid_off_t storeLowestMemReaderOffset(const StoreEntry * entry) { const MemObject *mem = entry->mem_obj; - off_t lowest = mem->inmem_hi + 1; + squid_off_t lowest = mem->inmem_hi + 1; + squid_off_t highest = -1; store_client *sc; dlink_node *nx = NULL; dlink_node *node; @@ -553,14 +554,15 @@ nx = node->next; if (sc->callback_data == NULL) /* open slot */ continue; - if (sc->type != STORE_MEM_CLIENT) + if (sc->copy_offset > highest) + highest = sc->copy_offset; + if (mem->swapout.sio != NULL && sc->type != STORE_MEM_CLIENT) continue; - if (sc->type == STORE_DISK_CLIENT) - if (NULL != sc->swapin_sio) - continue; if (sc->copy_offset < lowest) lowest = sc->copy_offset; } + if (highest < lowest && highest >= 0) + return highest; return lowest; } @@ -603,9 +605,9 @@ static int CheckQuickAbort2(StoreEntry * entry) { - int curlen; - int minlen; - int expectlen; + squid_off_t curlen; + squid_off_t minlen; + squid_off_t expectlen; MemObject *mem = entry->mem_obj; assert(mem); debug(20, 3) ("CheckQuickAbort2: entry=%p, mem=%p\n", entry, mem); @@ -618,8 +620,8 @@ return 1; } expectlen = mem->reply->content_length + mem->reply->hdr_sz; - curlen = (int) mem->inmem_hi; - minlen = (int) Config.quickAbort.min << 10; + curlen = mem->inmem_hi; + minlen = Config.quickAbort.min << 10; if (minlen < 0) { debug(20, 3) ("CheckQuickAbort2: NO disabled\n"); return 0; diff -ruN squid-2.5.STABLE9/src/store_dir.c squid-2.5.STABLE10/src/store_dir.c --- squid-2.5.STABLE9/src/store_dir.c Thu Jul 17 09:39:49 2003 +++ squid-2.5.STABLE10/src/store_dir.c Fri Mar 25 19:50:54 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_dir.c,v 1.135.2.2 2003/07/17 15:39:49 wessels Exp $ + * $Id: store_dir.c,v 1.135.2.3 2005/03/26 02:50:54 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -45,7 +45,7 @@ #include #endif -static int storeDirValidSwapDirSize(int, ssize_t); +static int storeDirValidSwapDirSize(int, squid_off_t); static STDIRSELECT storeDirSelectSwapDirRoundRobin; static STDIRSELECT storeDirSelectSwapDirLeastLoad; @@ -106,7 +106,7 @@ * ie any-sized-object swapdirs. This is a good thing. */ static int -storeDirValidSwapDirSize(int swapdir, ssize_t objsize) +storeDirValidSwapDirSize(int swapdir, squid_off_t objsize) { /* * If the swapdir's max_obj_size is -1, then it definitely can @@ -144,7 +144,7 @@ int i; int load; SwapDir *sd; - ssize_t objsize = (ssize_t) objectLen(e); + squid_off_t objsize = objectLen(e); for (i = 0; i <= Config.cacheSwap.n_configured; i++) { if (++dirn >= Config.cacheSwap.n_configured) dirn = 0; @@ -181,9 +181,9 @@ static int storeDirSelectSwapDirLeastLoad(const StoreEntry * e) { - ssize_t objsize; - ssize_t most_free = 0, cur_free; - ssize_t least_objsize = -1; + squid_off_t objsize; + int most_free = 0, cur_free; + squid_off_t least_objsize = -1; int least_load = INT_MAX; int load; int dirn = -1; @@ -191,7 +191,7 @@ SwapDir *SD; /* Calculate the object size */ - objsize = (ssize_t) objectLen(e); + objsize = objectLen(e); if (objsize != -1) objsize += e->mem_obj->swap_hdr_sz; for (i = 0; i < Config.cacheSwap.n_configured; i++) { @@ -270,7 +270,7 @@ } void -storeDirUpdateSwapSize(SwapDir * SD, size_t size, int sign) +storeDirUpdateSwapSize(SwapDir * SD, squid_off_t size, int sign) { int blks = (size + SD->fs.blksize - 1) / SD->fs.blksize; int k = (blks * SD->fs.blksize >> 10) * sign; diff -ruN squid-2.5.STABLE9/src/store_io.c squid-2.5.STABLE10/src/store_io.c --- squid-2.5.STABLE9/src/store_io.c Wed Oct 24 02:19:09 2001 +++ squid-2.5.STABLE10/src/store_io.c Fri Mar 25 19:50:54 2005 @@ -76,14 +76,14 @@ } void -storeRead(storeIOState * sio, char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +storeRead(storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { SwapDir *SD = &Config.cacheSwap.swapDirs[sio->swap_dirn]; SD->obj.read(SD, sio, buf, size, offset, callback, callback_data); } void -storeWrite(storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func) +storeWrite(storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { SwapDir *SD = &Config.cacheSwap.swapDirs[sio->swap_dirn]; SD->obj.write(SD, sio, buf, size, offset, free_func); @@ -96,7 +96,7 @@ SD->obj.unlink(SD, e); } -off_t +squid_off_t storeOffset(storeIOState * sio) { return sio->offset; diff -ruN squid-2.5.STABLE9/src/store_log.c squid-2.5.STABLE10/src/store_log.c --- squid-2.5.STABLE9/src/store_log.c Wed Oct 17 14:25:03 2001 +++ squid-2.5.STABLE10/src/store_log.c Fri Mar 25 19:50:54 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_log.c,v 1.23 2001/10/17 20:25:03 hno Exp $ + * $Id: store_log.c,v 1.23.2.1 2005/03/26 02:50:54 hno Exp $ * * DEBUG: section 20 Storage Manager Logging Functions * AUTHOR: Duane Wessels @@ -69,26 +69,26 @@ * Because if we print it before the swap file number, it'll break * the existing log format. */ - logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s %4d %9d %9d %9d %s %d/%d %s %s\n", - (int) current_time.tv_sec, + logfilePrintf(storelog, "%9ld.%03d %-7s %02d %08X %s %4d %9ld %9ld %9ld %s %" PRINTF_OFF_T "/%" PRINTF_OFF_T " %s %s\n", + (long int) current_time.tv_sec, (int) current_time.tv_usec / 1000, storeLogTags[tag], e->swap_dirn, e->swap_filen, storeKeyText(e->hash.key), reply->sline.status, - (int) reply->date, - (int) reply->last_modified, - (int) reply->expires, + (long int) reply->date, + (long int) reply->last_modified, + (long int) reply->expires, strLen(reply->content_type) ? strBuf(reply->content_type) : "unknown", reply->content_length, - (int) (mem->inmem_hi - mem->reply->hdr_sz), + mem->inmem_hi - mem->reply->hdr_sz, RequestMethodStr[mem->method], mem->log_url); } else { /* no mem object. Most RELEASE cases */ - logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s ? ? ? ? ?/? ?/? ? ?\n", - (int) current_time.tv_sec, + logfilePrintf(storelog, "%9ld.%03d %-7s %02d %08X %s ? ? ? ? ?/? ?/? ? ?\n", + (long int) current_time.tv_sec, (int) current_time.tv_usec / 1000, storeLogTags[tag], e->swap_dirn, diff -ruN squid-2.5.STABLE9/src/store_swapmeta.c squid-2.5.STABLE10/src/store_swapmeta.c --- squid-2.5.STABLE9/src/store_swapmeta.c Wed Oct 24 02:52:37 2001 +++ squid-2.5.STABLE10/src/store_swapmeta.c Fri Mar 25 19:50:54 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_swapmeta.c,v 1.17 2001/10/24 08:52:37 hno Exp $ + * $Id: store_swapmeta.c,v 1.17.2.1 2005/03/26 02:50:54 hno Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -73,7 +73,11 @@ url = storeUrl(e); debug(20, 3) ("storeSwapMetaBuild: %s\n", url); T = storeSwapTLVAdd(STORE_META_KEY, e->hash.key, MD5_DIGEST_CHARS, T); +#if SIZEOF_SQUID_FILE_SZ == SIZEOF_SIZE_T T = storeSwapTLVAdd(STORE_META_STD, &e->timestamp, STORE_HDR_METASIZE, T); +#else + T = storeSwapTLVAdd(STORE_META_STD_LFS, &e->timestamp, STORE_HDR_METASIZE, T); +#endif T = storeSwapTLVAdd(STORE_META_URL, url, strlen(url) + 1, T); vary = e->mem_obj->vary_headers; if (vary) @@ -86,7 +90,7 @@ { int buflen = 0; tlv *t; - off_t j = 0; + int j = 0; char *buf; assert(length != NULL); buflen++; /* STORE_META_OK */ @@ -119,7 +123,7 @@ char type; int length; int buflen; - off_t j = 0; + int j = 0; assert(buf != NULL); assert(hdr_len != NULL); if (buf[j++] != (char) STORE_META_OK) diff -ruN squid-2.5.STABLE9/src/store_swapout.c squid-2.5.STABLE10/src/store_swapout.c --- squid-2.5.STABLE9/src/store_swapout.c Sat Apr 13 15:47:21 2002 +++ squid-2.5.STABLE10/src/store_swapout.c Tue May 10 16:30:33 2005 @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.c,v 1.85.2.1 2002/04/13 21:47:21 hno Exp $ + * $Id: store_swapout.c,v 1.85.2.11 2005/05/10 22:30:33 hno Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -35,10 +35,10 @@ #include "squid.h" -static off_t storeSwapOutObjectBytesOnDisk(const MemObject *); static void storeSwapOutStart(StoreEntry * e); static STIOCB storeSwapOutFileClosed; static STIOCB storeSwapOutFileNotify; +static int storeSwapOutAble(const StoreEntry * e); /* start swapping object to disk */ static void @@ -95,15 +95,67 @@ e->swap_dirn = mem->swapout.sio->swap_dirn; } +/* as sideeffect returns if the object can be cached */ +int +storeSwapOutMaintainMemObject(StoreEntry * e) +{ + MemObject *mem = e->mem_obj; + squid_off_t lowest_offset; + squid_off_t new_mem_lo; + int swapout_able; + + /* Don't pollute the disk with icons and other special entries */ + if (EBIT_TEST(e->flags, ENTRY_SPECIAL)) + return -1; + + /* Don't even attempt to free data from hot-cached objects */ + if (e->mem_status == IN_MEMORY) + return 1; + + swapout_able = storeSwapOutAble(e); + if (!swapout_able) { + /* Stop writing to disk */ + storeReleaseRequest(e); + if (e->mem_obj->swapout.sio != NULL) + storeSwapOutFileClose(e); + } + /* storeLowestMemReaderOffset must be after the storeSwapOutFileClose + * call above as storeLowestMemReaderOffset needs to know if we are + * still writing to disk or not + */ + lowest_offset = storeLowestMemReaderOffset(e); + debug(20, 7) ("storeSwapOut: lowest_offset = %" PRINTF_OFF_T "\n", + lowest_offset); + if (!swapout_able) + new_mem_lo = lowest_offset; + else if (mem->inmem_hi > Config.Store.maxInMemObjSize) + new_mem_lo = lowest_offset; + else if (mem->reply->content_length > Config.Store.maxInMemObjSize) + new_mem_lo = lowest_offset; + else + new_mem_lo = mem->inmem_lo; + /* The -1 makes sure the page isn't freed until storeSwapOut has + * walked to the next page. (mem->swapout.memnode->next) */ + if (swapout_able && new_mem_lo) { + squid_off_t on_disk = storeSwapOutObjectBytesOnDisk(e->mem_obj); + if (on_disk - 1 < new_mem_lo) + new_mem_lo = on_disk - 1; + } + if (new_mem_lo < mem->inmem_lo) + new_mem_lo = mem->inmem_lo; + if (mem->inmem_lo != new_mem_lo) + mem->inmem_lo = stmemFreeDataUpto(&mem->data_hdr, new_mem_lo); + + return swapout_able; +} + void storeSwapOut(StoreEntry * e) { MemObject *mem = e->mem_obj; - off_t lowest_offset; - off_t new_mem_lo; - off_t on_disk = 0; - ssize_t swapout_size; - ssize_t swap_buf_len; + int swapout_able; + squid_off_t swapout_size; + size_t swap_buf_len; if (mem == NULL) return; /* should we swap something out to disk? */ @@ -119,24 +171,21 @@ debug(20, 3) ("storeSwapOut: %s SPECIAL\n", storeUrl(e)); return; } - debug(20, 7) ("storeSwapOut: mem->inmem_lo = %d\n", - (int) mem->inmem_lo); - debug(20, 7) ("storeSwapOut: mem->inmem_hi = %d\n", - (int) mem->inmem_hi); - debug(20, 7) ("storeSwapOut: swapout.queue_offset = %d\n", - (int) mem->swapout.queue_offset); + debug(20, 7) ("storeSwapOut: mem->inmem_lo = %" PRINTF_OFF_T "\n", + mem->inmem_lo); + debug(20, 7) ("storeSwapOut: mem->inmem_hi = %" PRINTF_OFF_T "\n", + mem->inmem_hi); + debug(20, 7) ("storeSwapOut: swapout.queue_offset = %" PRINTF_OFF_T "\n", + mem->swapout.queue_offset); if (mem->swapout.sio) - debug(20, 7) ("storeSwapOut: storeOffset() = %d\n", - (int) storeOffset(mem->swapout.sio)); + debug(20, 7) ("storeSwapOut: storeOffset() = %" PRINTF_OFF_T "\n", + storeOffset(mem->swapout.sio)); assert(mem->inmem_hi >= mem->swapout.queue_offset); - lowest_offset = storeLowestMemReaderOffset(e); - debug(20, 7) ("storeSwapOut: lowest_offset = %d\n", - (int) lowest_offset); /* * Grab the swapout_size and check to see whether we're going to defer * the swapout based upon size */ - swapout_size = (ssize_t) (mem->inmem_hi - mem->swapout.queue_offset); + swapout_size = mem->inmem_hi - mem->swapout.queue_offset; if ((e->store_status != STORE_OK) && (swapout_size < store_maxobjsize)) { /* * NOTE: the store_maxobjsize here is the max of optional @@ -151,53 +200,18 @@ debug(20, 5) ("storeSwapOut: Deferring starting swapping out\n"); return; } - /* - * Careful. lowest_offset can be greater than inmem_hi, such - * as in the case of a range request. - */ - if (mem->inmem_hi < lowest_offset) - new_mem_lo = lowest_offset; - else if (mem->inmem_hi - mem->inmem_lo > Config.Store.maxInMemObjSize) - new_mem_lo = lowest_offset; - else - new_mem_lo = mem->inmem_lo; - assert(new_mem_lo >= mem->inmem_lo); - if (storeSwapOutAble(e)) { - /* - * We should only free up to what we know has been written - * to disk, not what has been queued for writing. Otherwise - * there will be a chunk of the data which is not in memory - * and is not yet on disk. - * The -1 makes sure the page isn't freed until storeSwapOut has - * walked to the next page. (mem->swapout.memnode) - */ - if ((on_disk = storeSwapOutObjectBytesOnDisk(mem)) - 1 < new_mem_lo) - new_mem_lo = on_disk - 1; - if (new_mem_lo == -1) - new_mem_lo = 0; /* the above might become -1 */ - } else if (new_mem_lo > 0) { - /* - * Its not swap-able, and we're about to delete a chunk, - * so we must make it PRIVATE. This is tricky/ugly because - * for the most part, we treat swapable == cachable here. - */ - storeReleaseRequest(e); - } - stmemFreeDataUpto(&mem->data_hdr, new_mem_lo); - mem->inmem_lo = new_mem_lo; -#if SIZEOF_OFF_T == 4 + swapout_able = storeSwapOutMaintainMemObject(e); +#if SIZEOF_SQUID_OFF_T <= 4 if (mem->inmem_hi > 0x7FFF0000) { - debug(20, 0) ("WARNING: preventing off_t overflow for %s\n", storeUrl(e)); + debug(20, 0) ("WARNING: preventing squid_off_t overflow for %s\n", storeUrl(e)); storeAbort(e); return; } #endif - if (e->swap_status == SWAPOUT_WRITING) - assert(mem->inmem_lo <= on_disk); - if (!storeSwapOutAble(e)) + if (!swapout_able) return; - debug(20, 7) ("storeSwapOut: swapout_size = %d\n", - (int) swapout_size); + debug(20, 7) ("storeSwapOut: swapout_size = %" PRINTF_OFF_T "\n", + swapout_size); if (swapout_size == 0) { if (e->store_status == STORE_OK) storeSwapOutFileClose(e); @@ -253,14 +267,14 @@ debug(20, 3) ("storeSwapOut: swap_buf_len = %d\n", (int) swap_buf_len); assert(swap_buf_len > 0); - debug(20, 3) ("storeSwapOut: swapping out %ld bytes from %ld\n", - (long int) swap_buf_len, (long int) mem->swapout.queue_offset); + debug(20, 3) ("storeSwapOut: swapping out %d bytes from %" PRINTF_OFF_T "\n", + (int) swap_buf_len, mem->swapout.queue_offset); mem->swapout.queue_offset += swap_buf_len; - storeWrite(mem->swapout.sio, mem->swapout.memnode->data, swap_buf_len, -1, NULL); + storeWrite(mem->swapout.sio, stmemNodeGet(mem->swapout.memnode), swap_buf_len, -1, stmemNodeFree); /* the storeWrite() call might generate an error */ if (e->swap_status != SWAPOUT_WRITING) break; - swapout_size = (ssize_t) (mem->inmem_hi - mem->swapout.queue_offset); + swapout_size = mem->inmem_hi - mem->swapout.queue_offset; if (e->store_status == STORE_PENDING) if (swapout_size < SM_PAGE_SIZE) break; @@ -283,12 +297,14 @@ storeSwapOutFileClose(StoreEntry * e) { MemObject *mem = e->mem_obj; + storeIOState *sio = mem->swapout.sio; assert(mem != NULL); debug(20, 3) ("storeSwapOutFileClose: %s\n", storeKeyText(e->hash.key)); debug(20, 3) ("storeSwapOutFileClose: sio = %p\n", mem->swapout.sio); - if (mem->swapout.sio == NULL) + if (sio == NULL) return; - storeClose(mem->swapout.sio); + mem->swapout.sio = NULL; + storeClose(sio); } static void @@ -329,13 +345,14 @@ debug(20, 3) ("storeSwapOutFileClosed: %s:%d\n", __FILE__, __LINE__); mem->swapout.sio = NULL; cbdataUnlock(sio); + storeSwapOutMaintainMemObject(e); storeUnlockObject(e); } /* * How much of the object data is on the disk? */ -static off_t +squid_off_t storeSwapOutObjectBytesOnDisk(const MemObject * mem) { /* @@ -351,7 +368,7 @@ */ off_t nwritten; if (mem->swapout.sio == NULL) - return 0; + return mem->swapout.queue_offset; nwritten = storeOffset(mem->swapout.sio); if (nwritten <= mem->swap_hdr_sz) return 0; @@ -361,24 +378,19 @@ /* * Is this entry a candidate for writing to disk? */ -int +static int storeSwapOutAble(const StoreEntry * e) { - dlink_node *node; + if (e->mem_obj->inmem_hi > Config.Store.maxObjectSize) + return 0; + if (!EBIT_TEST(e->flags, ENTRY_CACHABLE)) + return 0; if (e->mem_obj->swapout.sio != NULL) return 1; - if (e->mem_obj->inmem_lo > 0) - return 0; - /* - * If there are DISK clients, we must write to disk - * even if its not cachable - */ - for (node = e->mem_obj->clients.head; node; node = node->next) { - if (((store_client *) node->data)->type == STORE_DISK_CLIENT) + if (e->mem_obj->swapout.queue_offset) + if (e->mem_obj->swapout.queue_offset == e->mem_obj->inmem_hi) return 1; - } - /* Don't pollute the disk with icons and other special entries */ - if (EBIT_TEST(e->flags, ENTRY_SPECIAL)) + if (e->mem_obj->inmem_lo > 0) return 0; - return EBIT_TEST(e->flags, ENTRY_CACHABLE); + return 1; } diff -ruN squid-2.5.STABLE9/src/structs.h squid-2.5.STABLE10/src/structs.h --- squid-2.5.STABLE9/src/structs.h Tue Feb 22 17:06:35 2005 +++ squid-2.5.STABLE10/src/structs.h Wed May 4 12:03:47 2005 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.408.2.37 2005/02/23 00:06:35 hno Exp $ + * $Id: structs.h,v 1.408.2.43 2005/05/04 18:03:47 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -57,7 +57,7 @@ }; struct _acl_user_ip_data { - size_t max; + int max; struct { unsigned int strict:1; } flags; @@ -122,10 +122,10 @@ dlink_list proxy_match_cache; /* what ip addresses has this user been seen at?, plus a list length cache */ dlink_list ip_list; - size_t ipcount; + int ipcount; long expiretime; /* how many references are outstanding to this instance */ - size_t references; + int references; /* the auth scheme has it's own private data area */ void *scheme_data; /* the auth_user_request structures that link to this. Yes it could be a splaytree @@ -143,7 +143,7 @@ /* any scheme specific request related data */ void *scheme_data; /* how many 'processes' are working on this data */ - size_t references; + int references; /* We only attempt authentication once per http request. This * is to allow multiple auth acl references from different _access areas * when using connection based authentication @@ -228,7 +228,7 @@ struct _body_size { dlink_node node; acl_access *access_list; - size_t maxsize; + squid_off_t maxsize; }; struct _http_version_t { @@ -249,6 +249,7 @@ struct snmp_pdu *PDU; aclCheck_t *acl_checklist; u_char *community; + struct snmp_session session; }; #endif @@ -385,20 +386,20 @@ struct _SquidConfig { struct { - size_t maxSize; + squid_off_t maxSize; int highWaterMark; int lowWaterMark; } Swap; - size_t memMaxSize; + squid_off_t memMaxSize; struct { char *relayHost; u_short relayPort; peer *peer; } Wais; struct { - size_t min; + squid_off_t min; int pct; - size_t max; + squid_off_t max; } quickAbort; RemovalPolicySettings *replPolicy; RemovalPolicySettings *memPolicy; @@ -428,9 +429,9 @@ time_t idns_query; #endif } Timeout; - size_t maxRequestHeaderSize; - size_t maxRequestBodySize; - size_t maxReplyHeaderSize; + squid_off_t maxRequestHeaderSize; + squid_off_t maxRequestBodySize; + squid_off_t maxReplyHeaderSize; dlink_list ReplyBodySize; struct { u_short icp; @@ -507,7 +508,7 @@ u_short port; } Accel; char *appendDomain; - size_t appendDomainLen; + int appendDomainLen; char *debugOptions; char *pidFilename; char *mimeTablePathname; @@ -531,8 +532,8 @@ #endif struct in_addr client_netmask; } Addrs; - size_t tcpRcvBufsz; - size_t udpMaxHitObjsz; + squid_off_t tcpRcvBufsz; + squid_off_t udpMaxHitObjsz; wordlist *hierarchy_stoplist; wordlist *mcast_group_list; wordlist *dns_testname_list; @@ -552,10 +553,10 @@ cachemgr_passwd *passwd_list; struct { int objectsPerBucket; - size_t avgObjectSize; - size_t maxObjectSize; - size_t minObjectSize; - size_t maxInMemObjSize; + squid_off_t avgObjectSize; + squid_off_t maxObjectSize; + squid_off_t minObjectSize; + squid_off_t maxInMemObjSize; } Store; struct { int high; @@ -637,7 +638,7 @@ int n_configured; } authConfig; struct { - size_t list_width; + int list_width; int list_wrap; char *anon_user; int passive; @@ -660,7 +661,7 @@ int onerror; } retry; struct { - size_t limit; + squid_off_t limit; } MemPools; #if DELAY_POOLS delayConfig Delay; @@ -675,7 +676,7 @@ } comm_incoming; int max_open_disk_fds; int uri_whitespace; - size_t rangeOffsetLimit; + squid_off_t rangeOffsetLimit; #if MULTICAST_MISS_STREAM struct { struct in_addr addr; @@ -692,7 +693,7 @@ int bits_per_entry; time_t rebuild_period; time_t rewrite_period; - size_t swapout_chunk_size; + squid_off_t swapout_chunk_size; int rebuild_chunk_percentage; } digest; #endif @@ -705,7 +706,7 @@ struct { int high_rptm; int high_pf; - size_t high_memory; + squid_off_t high_memory; } warnings; char *store_dir_select_algorithm; int sleep_after_fork; /* microseconds */ @@ -732,31 +733,19 @@ struct _dread_ctrl { int fd; - off_t offset; - int req_len; + off_t file_offset; + size_t req_len; char *buf; int end_of_file; DRCB *handler; void *client_data; }; -struct _dnsserver_t { - int id; - int inpipe; - int outpipe; - time_t answer; - off_t offset; - size_t size; - char ip_inbuf[DNS_INBUF_SZ]; - struct timeval dispatch_time; - void *data; -}; - struct _dwrite_q { off_t file_offset; char *buf; - int len; - off_t buf_offset; + size_t len; + size_t buf_offset; dwrite_q *next; FREE *free_func; }; @@ -793,8 +782,8 @@ unsigned int close_on_exec:1; unsigned int read_pending:1; } flags; - int bytes_read; - int bytes_written; + squid_off_t bytes_read; + squid_off_t bytes_written; int uses; /* ie # req's over persistent conn */ struct _fde_disk { DWCB *wrt_handle; @@ -849,7 +838,7 @@ /* protected, use interface functions instead */ append_f append; vprintf_f vprintf; - void *real_handler; /* first parameter to real append and vprintf */ + void *real_handle; /* first parameter to real append and vprintf */ }; /* http status line */ @@ -881,12 +870,13 @@ int max_age; int s_maxage; int max_stale; + String other; }; /* http byte-range-spec */ struct _HttpHdrRangeSpec { - ssize_t offset; - ssize_t length; + squid_off_t offset; + squid_off_t length; }; /* There may be more than one byte range specified in the request. @@ -900,7 +890,7 @@ /* http content-range header field */ struct _HttpHdrContRange { HttpHdrRangeSpec spec; - ssize_t elength; /* entity length, not content length */ + squid_off_t elength; /* entity length, not content length */ }; /* some fields can hold either time or etag specs (e.g. If-Range) */ @@ -914,8 +904,8 @@ struct _HttpHdrRangeIter { HttpHdrRangePos pos; const HttpHdrRangeSpec *spec; /* current spec at pos */ - ssize_t debt_size; /* bytes left to send from the current spec */ - ssize_t prefix_size; /* the size of the incoming HTTP msg prefix */ + squid_off_t debt_size; /* bytes left to send from the current spec */ + squid_off_t prefix_size; /* the size of the incoming HTTP msg prefix */ String boundary; /* boundary for multipart responses */ }; @@ -962,7 +952,7 @@ int hdr_sz; /* sums _stored_ status-line, headers, and */ /* public, readable; never update these or their .hdr equivalents directly */ - int content_length; + squid_off_t content_length; time_t date; time_t last_modified; time_t expires; @@ -1053,7 +1043,7 @@ } icp; struct { struct in_addr caddr; - size_t size; + squid_off_t size; log_type code; int msec; const char *rfc931; @@ -1077,8 +1067,8 @@ char *uri; char *log_uri; struct { - off_t offset; - size_t size; + squid_off_t offset; + squid_off_t size; } out; HttpHdrRangeIter range_iter; /* data for iterating thru range specs */ size_t req_sz; /* raw request size on input, not current request size */ @@ -1099,24 +1089,25 @@ unsigned int internal:1; unsigned int done_copying:1; unsigned int purging:1; + unsigned int hit:1; } flags; struct { http_status status; char *location; } redirect; dlink_node active; - size_t maxBodySize; + squid_off_t maxBodySize; }; struct _ConnStateData { int fd; struct { char *buf; - off_t offset; + size_t offset; size_t size; } in; struct { - size_t size_left; /* How much body left to process */ + squid_off_t size_left; /* How much body left to process */ request_t *request; /* Parameters passed to clientReadBody */ char *buf; size_t bufsize; @@ -1186,8 +1177,8 @@ store_client *sc; store_client *old_sc; request_t *request; - int offset; - int mask_offset; + squid_off_t offset; + squid_off_t mask_offset; time_t start_time; time_t resp_time; time_t expires; @@ -1430,20 +1421,21 @@ struct _mem_node { char data[SM_PAGE_SIZE]; int len; + int uses; mem_node *next; }; struct _mem_hdr { mem_node *head; mem_node *tail; - int origin_offset; + squid_off_t origin_offset; }; /* keep track each client receiving data from that particular StoreEntry */ struct _store_client { int type; - off_t copy_offset; - off_t seen_offset; + squid_off_t copy_offset; + squid_off_t seen_offset; size_t copy_size; char *copy_buf; STCB *callback; @@ -1501,12 +1493,12 @@ method_t method; char *url; mem_hdr data_hdr; - off_t inmem_hi; - off_t inmem_lo; + squid_off_t inmem_hi; + squid_off_t inmem_lo; dlink_list clients; int nclients; struct { - off_t queue_offset; /* relative to in-mem data */ + squid_off_t queue_offset; /* relative to in-mem data */ mem_node *memnode; /* which node we're currently paging out */ storeIOState *sio; } swapout; @@ -1522,7 +1514,7 @@ char *log_url; RemovalPolicyNode repl; int id; - ssize_t object_sz; + squid_off_t object_sz; size_t swap_hdr_sz; #if URL_CHECKSUM_DEBUG unsigned int chksum; @@ -1539,7 +1531,7 @@ time_t lastref; time_t expires; time_t lastmod; - size_t swap_file_sz; + squid_file_sz swap_file_sz; u_short refcount; u_short flags; /* END OF ON-DISK STORE_META_STD */ @@ -1559,7 +1551,7 @@ int max_size; char *path; int index; /* This entry's index into the swapDirs array */ - ssize_t max_objsize; + squid_off_t max_objsize; RemovalPolicy *repl; int removals; int scanned; @@ -1639,8 +1631,8 @@ sfileno swap_filen; StoreEntry *e; /* Need this so the FS layers can play god */ mode_t mode; - size_t st_size; /* do stat(2) after read open */ - off_t offset; /* current on-disk offset pointer */ + squid_off_t st_size; /* do stat(2) after read open */ + squid_off_t offset; /* current on-disk offset pointer */ STFNCB *file_callback; /* called on delayed sfileno assignments */ STIOCB *callback; void *callback_data; @@ -1676,7 +1668,7 @@ struct in_addr my_addr; unsigned short my_port; HttpHeader header; - int content_length; + squid_off_t content_length; HierarchyLogEntry hier; err_type err_type; char *peer_login; /* Configured peer login:password */ @@ -1713,7 +1705,7 @@ struct _CommWriteStateData { char *buf; size_t size; - off_t offset; + size_t offset; CWCB *handler; void *handler_data; FREE *free_func; @@ -1910,12 +1902,35 @@ time_t lastref; time_t expires; time_t lastmod; + squid_file_sz swap_file_sz; + u_short refcount; + u_short flags; + unsigned char key[MD5_DIGEST_CHARS]; +}; + +struct _storeSwapLogHeader { + char op; + int version; + int record_size; +}; + +#if SIZEOF_SQUID_FILE_SZ != SIZEOF_SIZE_T +struct _storeSwapLogDataOld { + char op; + sfileno swap_filen; + time_t timestamp; + time_t lastref; + time_t expires; + time_t lastmod; size_t swap_file_sz; u_short refcount; u_short flags; unsigned char key[MD5_DIGEST_CHARS]; }; +#endif + + /* object to track per-action memory usage (e.g. #idle objects) */ struct _MemMeter { ssize_t level; /* current level (count or volume) */ @@ -1962,7 +1977,7 @@ struct _CacheDigest { /* public, read-only */ char *mask; /* bit mask */ - size_t mask_size; /* mask size in bytes */ + int mask_size; /* mask size in bytes */ int capacity; /* expected maximum for .count, not a hard limit */ int bits_per_entry; /* number of bits allocated for each entry from capacity */ int count; /* number of digested entries */ @@ -2074,7 +2089,7 @@ int wfd; char *buf; size_t buf_sz; - off_t offset; + int offset; struct timeval dispatch_time; struct timeval answer_time; dlink_node link; @@ -2098,7 +2113,7 @@ int wfd; char *buf; size_t buf_sz; - off_t offset; + int offset; struct timeval dispatch_time; struct timeval answer_time; dlink_node link; @@ -2183,7 +2198,7 @@ char path[MAXPATHLEN]; char *buf; size_t bufsz; - off_t offset; + ssize_t offset; struct { unsigned int fatal:1; } flags; diff -ruN squid-2.5.STABLE9/src/tools.c squid-2.5.STABLE10/src/tools.c --- squid-2.5.STABLE9/src/tools.c Sun Feb 13 14:19:44 2005 +++ squid-2.5.STABLE10/src/tools.c Fri Apr 22 14:45:12 2005 @@ -1,6 +1,6 @@ /* - * $Id: tools.c,v 1.213.2.11 2005/02/13 21:19:44 serassio Exp $ + * $Id: tools.c,v 1.213.2.15 2005/04/22 20:45:12 hno Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -341,8 +341,10 @@ fprintf(debug_log, "Squid Cache (Version %s): Terminated abnormally.\n", version_string); fflush(debug_log); - PrintRusage(); - dumpMallocStats(); + if (!shutting_down) { + PrintRusage(); + dumpMallocStats(); + } } /* fatal */ @@ -357,7 +359,7 @@ storeDirWriteCleanLogs(0); fatal_common(message); if (shutting_down) - exit(0); + exit(1); else abort(); } @@ -615,6 +617,7 @@ { FILE *pid_fp = NULL; const char *f = Config.pidFilename; + char *chroot_f = NULL; pid_t pid = -1; int i; @@ -622,6 +625,12 @@ fprintf(stderr, "%s: ERROR: No pid file name defined\n", appname); exit(1); } + if (Config.chroot_dir && geteuid() == 0) { + int len = strlen(Config.chroot_dir) + 1 + strlen(f) + 1; + chroot_f = xmalloc(len); + snprintf(chroot_f, len, "%s/%s", Config.chroot_dir, f); + f = chroot_f; + } pid_fp = fopen(f, "r"); if (pid_fp != NULL) { pid = 0; @@ -635,6 +644,7 @@ exit(1); } } + safe_free(chroot_f); return pid; } @@ -839,7 +849,7 @@ } void -kb_incr(kb_t * k, size_t v) +kb_incr(kb_t * k, squid_off_t v) { k->bytes += v; k->kb += (k->bytes >> 10); @@ -937,6 +947,9 @@ xrename(const char *from, const char *to) { debug(21, 2) ("xrename: renaming %s to %s\n", from, to); +#if defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) + remove(to); +#endif if (0 == rename(from, to)) return 0; debug(21, errno == ENOENT ? 2 : 1) ("xrename: Cannot rename %s to %s: %s\n", diff -ruN squid-2.5.STABLE9/src/typedefs.h squid-2.5.STABLE10/src/typedefs.h --- squid-2.5.STABLE9/src/typedefs.h Tue Oct 5 16:34:42 2004 +++ squid-2.5.STABLE10/src/typedefs.h Sat Mar 26 17:20:13 2005 @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.132.2.6 2004/10/05 22:34:42 hno Exp $ + * $Id: typedefs.h,v 1.132.2.8 2005/03/27 00:20:13 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -41,9 +41,29 @@ typedef signed int sfileno; typedef signed int sdirno; +#if SIZEOF_INT64_T > SIZEOF_LONG && defined(PRId64) && defined(INT64_MAX) && HAVE_STRTOLL +typedef int64_t squid_off_t; +#define SIZEOF_SQUID_OFF_T SIZEOF_INT64_T +#define PRINTF_OFF_T PRId64 +#define strto_off_t (int64_t)strtoll +#else +typedef long squid_off_t; +#define SIZEOF_SQUID_OFF_T SIZEOF_LONG +#define PRINTF_OFF_T "ld" +#define strto_off_t strtol +#endif + +#if LARGE_CACHE_FILES +typedef squid_off_t squid_file_sz; +#define SIZEOF_SQUID_FILE_SZ SIZEOF_SQUID_OFF_T +#else +typedef size_t squid_file_sz; +#define SIZEOF_SQUID_FILE_SZ SIZEOF_SIZE_T +#endif + typedef struct { - size_t bytes; - size_t kb; + squid_off_t bytes; + squid_off_t kb; } kb_t; typedef struct { @@ -90,7 +110,6 @@ typedef struct _SquidConfig2 SquidConfig2; typedef struct _close_handler close_handler; typedef struct _dread_ctrl dread_ctrl; -typedef struct _dnsserver_t dnsserver_t; typedef struct _dwrite_q dwrite_q; typedef struct _ETag ETag; typedef struct _fde fde; @@ -160,6 +179,8 @@ typedef struct _StatCounters StatCounters; typedef struct _tlv tlv; typedef struct _storeSwapLogData storeSwapLogData; +typedef struct _storeSwapLogDataOld storeSwapLogDataOld; +typedef struct _storeSwapLogHeader storeSwapLogHeader; typedef struct _authConfig authConfig; typedef struct _cacheSwap cacheSwap; typedef struct _StatHist StatHist; @@ -275,8 +296,8 @@ typedef storeIOState *STOBJCREATE(SwapDir *, StoreEntry *, STFNCB *, STIOCB *, void *); typedef storeIOState *STOBJOPEN(SwapDir *, StoreEntry *, STFNCB *, STIOCB *, void *); typedef void STOBJCLOSE(SwapDir *, storeIOState *); -typedef void STOBJREAD(SwapDir *, storeIOState *, char *, size_t, off_t, STRCB *, void *); -typedef void STOBJWRITE(SwapDir *, storeIOState *, char *, size_t, off_t, FREE *); +typedef void STOBJREAD(SwapDir *, storeIOState *, char *, size_t, squid_off_t, STRCB *, void *); +typedef void STOBJWRITE(SwapDir *, storeIOState *, char *, size_t, squid_off_t, FREE *); typedef void STOBJUNLINK(SwapDir *, StoreEntry *); typedef void STLOGOPEN(SwapDir *); @@ -322,7 +343,7 @@ typedef const char *AUTHSCONNLASTHEADER(auth_user_request_t *); /* append/vprintf's for Packer */ -typedef void (*append_f) (void *, const char *buf, int size); +typedef void (*append_f) (void *, const char *buf, size_t size); #if STDC_HEADERS typedef void (*vprintf_f) (void *, const char *fmt, va_list args); #else @@ -336,13 +357,13 @@ typedef int Ctx; /* in case we want to change it later */ -typedef ssize_t mb_size_t; +typedef int mb_size_t; /* iteration for HttpHdrRange */ typedef int HttpHdrRangePos; /*iteration for headers; use HttpHeaderPos as opaque type, do not interpret */ -typedef ssize_t HttpHeaderPos; +typedef int HttpHeaderPos; /* big mask for http headers */ typedef char HttpHeaderMask[8];