diff -ruN squid-2.7.STABLE2/ChangeLog squid-2.7.STABLE3/ChangeLog --- squid-2.7.STABLE2/ChangeLog 2008-05-31 23:23:33.000000000 +0200 +++ squid-2.7.STABLE3/ChangeLog 2008-06-25 01:17:19.000000000 +0200 @@ -1,3 +1,38 @@ +Changes to squid-2.7.STABLE3 (25 June 2008) + + - Byg #2376: Round-Robin peer selection becomes unbalanced when a + peer dies and comes back + - Bug #2365: cachemgr.cgi fails to HTML encode config dumps properly + - Bug #2122: In some situations collapsed_forwarding could leak + private information + - Bug #2388: acl documentation cleanup + - Report the cache_peer name instead of hostname + - Bug #2378: Duplicate paths in FwdServers + - Bug #1993: Memory leak in http_reply_access deny processing + - Plug some "squid -k reconfigure" memory leaks. Mostly SSL related. + - wccp2 sevice flags documentation correction for dst_port_hash + - Fix SNMP reporting of counters with a value > 0xFF800000 + - Reject ridiculously large ASN.1 lengths + - logformat docs contain extra whitespace + - Off by one error in DNS label decompression could cause valid DNS + messages to be rejected + - Bug #2241: weights not applied properly in round-robin peer + selection + - Bug #2283: Properly abort invalid/truncated messages + - Bug #2192: http_port ... vport broken by recent changes in how + accelerator mode deals with port numbers + - Fix build error on Solaris using gcc and --with-large-files + - Windows port: add support for crypt function + - Bug #2372: Segmentation fault if netdb_filename could not be written + - Windows port: add option for control of IP address changes + notification in squid.conf + - Windows port: always shutdown winsocks on program termination + - Windows port: configure enhancements on MinGW and Cygwin + - Windows port: fix build error on Cygwin + - Bug #2366: Fix assertion/FD leak during logfile_mod_daemon rotate. + - Release notes correction: delay_body_max_size is not in 2.7 (2.8 + feature) and bug #219 delay pools on -k reconfigure has been fixed + Changes to squid-2.7.STABLE2 (31 May 2008) - Resolved merge conflict in Bug #219: Reassign delay pools after diff -ruN squid-2.7.STABLE2/configure squid-2.7.STABLE3/configure --- squid-2.7.STABLE2/configure 2008-05-31 23:25:30.000000000 +0200 +++ squid-2.7.STABLE3/configure 2008-06-26 00:18:55.000000000 +0200 @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Revision: 1.430.2.7 . +# From configure.in Revision: 1.430.2.11 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for Squid Web Proxy 2.7.STABLE2. +# Generated by GNU Autoconf 2.61 for Squid Web Proxy 2.7.STABLE3. # # Report bugs to . # @@ -575,8 +575,8 @@ # Identity of this package. PACKAGE_NAME='Squid Web Proxy' PACKAGE_TARNAME='squid' -PACKAGE_VERSION='2.7.STABLE2' -PACKAGE_STRING='Squid Web Proxy 2.7.STABLE2' +PACKAGE_VERSION='2.7.STABLE3' +PACKAGE_STRING='Squid Web Proxy 2.7.STABLE3' PACKAGE_BUGREPORT='http://www.squid-cache.org/bugs/' ac_default_prefix=/usr/local/squid @@ -1312,7 +1312,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Squid Web Proxy 2.7.STABLE2 to adapt to many kinds of systems. +\`configure' configures Squid Web Proxy 2.7.STABLE3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1382,7 +1382,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Squid Web Proxy 2.7.STABLE2:";; + short | recursive ) echo "Configuration of Squid Web Proxy 2.7.STABLE3:";; esac cat <<\_ACEOF @@ -1663,7 +1663,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Squid Web Proxy configure 2.7.STABLE2 +Squid Web Proxy configure 2.7.STABLE3 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1677,7 +1677,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Squid Web Proxy $as_me 2.7.STABLE2, which was +It was created by Squid Web Proxy $as_me 2.7.STABLE3, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2350,7 +2350,7 @@ # Define the identity of the package. PACKAGE='squid' - VERSION='2.7.STABLE2' + VERSION='2.7.STABLE3' cat >>confdefs.h <<_ACEOF @@ -5247,6 +5247,9 @@ if test "$GCC" = "yes"; then echo "Removing -Xa for gcc on $host" CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`" + echo "Replacing -xarch=generic64 with -m64 for gcc on $host" + CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`" + LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`" fi echo "Removing -Usun on $host" CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`" @@ -23143,31 +23146,33 @@ fi -{ echo "$as_me:$LINENO: checking for winsock" >&5 + case "$host_os" in + mingw|mingw32) + { echo "$as_me:$LINENO: checking for winsock" >&5 echo $ECHO_N "checking for winsock... $ECHO_C" >&6; } -save_LIBS="$LIBS" -for curlib in ws2_32 wsock32; do - LIBS="$LIBS -l$curlib" - cat >conftest.$ac_ext <<_ACEOF + save_LIBS="$LIBS" + for curlib in ws2_32 wsock32; do + LIBS="$LIBS -l$curlib" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - char __attribute__((stdcall)) socket(int,int,int); - char __attribute__((stdcall)) select(int,int,int,int,int); - char __attribute__((stdcall)) closesocket(int); - char __attribute__((stdcall)) gethostname(int,int); + char __attribute__((stdcall)) socket(int,int,int); + char __attribute__((stdcall)) select(int,int,int,int,int); + char __attribute__((stdcall)) closesocket(int); + char __attribute__((stdcall)) gethostname(int,int); int main () { - socket(1,2,3); - select(1,2,3,4,5); - closesocket(1); - gethostname(1,2); + socket(1,2,3); + select(1,2,3,4,5); + closesocket(1); + gethostname(1,2); ; return 0; @@ -23202,17 +23207,312 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext - if test $have_winsock = yes; then - ac_cv_func_select='yes' - if test $curlib = ws2_32; then - have_winsock=winsock2 + if test $have_winsock = yes; then + ac_cv_func_select='yes' + if test $curlib = ws2_32; then + have_winsock=winsock2 + fi + break fi - break - fi - LIBS="$save_LIBS" -done -{ echo "$as_me:$LINENO: result: $have_winsock" >&5 + LIBS="$save_LIBS" + done + { echo "$as_me:$LINENO: result: $have_winsock" >&5 echo "${ECHO_T}$have_winsock" >&6; } + if test $have_winsock = winsock2; then + +for ac_header in winsock2.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------------------- ## +## Report this to http://www.squid-cache.org/bugs/ ## +## ----------------------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + else + +for ac_header in winsock.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------------------- ## +## Report this to http://www.squid-cache.org/bugs/ ## +## ----------------------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + fi + ;; +esac { echo "$as_me:$LINENO: checking for unix domain sockets" >&5 echo $ECHO_N "checking for unix domain sockets... $ECHO_C" >&6; } @@ -25884,6 +26184,12 @@ #if HAVE_SYS_TYPES_H #include #endif +#if HAVE_WINSOCK_H +#include +#endif +#if HAVE_WINSOCK2_H +#include +#endif main() { FILE *fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", FD_SETSIZE); @@ -26096,14 +26402,31 @@ #include #include #include +#if HAVE_SYS_SOCKET_H #include +#endif +#if HAVE_NETINET_IN_H #include +#endif +#if HAVE_WINSOCK_H +#include +#endif +#if HAVE_WINSOCK2_H +#include +#endif main () { FILE *fp; int fd,val=0,len=sizeof(int); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSADATA wsaData; + WSAStartup(2, &wsaData); +#endif if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSACleanup(); +#endif if (val<=0) exit(1); fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); @@ -26167,14 +26490,31 @@ #include #include #include +#if HAVE_SYS_SOCKET_H #include +#endif +#if HAVE_NETINET_IN_H #include +#endif +#if HAVE_WINSOCK_H +#include +#endif +#if HAVE_WINSOCK2_H +#include +#endif main () { FILE *fp; int fd,val=0,len=sizeof(int); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSADATA wsaData; + WSAStartup(2, &wsaData); +#endif if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSACleanup(); +#endif if (val <= 0) exit(1); fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); @@ -26238,14 +26578,31 @@ #include #include #include +#if HAVE_SYS_SOCKET_H #include +#endif +#if HAVE_NETINET_IN_H #include +#endif +#if HAVE_WINSOCK_H +#include +#endif +#if HAVE_WINSOCK2_H +#include +#endif main () { FILE *fp; int fd,val=0,len=sizeof(int); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSADATA wsaData; + WSAStartup(2, &wsaData); +#endif if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSACleanup(); +#endif if (val <= 0) exit(1); fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); @@ -26313,14 +26670,31 @@ #include #include #include +#if HAVE_SYS_SOCKET_H #include +#endif +#if HAVE_NETINET_IN_H #include +#endif +#if HAVE_WINSOCK_H +#include +#endif +#if HAVE_WINSOCK2_H +#include +#endif main () { FILE *fp; int fd,val=0,len=sizeof(int); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSADATA wsaData; + WSAStartup(2, &wsaData); +#endif if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSACleanup(); +#endif if (val <= 0) exit(1); fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); @@ -27415,7 +27789,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Squid Web Proxy $as_me 2.7.STABLE2, which was +This file was extended by Squid Web Proxy $as_me 2.7.STABLE3, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -27468,7 +27842,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Squid Web Proxy config.status 2.7.STABLE2 +Squid Web Proxy config.status 2.7.STABLE3 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -ruN squid-2.7.STABLE2/configure.in squid-2.7.STABLE3/configure.in --- squid-2.7.STABLE2/configure.in 2008-05-31 23:25:30.000000000 +0200 +++ squid-2.7.STABLE3/configure.in 2008-06-26 00:18:55.000000000 +0200 @@ -1,16 +1,16 @@ dnl dnl Configuration input file for Squid dnl -dnl $Id: configure.in,v 1.430.2.7 2008/05/31 21:23:33 hno Exp $ +dnl $Id: configure.in,v 1.430.2.11 2008/06/24 23:17:19 hno Exp $ dnl dnl dnl -AC_INIT(Squid Web Proxy, 2.7.STABLE2, http://www.squid-cache.org/bugs/, squid) +AC_INIT(Squid Web Proxy, 2.7.STABLE3, http://www.squid-cache.org/bugs/, squid) AC_PREREQ(2.52) AM_CONFIG_HEADER(include/autoconf.h) AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE -AC_REVISION($Revision: 1.430.2.7 $)dnl +AC_REVISION($Revision: 1.430.2.11 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -1093,13 +1093,18 @@ LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS" case "$host" in dnl -dnl On Solaris getconf returns for CFLAGS -Xa and -Usun options, but: -dnl -Xa is supported only by Sun cc, so we need to remove it when using gcc -dnl The 'sun' define is needed by ipfilter includes, so we must remove -Usun +dnl On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and +dnl for LDFLAGS -xarch=generic64, but: +dnl "-Xa" is supported only by Sun cc, so we need to remove it when using gcc +dnl For gcc "-xarch=generic64" must be replaced with "-m64" +dnl The 'sun' define is needed by ipfilter includes, so we must remove "-Usun" *-solaris*) if test "$GCC" = "yes"; then echo "Removing -Xa for gcc on $host" CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`" + echo "Replacing -xarch=generic64 with -m64 for gcc on $host" + CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`" + LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`" fi echo "Removing -Usun on $host" CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`" @@ -2033,34 +2038,44 @@ dnl Check for needed libraries AC_CHECK_LIB(nsl, main) AC_CHECK_LIB(socket, main) -AC_MSG_CHECKING(for winsock) -save_LIBS="$LIBS" -for curlib in ws2_32 wsock32; do - LIBS="$LIBS -l$curlib" - AC_TRY_LINK([ - char __attribute__((stdcall)) socket(int,int,int); - char __attribute__((stdcall)) select(int,int,int,int,int); - char __attribute__((stdcall)) closesocket(int); - char __attribute__((stdcall)) gethostname(int,int); - ], - [ - socket(1,2,3); - select(1,2,3,4,5); - closesocket(1); - gethostname(1,2); - ], - have_winsock=yes, have_winsock=no) - - if test $have_winsock = yes; then - ac_cv_func_select='yes' - if test $curlib = ws2_32; then - have_winsock=winsock2 +dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API + case "$host_os" in + mingw|mingw32) + AC_MSG_CHECKING(for winsock) + save_LIBS="$LIBS" + for curlib in ws2_32 wsock32; do + LIBS="$LIBS -l$curlib" + AC_TRY_LINK([ + char __attribute__((stdcall)) socket(int,int,int); + char __attribute__((stdcall)) select(int,int,int,int,int); + char __attribute__((stdcall)) closesocket(int); + char __attribute__((stdcall)) gethostname(int,int); + ], + [ + socket(1,2,3); + select(1,2,3,4,5); + closesocket(1); + gethostname(1,2); + ], + have_winsock=yes, have_winsock=no) + + if test $have_winsock = yes; then + ac_cv_func_select='yes' + if test $curlib = ws2_32; then + have_winsock=winsock2 + fi + break fi - break + LIBS="$save_LIBS" + done + AC_MSG_RESULT($have_winsock) + if test $have_winsock = winsock2; then + AC_CHECK_HEADERS(winsock2.h) + else + AC_CHECK_HEADERS(winsock.h) fi - LIBS="$save_LIBS" -done -AC_MSG_RESULT($have_winsock) + ;; +esac dnl Ripped from the Samba sources AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [ @@ -2787,6 +2802,12 @@ #if HAVE_SYS_TYPES_H #include #endif +#if HAVE_WINSOCK_H +#include +#endif +#if HAVE_WINSOCK2_H +#include +#endif main() { FILE *fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", FD_SETSIZE); @@ -2911,14 +2932,31 @@ #include #include #include +#if HAVE_SYS_SOCKET_H #include +#endif +#if HAVE_NETINET_IN_H #include +#endif +#if HAVE_WINSOCK_H +#include +#endif +#if HAVE_WINSOCK2_H +#include +#endif main () { FILE *fp; int fd,val=0,len=sizeof(int); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSADATA wsaData; + WSAStartup(2, &wsaData); +#endif if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSACleanup(); +#endif if (val<=0) exit(1); fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); @@ -2937,14 +2975,31 @@ #include #include #include +#if HAVE_SYS_SOCKET_H #include +#endif +#if HAVE_NETINET_IN_H #include +#endif +#if HAVE_WINSOCK_H +#include +#endif +#if HAVE_WINSOCK2_H +#include +#endif main () { FILE *fp; int fd,val=0,len=sizeof(int); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSADATA wsaData; + WSAStartup(2, &wsaData); +#endif if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1); if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSACleanup(); +#endif if (val <= 0) exit(1); fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); @@ -2963,14 +3018,31 @@ #include #include #include +#if HAVE_SYS_SOCKET_H #include +#endif +#if HAVE_NETINET_IN_H #include +#endif +#if HAVE_WINSOCK_H +#include +#endif +#if HAVE_WINSOCK2_H +#include +#endif main () { FILE *fp; int fd,val=0,len=sizeof(int); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSADATA wsaData; + WSAStartup(2, &wsaData); +#endif if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSACleanup(); +#endif if (val <= 0) exit(1); fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); @@ -2993,14 +3065,31 @@ #include #include #include +#if HAVE_SYS_SOCKET_H #include +#endif +#if HAVE_NETINET_IN_H #include +#endif +#if HAVE_WINSOCK_H +#include +#endif +#if HAVE_WINSOCK2_H +#include +#endif main () { FILE *fp; int fd,val=0,len=sizeof(int); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSADATA wsaData; + WSAStartup(2, &wsaData); +#endif if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1); if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1); +#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__)) + WSACleanup(); +#endif if (val <= 0) exit(1); fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", val); diff -ruN squid-2.7.STABLE2/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c squid-2.7.STABLE3/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c --- squid-2.7.STABLE2/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c 2008-05-05 01:26:30.000000000 +0200 +++ squid-2.7.STABLE3/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c 2008-06-04 22:32:47.000000000 +0200 @@ -129,6 +129,15 @@ char *progname = "squid_rad_auth"; int debug_flag = 0; +#ifdef _SQUID_MSWIN_ +void +Win32SockCleanup(void) +{ + WSACleanup(); + return; +} +#endif /* ifdef _SQUID_MSWIN_ */ + /* * Diff two timeval, b - a */ @@ -183,12 +192,10 @@ totallen, length); return -1; } - if (auth->id != request_id) { /* Duplicate response of an earlier query, ignore */ return -1; } - /* Verify the reply digest */ memcpy(reply_digest, auth->vector, AUTH_VECTOR_LEN); memcpy(auth->vector, vector, AUTH_VECTOR_LEN); @@ -200,7 +207,6 @@ fprintf(stderr, "Warning: Received invalid reply digest from server\n"); return -1; } - if (auth->code != PW_AUTHENTICATION_ACK) return 1; @@ -251,9 +257,9 @@ crt = sscanf(line, "secret %s", secretkey); if (!memcmp(line, "identifier", 10)) sscanf(line, "identifier %s", identifier); - if (!memcmp(line, "service", 7)) + if (!memcmp(line, "service", 7)) sscanf(line, "service %s", svc_name); - if (!memcmp(line, "port", 4)) + if (!memcmp(line, "port", 4)) sscanf(line, "port %s", svc_name); } if (srv && crt) @@ -347,7 +353,7 @@ memcpy(cbc, auth->vector, AUTH_VECTOR_LEN); for (j = 0; j < length; j += AUTH_VECTOR_LEN) { /* Calculate the MD5 Digest */ - strcpy((char *)md5buf, secretkey); + strcpy((char *) md5buf, secretkey); memcpy(md5buf + secretlen, cbc, AUTH_VECTOR_LEN); md5_calc(cbc, md5buf, secretlen + AUTH_VECTOR_LEN); @@ -400,7 +406,7 @@ */ auth->length = htons(total_length); - while(retry--) { + while (retry--) { int time_spent; struct timeval sent; /* @@ -433,7 +439,7 @@ if (rc == 0) return 1; if (rc == 1) - return 0; + return 0; } } @@ -459,7 +465,7 @@ int c; while ((c = getopt(argc, argv, "h:p:f:w:i:t:")) != -1) { - switch(c) { + switch (c) { case 'f': cfname = optarg; break; @@ -490,21 +496,19 @@ exit(1); } } - if (!*server) { fprintf(stderr, "%s: Server not specified\n", argv[0]); exit(1); } - if (!*secretkey) { fprintf(stderr, "%s: Shared secret not specified\n", argv[0]); exit(1); } - #ifdef _SQUID_MSWIN_ { WSADATA wsaData; WSAStartup(2, &wsaData); + atexit(Win32SockCleanup); } #endif /* diff -ruN squid-2.7.STABLE2/include/autoconf.h.in squid-2.7.STABLE3/include/autoconf.h.in --- squid-2.7.STABLE2/include/autoconf.h.in 2008-02-24 02:17:16.000000000 +0100 +++ squid-2.7.STABLE3/include/autoconf.h.in 2008-06-05 02:18:07.000000000 +0200 @@ -618,6 +618,12 @@ /* Define if you have PSAPI.DLL on Windows systems */ #undef HAVE_WIN32_PSAPI +/* Define to 1 if you have the header file. */ +#undef HAVE_WINSOCK2_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WINSOCK_H + /* Some systems support __va_copy */ #undef HAVE___VA_COPY diff -ruN squid-2.7.STABLE2/include/version.h squid-2.7.STABLE3/include/version.h --- squid-2.7.STABLE2/include/version.h 2008-05-31 23:25:30.000000000 +0200 +++ squid-2.7.STABLE3/include/version.h 2008-06-26 00:18:55.000000000 +0200 @@ -9,5 +9,5 @@ */ #ifndef SQUID_RELEASE_TIME -#define SQUID_RELEASE_TIME 1212269126 +#define SQUID_RELEASE_TIME 1214432332 #endif diff -ruN squid-2.7.STABLE2/lib/encrypt.c squid-2.7.STABLE3/lib/encrypt.c --- squid-2.7.STABLE2/lib/encrypt.c 1970-01-01 01:00:00.000000000 +0100 +++ squid-2.7.STABLE3/lib/encrypt.c 2008-06-04 22:37:51.000000000 +0200 @@ -0,0 +1,309 @@ +/* encrypt.c - providing 56 bit DES encryption + * Copyright (C) 1991 Jochen Obalek + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include +#include +#include + +#define BS 64 +#define BS2 32 +#define KS 48 +#define KS2 24 +#define IS 56 +#define IS2 28 + +static char schluessel[16][KS]; + + +static char PC1[] = +{ + 56, 48, 40, 32, 24, 16, 8, 0, + 57, 49, 41, 33, 25, 17, 9, 1, + 58, 50, 42, 34, 26, 18, 10, 2, + 59, 51, 43, 35, + 62, 54, 46, 38, 30, 22, 14, 6, + 61, 53, 45, 37, 29, 21, 13, 5, + 60, 52, 44, 36, 28, 20, 12, 4, + 27, 19, 11, 3 +}; + + +static char PC2[] = +{ + 13, 16, 10, 23, 0, 4, 2, 27, + 14, 5, 20, 9, 22, 18, 11, 3, + 25, 7, 15, 6, 26, 19, 12, 1, + 40, 51, 30, 36, 46, 54, 29, 39, + 50, 44, 32, 47, 43, 48, 38, 55, + 33, 52, 45, 41, 49, 35, 28, 31 +}; + + +static char IP[] = +{ + 57, 49, 41, 33, 25, 17, 9, 1, + 59, 51, 43, 35, 27, 19, 11, 3, + 61, 53, 45, 37, 29, 21, 13, 5, + 63, 55, 47, 39, 31, 23, 15, 7, + 56, 48, 40, 32, 24, 16, 8, 0, + 58, 50, 42, 34, 26, 18, 10, 2, + 60, 52, 44, 36, 28, 20, 12, 4, + 62, 54, 46, 38, 30, 22, 14, 6 +}; + + +static char EP[] = +{ + 7, 39, 15, 47, 23, 55, 31, 63, + 6, 38, 14, 46, 22, 54, 30, 62, + 5, 37, 13, 45, 21, 53, 29, 61, + 4, 36, 12, 44, 20, 52, 28, 60, + 3, 35, 11, 43, 19, 51, 27, 59, + 2, 34, 10, 42, 18, 50, 26, 58, + 1, 33, 9, 41, 17, 49, 25, 57, + 0, 32, 8, 40, 16, 48, 24, 56 +}; + + +static char E0[] = +{ + 31, 0, 1, 2, 3, 4, 3, 4, + 5, 6, 7, 8, 7, 8, 9, 10, + 11, 12, 11, 12, 13, 14, 15, 16, + 15, 16, 17, 18, 19, 20, 19, 20, + 21, 22, 23, 24, 23, 24, 25, 26, + 27, 28, 27, 28, 29, 30, 31, 0 +}; + + +static char E[KS]; + + +static char PERM[] = +{ + 15, 6, 19, 20, 28, 11, 27, 16, + 0, 14, 22, 25, 4, 17, 30, 9, + 1, 7, 23, 13, 31, 26, 2, 8, + 18, 12, 29, 5, 21, 10, 3, 24 +}; + + +static char S_BOX[][64] = +{ + { + 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, + 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, + 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, + 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13 + }, + { + 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, + 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, + 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, + 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9 + }, + { + 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, + 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, + 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, + 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12 + }, + { + 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, + 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, + 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, + 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14 + }, + { + 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, + 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, + 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, + 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3 + }, + { + 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, + 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, + 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, + 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13 + }, + { + 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, + 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, + 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, + 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12 + }, + { + 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, + 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, + 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, + 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11 + } +}; + +static void +perm(a, e, pc, n) + register char *a, *e; + register char *pc; + int n; +{ + for (; n--; pc++, a++) + *a = e[*pc]; +} + +static void +crypt_main(nachr_l, nachr_r, schl) + register char *nachr_l, *nachr_r; + register char *schl; +{ + char tmp[KS]; + register int sbval; + register char *tp = tmp; + register char *e = E; + register int i, j; + + for (i = 0; i < 8; i++) { + for (j = 0, sbval = 0; j < 6; j++) + sbval = (sbval << 1) | (nachr_r[*e++] ^ *schl++); + sbval = S_BOX[i][sbval]; + for (tp += 4, j = 4; j--; sbval >>= 1) + *--tp = sbval & 1; + tp += 4; + } + + e = PERM; + for (i = 0; i < BS2; i++) + *nachr_l++ ^= tmp[*e++]; +} + +void +encrypt(char *nachr, int decr) +{ + char (*schl)[KS] = decr ? schluessel + 15 : schluessel; + char tmp[BS]; + int i; + + perm(tmp, nachr, IP, BS); + + for (i = 8; i--;) { + crypt_main(tmp, tmp + BS2, *schl); + if (decr) + schl--; + else + schl++; + crypt_main(tmp + BS2, tmp, *schl); + if (decr) + schl--; + else + schl++; + } + + perm(nachr, tmp, EP, BS); +} + +void +setkey(char *schl) +{ + char tmp1[IS]; + register unsigned int ls = 0x7efc; + register int i, j, k; + register int shval = 0; + register char *akt_schl; + + memcpy(E, E0, KS); + perm(tmp1, schl, PC1, IS); + + for (i = 0; i < 16; i++) { + shval += 1 + (ls & 1); + akt_schl = schluessel[i]; + for (j = 0; j < KS; j++) { + if ((k = PC2[j]) >= IS2) { + if ((k += shval) >= IS) + k = (k - IS2) % IS2 + IS2; + } else if ((k += shval) >= IS2) + k %= IS2; + *akt_schl++ = tmp1[k]; + } + ls >>= 1; + } +} + +char * +crypt(const char *wort, const char *salt) +{ + static char retkey[14]; + char key[BS + 2]; + char *k; + int tmp, keybyte; + int i, j; + + memset(key, 0, BS + 2); + + for (k = key, i = 0; i < BS; i++) { + if (!(keybyte = *wort++)) + break; + k += 7; + for (j = 0; j < 7; j++, i++) { + *--k = keybyte & 1; + keybyte >>= 1; + } + k += 8; + } + + setkey(key); + memset(key, 0, BS + 2); + + for (k = E, i = 0; i < 2; i++) { + retkey[i] = keybyte = *salt++; + if (keybyte > 'Z') + keybyte -= 'a' - 'Z' - 1; + if (keybyte > '9') + keybyte -= 'A' - '9' - 1; + keybyte -= '.'; + + for (j = 0; j < 6; j++, keybyte >>= 1, k++) { + if (!(keybyte & 1)) + continue; + tmp = *k; + *k = k[24]; + k[24] = tmp; + } + } + + for (i = 0; i < 25; i++) + encrypt(key, 0); + + for (k = key, i = 0; i < 11; i++) { + for (j = keybyte = 0; j < 6; j++) { + keybyte <<= 1; + keybyte |= *k++; + } + + keybyte += '.'; + if (keybyte > '9') + keybyte += 'A' - '9' - 1; + if (keybyte > 'Z') + keybyte += 'a' - 'Z' - 1; + retkey[i + 2] = keybyte; + } + + retkey[i + 2] = 0; + + if (!retkey[1]) + retkey[1] = *retkey; + + return retkey; +} diff -ruN squid-2.7.STABLE2/lib/Makefile.am squid-2.7.STABLE3/lib/Makefile.am --- squid-2.7.STABLE2/lib/Makefile.am 2008-05-05 01:26:34.000000000 +0200 +++ squid-2.7.STABLE3/lib/Makefile.am 2008-06-04 22:37:51.000000000 +0200 @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in # -# $Id: Makefile.am,v 1.10.2.1 2008/05/04 23:26:34 hno Exp $ +# $Id: Makefile.am,v 1.10.2.2 2008/06/04 20:37:51 hno Exp $ # if NEED_OWN_SNPRINTF @@ -35,8 +35,12 @@ libntlmauth.a \ @LIBREGEX@ \ $(LIBSSPWIN32) +# +# dirent.c, ecnrypt.c and getopt.c are needed for native Windows support. +# EXTRA_libmiscutil_a_SOURCES = \ dirent.c \ + encrypt.c \ getopt.c \ snprintf.c \ strsep.c \ diff -ruN squid-2.7.STABLE2/lib/Makefile.in squid-2.7.STABLE3/lib/Makefile.in --- squid-2.7.STABLE2/lib/Makefile.in 2008-05-05 02:18:11.000000000 +0200 +++ squid-2.7.STABLE3/lib/Makefile.in 2008-06-05 02:18:09.000000000 +0200 @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $Id: Makefile.in,v 1.92.2.1 2008/05/05 00:18:11 hno Exp $ +# $Id: Makefile.in,v 1.92.2.2 2008/06/05 00:18:09 hno Exp $ # srcdir = @srcdir@ @@ -308,8 +308,12 @@ @LIBREGEX@ \ $(LIBSSPWIN32) +# +# dirent.c, ecnrypt.c and getopt.c are needed for native Windows support. +# EXTRA_libmiscutil_a_SOURCES = \ dirent.c \ + encrypt.c \ getopt.c \ snprintf.c \ strsep.c \ @@ -433,6 +437,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlmalloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encrypt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getfullhostname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ diff -ruN squid-2.7.STABLE2/lib/rfc1035.c squid-2.7.STABLE3/lib/rfc1035.c --- squid-2.7.STABLE2/lib/rfc1035.c 2005-05-17 18:56:36.000000000 +0200 +++ squid-2.7.STABLE3/lib/rfc1035.c 2008-06-19 03:11:44.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: rfc1035.c,v 1.29 2005/05/17 16:56:36 hno Exp $ + * $Id: rfc1035.c,v 1.29.6.1 2008/06/19 01:11:44 hno Exp $ * * Low level DNS protocol routines * AUTHOR: Duane Wessels @@ -298,7 +298,7 @@ s = ntohs(s); (*off) += sizeof(s); /* Sanity check */ - if ((*off) >= sz) + if ((*off) > sz) return 1; ptr = s & 0x3FFF; /* Make sure the pointer is inside this message */ diff -ruN squid-2.7.STABLE2/RELEASENOTES.html squid-2.7.STABLE3/RELEASENOTES.html --- squid-2.7.STABLE2/RELEASENOTES.html 2008-05-31 23:26:02.000000000 +0200 +++ squid-2.7.STABLE3/RELEASENOTES.html 2008-06-26 00:19:27.000000000 +0200 @@ -2,12 +2,12 @@ - Squid 2.7.STABLE2 release notes + Squid 2.7.STABLE3 release notes -

Squid 2.7.STABLE2 release notes

+

Squid 2.7.STABLE3 release notes

-

Squid Developers

$Id: release.html,v 1.1.2.4 2008/05/31 21:23:33 hno Exp $ +

Squid Developers

$Id: release.html,v 1.1.2.7 2008/06/24 23:17:59 hno Exp $
This document contains the release notes for version 2.7 of Squid. Squid is a WWW Cache application developed by the Web Caching community. @@ -38,12 +38,15 @@
  • 4.2 PSAPI.DLL (Process Status Helper) Considerations
  • 4.3 Registry DNS lookup
  • 4.4 Compatibility Notes -
  • 4.5 Known Limitations: -
  • 4.6 Using cache manager on Windows: +
  • 4.5 Known Limitations +
  • 4.6 Using cache manager on Windows

    5. Key changes in squid-2.7.STABLE2

    +

    +

    6. Key changes in squid-2.7.STABLE3

    +

    1. Key changes from squid 2.6

    @@ -154,7 +157,6 @@
    ignore_expect_100

    Experimental HTTP/1.1 support knobs

    external_refresh_check

    new helper to allow custom cache validations in accelerator setups

    -
    delay_body_max_size

    new way of using delay pools based on response size

    ignore_ims_on_miss

    optimization mainly targeted for accelerator setups

    max_filedescriptors

    can now be set runtime. Was previously hardcoded at build time and further limited by ulimit

    @@ -238,7 +240,6 @@
  • Bug #457: does not handle swap.state corruption properly
  • Bug #410: unstable if runs out of disk space
  • Bug #355: diskd may appear slow on low loads
  • -
  • Bug #219: delay_pools stops working on -k reconfigure
  • @@ -347,7 +348,7 @@

    -

    4.5 Known Limitations: +

    4.5 Known Limitations

    @@ -361,7 +362,7 @@

    -

    4.6 Using cache manager on Windows: +

    4.6 Using cache manager on Windows

    On Windows, cache manager (cachemgr.cgi) can be used with Microsoft IIS or Apache. @@ -411,5 +412,25 @@

    +

    6. Key changes in squid-2.7.STABLE3

    + +

    +

      +
    • Byg #2376: Round-Robin peer selection becomes unbalanced when a peer dies and comes back
    • +
    • Bug #2122: Private information leakage in collapsed_forwarding
    • +
    • Bug #1993: Memory leak in http_reply_access deny processing
    • +
    • Fix SNMP reporting of counters with a value > 0xFF80000
    • +
    • Reject ridiculously large ASN.1 lengths
    • +
    • Off by one error in DNS label decompression could cause valid DNS messages to be rejected
    • +
    • Bug #2241: weights not applied properly in round-robin peer selection
    • +
    • Bug #2192: http_port ... vport broken by recent changes in how accelerator mode deals with port numbers
    • +
    • Fix build error on Solaris using gcc and --with-large-files
    • +
    • Windows port: new option for control of IP address changes notification in squid.conf
    • +
    • See also the list of +squid-2.7.STABLE3 changes and the +ChangeLog file for details.
    • +
    +

    + diff -ruN squid-2.7.STABLE2/snmplib/asn1.c squid-2.7.STABLE3/snmplib/asn1.c --- squid-2.7.STABLE2/snmplib/asn1.c 2006-06-02 19:32:44.000000000 +0200 +++ squid-2.7.STABLE3/snmplib/asn1.c 2008-06-19 03:13:02.000000000 +0200 @@ -324,10 +324,10 @@ return (NULL); } integer = *intp; - mask = (u_int) 0xFF << (8 * (sizeof(int) - 1)); - /* mask is 0xFF000000 on a big-endian machine */ - if ((u_char) ((integer & mask) >> (8 * (sizeof(int) - 1))) & 0x80) { - /* if MSB is set */ + mask = (u_int) 0x80 << (8 * (sizeof(int) - 1)); + /* mask is 0x80000000 on a big-endian machine */ + if ((integer & mask) != 0) { + /* add a null byte if MSB is set, to prevent sign extension */ add_null_byte = 1; intsize++; } @@ -336,11 +336,11 @@ * this 2's complement integer. * There should be no sequence of 9 consecutive 1's or 0's at the * most significant end of the integer. + * The 1's case is taken care of above by adding a null byte. */ mask = (u_int) 0x1FF << ((8 * (sizeof(int) - 1)) - 1); /* mask is 0xFF800000 on a big-endian machine */ - while ((((integer & mask) == 0) - || ((integer & mask) == mask)) && intsize > 1) { + while (((integer & mask) == 0) && intsize > 1) { intsize--; integer <<= 8; } @@ -484,7 +484,7 @@ return (NULL); header_len = bufp - data; - if (header_len + asn_length > *datalength || (int) asn_length < 0) { + if (header_len + asn_length > *datalength || asn_length > (u_int)(2 << 18) ) { snmp_set_api_error(SNMPERR_ASN_DECODE); return (NULL); } diff -ruN squid-2.7.STABLE2/src/cache_cf.c squid-2.7.STABLE3/src/cache_cf.c --- squid-2.7.STABLE2/src/cache_cf.c 2008-05-05 01:23:13.000000000 +0200 +++ squid-2.7.STABLE3/src/cache_cf.c 2008-06-25 01:14:18.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.480.2.7 2008/05/04 23:23:13 hno Exp $ + * $Id: cache_cf.c,v 1.480.2.11 2008/06/24 23:14:18 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -1666,7 +1666,7 @@ dump_peer_options(entry, p); for (d = p->peer_domain; d; d = d->next) { storeAppendPrintf(entry, "cache_peer_domain %s %s%s\n", - p->host, + p->name, d->do_ping ? null_string : "!", d->domain); } @@ -1676,7 +1676,7 @@ } for (t = p->typelist; t; t = t->next) { storeAppendPrintf(entry, "neighbor_type_domain %s %s %s\n", - p->host, + p->name, peer_type_str(t->type), t->domain); } @@ -1716,6 +1716,7 @@ parse_peer(peer ** head) { char *token = NULL; + void *arg = NULL; /* throwaway arg to make eventAdd happy */ peer *p; p = cbdataAlloc(peer); p->http_port = CACHE_HTTP_PORT; @@ -1784,7 +1785,7 @@ #if USE_CARP } else if (!strcasecmp(token, "carp")) { if (p->type != PEER_PARENT) - fatalf("parse_peer: non-parent carp peer %s/%d\n", p->host, p->http_port); + fatalf("parse_peer: non-parent carp peer %s (%s:%d)\n", p->name, p->host, p->http_port); p->options.carp = 1; #endif #if DELAY_POOLS @@ -1915,7 +1916,9 @@ head = &(*head)->next; *head = p; Config.npeers++; - peerClearRR(p); + if (!reconfiguring && Config.npeers == 1) { + peerClearRRLoop(arg); + } } static void @@ -2866,7 +2869,7 @@ s->vhost = 1; s->accel = 1; } else if (strcmp(token, "vport") == 0) { - s->vport = ntohs(s->s.sin_port); + s->vport = -1; s->accel = 1; } else if (strncmp(token, "vport=", 6) == 0) { s->vport = xatos(token + 6); @@ -3035,6 +3038,15 @@ free_generic_http_port_data(&s->http); safe_free(s->cert); safe_free(s->key); + safe_free(s->cipher); + safe_free(s->options); + safe_free(s->clientca); + safe_free(s->cafile); + safe_free(s->capath); + safe_free(s->crlfile); + safe_free(s->dhfile); + safe_free(s->sslflags); + safe_free(s->sslcontext); if (s->sslContext) SSL_CTX_free(s->sslContext); s->sslContext = NULL; diff -ruN squid-2.7.STABLE2/src/cf.data.pre squid-2.7.STABLE3/src/cf.data.pre --- squid-2.7.STABLE2/src/cf.data.pre 2008-05-31 22:49:45.000000000 +0200 +++ squid-2.7.STABLE3/src/cf.data.pre 2008-06-25 00:54:18.000000000 +0200 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.450.2.20 2008/05/31 20:49:45 hno Exp $ +# $Id: cf.data.pre,v 1.450.2.24 2008/06/24 22:54:18 hno Exp $ # # SQUID Web Proxy Cache http://www.squid-cache.org/ # ---------------------------------------------------------- @@ -483,12 +483,14 @@ DOC_START Defining an Access List - acl aclname acltype string1 ... - acl aclname acltype "file" ... + Every access list definition must begin with an aclname and acltype, + followed by either type-specific arguments or a quoted filename that + they are read from. - when using "file", the file should contain one item per line + acl aclname acltype argument ... + acl aclname acltype "file" ... - acltype is one of the types described below + when using "file", the file should contain one item per line. By default, regular expressions are CASE-SENSITIVE. To make them case-insensitive, use the -i option. @@ -516,16 +518,16 @@ # if the reverse lookup fails. acl aclname time [day-abbrevs] [h1:m1-h2:m2] - day-abbrevs: - S - Sunday - M - Monday - T - Tuesday - W - Wednesday - H - Thursday - F - Friday - A - Saturday - h1:m1 must be less than h2:m2 - acl aclname url_regex [-i] ^http:// ... # regex matching on whole URL + # day-abbrevs: + # S - Sunday + # M - Monday + # T - Tuesday + # W - Wednesday + # H - Thursday + # F - Friday + # A - Saturday + # h1:m1 must be less than h2:m2 + acl aclname url_regex [-i] ^http:// ... # regex matching on whole URL acl aclname urlpath_regex [-i] \.gif$ ... # regex matching on URL path acl aclname urllogin [-i] [^a-zA-Z0-9] ... # regex matching on URL login field acl aclname port 80 70 21 ... @@ -593,7 +595,7 @@ # clients may appear to come from multiple addresses if they are # going through proxy farms, so a limit of 1 may cause user problems. - acl aclname req_mime_type mime-type1 ... + acl aclname req_mime_type mime-type ... # regex match against the mime type of the request generated # by the client. Can be used to detect file upload or some # types HTTP tunneling requests. @@ -605,7 +607,7 @@ # thought of as a superset of "browser", "referer" and "mime-type" # ACLs. - acl aclname rep_mime_type mime-type1 ... + acl aclname rep_mime_type mime-type ... # regex match against the mime type of the reply received by # squid. Can be used to detect file download or some # types HTTP tunneling requests. @@ -622,11 +624,11 @@ # # acl many_spaces rep_header Content-Disposition -i [[:space:]]{3,} - acl acl_name external class_name [arguments...] + acl aclname external class_name [arguments...] # external ACL lookup via a helper class defined by the # external_acl_type directive. - acl urlgroup group1 ... + acl aclname urlgroup group1 ... # match against the urlgroup as indicated by redirectors acl aclname user_cert attribute values... @@ -2266,8 +2268,10 @@ sn Unique sequence number per log line entry % a literal % character -logformat squid %ts.%03tu %6tr %>a %Ss/%03Hs %a %Ss/%03Hs %h] [%a %Ss/%03Hs %a %Ss/%03Hs %h] [%a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %h" "%{User-Agent}>h" %Ss:%Sh DOC_END @@ -4221,7 +4225,7 @@ The relevant WCCPv2 flags: + src_ip_hash, dst_ip_hash - + source_port_hash, dest_port_hash + + source_port_hash, dst_port_hash + src_ip_alt_hash, dst_ip_alt_hash + src_port_alt_hash, dst_port_alt_hash + ports_source @@ -5651,5 +5655,19 @@ time. DOC_END +NAME: windows_ipaddrchangemonitor +COMMENT: on|off +TYPE: onoff +DEFAULT: on +LOC: Config.onoff.WIN32_IpAddrChangeMonitor +DOC_START + On Windows Squid by default will monitor IP address changes and will + reconfigure itself after any detected event. This is very useful for + proxies connected to internet with dial-up interfaces. + In some cases (a Proxy server acting as VPN gateway is one) it could be + desiderable to disable this behaviour setting this to 'off'. + Note: after changing this, Squid service must be restarted. +DOC_END + EOF diff -ruN squid-2.7.STABLE2/src/client_side.c squid-2.7.STABLE3/src/client_side.c --- squid-2.7.STABLE2/src/client_side.c 2008-05-27 14:49:39.000000000 +0200 +++ squid-2.7.STABLE3/src/client_side.c 2008-06-25 00:54:47.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.754.2.14 2008/05/27 12:49:39 hno Exp $ + * $Id: client_side.c,v 1.754.2.16 2008/06/24 22:54:47 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -738,6 +738,7 @@ entry = NULL; } if (entry) { + http->request->flags.collapsed = 1; /* Don't trust the store entry */ storeLockObject(entry); hit = 1; } else { @@ -943,6 +944,11 @@ } http->old_entry = NULL; /* done with old_entry */ http->old_sc = NULL; + if (http->request->flags.collapsed && !http->flags.hit && EBIT_TEST(entry->flags, RELEASE_REQUEST)) { + /* Collapsed request, but the entry is not good to be sent */ + clientProcessMiss(http); + return; + } assert(!EBIT_TEST(entry->flags, ENTRY_ABORTED)); if (recopy) { storeClientCopyHeaders(http->sc, entry, @@ -2262,6 +2268,13 @@ return; } } + if (r->flags.collapsed && EBIT_TEST(e->flags, RELEASE_REQUEST)) { + /* collapsed_forwarding, but the joined request is not good + * to be cached.. + */ + clientProcessMiss(http); + return; + } /* * Got the headers, now grok them */ @@ -2933,6 +2946,9 @@ err = errorCon(page_id, HTTP_FORBIDDEN, http->orig_request); storeClientUnregister(http->sc, http->entry, http); http->sc = NULL; + if (http->reply) + httpReplyDestroy(http->reply); + http->reply = NULL; storeUnlockObject(http->entry); http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, http->request->method, @@ -3530,6 +3546,7 @@ debug(33, 4) ("clientProcessMiss: '%s %s'\n", RequestMethods[r->method].str, url); http->flags.hit = 0; + r->flags.collapsed = 0; /* * We might have a left-over StoreEntry from a failed cache hit * or IMS request. diff -ruN squid-2.7.STABLE2/src/dnsserver.c squid-2.7.STABLE3/src/dnsserver.c --- squid-2.7.STABLE2/src/dnsserver.c 2006-05-22 23:19:48.000000000 +0200 +++ squid-2.7.STABLE3/src/dnsserver.c 2008-06-04 22:32:48.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: dnsserver.c,v 1.62 2006/05/22 21:19:48 serassio Exp $ + * $Id: dnsserver.c,v 1.62.6.1 2008/06/04 20:32:48 hno Exp $ * * DEBUG: section 0 DNS Resolver * AUTHOR: Harvest Derived @@ -346,8 +346,12 @@ #endif for (;;) { memset(request, '\0', REQ_SZ); - if (fgets(request, REQ_SZ, stdin) == NULL) + if (fgets(request, REQ_SZ, stdin) == NULL) { +#ifdef _SQUID_MSWIN_ + WSACleanup(); +#endif exit(1); + } t = strrchr(request, '\n'); if (t == NULL) /* Ignore if no newline */ continue; diff -ruN squid-2.7.STABLE2/src/forward.c squid-2.7.STABLE3/src/forward.c --- squid-2.7.STABLE2/src/forward.c 2008-01-23 12:39:16.000000000 +0100 +++ squid-2.7.STABLE3/src/forward.c 2008-06-19 03:08:29.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.131.2.2 2008/01/23 11:39:16 hno Exp $ + * $Id: forward.c,v 1.131.2.3 2008/06/19 01:08:29 hno Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -100,15 +100,8 @@ fwdLog(fwdState); #endif if (e->store_status == STORE_PENDING) { - if (e->mem_obj->inmem_hi == 0) { - assert(fwdState->err); - errorAppendEntry(e, fwdState->err); - fwdState->err = NULL; - } else { - EBIT_CLR(e->flags, ENTRY_FWD_HDR_WAIT); - storeReleaseRequest(e); - storeComplete(e); - } + storeRequestFailed(e, fwdState->err); + fwdState->err = NULL; } if (EBIT_TEST(e->flags, ENTRY_DEFER_READ)) storeResetDefer(e); diff -ruN squid-2.7.STABLE2/src/http.c squid-2.7.STABLE3/src/http.c --- squid-2.7.STABLE2/src/http.c 2008-05-27 14:49:39.000000000 +0200 +++ squid-2.7.STABLE3/src/http.c 2008-06-26 00:14:02.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.439.2.4 2008/05/27 12:49:39 hno Exp $ + * $Id: http.c,v 1.439.2.6 2008/06/25 22:14:02 hno Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -646,6 +646,11 @@ int complete = httpState->eof; int keep_alive = !httpState->eof; storeBuffer(entry); + if (len == 0 && httpState->eof && httpState->flags.chunked) { + fwdFail(httpState->fwd, errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY, httpState->fwd->request)); + comm_close(fd); + return; + } while (len > 0) { if (httpState->chunk_size > 0) { size_t size = len; @@ -669,6 +674,7 @@ len -= size; if (strLen(httpState->chunkhdr) > 256) { debug(11, 1) ("Oversized chunk header on port %d, url %s\n", comm_local_port(fd), entry->mem_obj->url); + fwdFail(httpState->fwd, errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY, httpState->fwd->request)); comm_close(fd); return; } @@ -677,18 +683,23 @@ /* chunk header */ char *end = NULL; int badchunk = 0; + int emptychunk = 0; debug(11, 3) ("Chunk header '%s'\n", strBuf(httpState->chunkhdr)); + errno = 0; httpState->chunk_size = strto_off_t(strBuf(httpState->chunkhdr), &end, 16); - if (end == strBuf(httpState->chunkhdr)) + if (errno) badchunk = 1; + else if (end == strBuf(httpState->chunkhdr)) + emptychunk = 1; while (end && (*end == '\r' || *end == ' ' || *end == '\t')) end++; - if (httpState->chunk_size < 0 || !end || (*end != '\n' && *end != ';')) { - debug(11, 0) ("Invalid chunk header '%s'\n", strBuf(httpState->chunkhdr)); + if (httpState->chunk_size < 0 || badchunk || !end || (*end != '\n' && *end != ';')) { + debug(11, 1) ("Invalid chunk header '%s'\n", strBuf(httpState->chunkhdr)); + fwdFail(httpState->fwd, errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY, httpState->fwd->request)); comm_close(fd); return; } - if (badchunk) + if (emptychunk) continue; /* Skip blank lines */ debug(11, 2) ("Chunk size %" PRINTF_OFF_T "\n", httpState->chunk_size); if (httpState->chunk_size == 0) { diff -ruN squid-2.7.STABLE2/src/logfile.c squid-2.7.STABLE3/src/logfile.c --- squid-2.7.STABLE2/src/logfile.c 2008-05-05 01:23:13.000000000 +0200 +++ squid-2.7.STABLE3/src/logfile.c 2008-06-04 22:36:17.000000000 +0200 @@ -1,5 +1,5 @@ /* - * $Id: logfile.c,v 1.27.2.1 2008/05/04 23:23:13 hno Exp $ + * $Id: logfile.c,v 1.27.2.2 2008/06/04 20:36:17 hno Exp $ * * DEBUG: section 50 Log file handling * AUTHOR: Duane Wessels @@ -53,7 +53,6 @@ CBDATA_INIT_TYPE(Logfile); lf = cbdataAlloc(Logfile); - cbdataLock(lf); xstrncpy(lf->path, path, MAXPATHLEN); patharg = path; @@ -75,8 +74,14 @@ } else { ret = logfile_mod_stdio_open(lf, patharg, bufsz, fatal_flag); } - if (fatal_flag && !ret) { - fatalf("logfileOpen: path %s: couldn't open!\n", path); + if (!ret) { + if (fatal_flag) + fatalf("logfileOpen: path %s: couldn't open!\n", path); + else + debug(50, 1) ("logfileOpen: path %s: couldn't open!\n", path); + lf->f_close(lf); + cbdataFree(lf); + return NULL; } assert(lf->data != NULL); @@ -92,7 +97,6 @@ debug(50, 1) ("logfileClose: closing log %s\n", lf->path); lf->f_flush(lf); lf->f_close(lf); - cbdataUnlock(lf); cbdataFree(lf); } diff -ruN squid-2.7.STABLE2/src/logfile_mod_daemon.c squid-2.7.STABLE3/src/logfile_mod_daemon.c --- squid-2.7.STABLE2/src/logfile_mod_daemon.c 2008-05-05 01:23:13.000000000 +0200 +++ squid-2.7.STABLE3/src/logfile_mod_daemon.c 2008-06-04 22:36:17.000000000 +0200 @@ -1,5 +1,5 @@ /* - * $Id: logfile_mod_daemon.c,v 1.2.2.1 2008/05/04 23:23:13 hno Exp $ + * $Id: logfile_mod_daemon.c,v 1.2.2.4 2008/06/04 20:36:17 hno Exp $ * * DEBUG: section 50 Log file handling * AUTHOR: Adrian Chadd @@ -226,6 +226,13 @@ char *tmpbuf; l_daemon_t *ll; + lf->f_close = logfile_mod_daemon_close; + lf->f_linewrite = logfile_mod_daemon_writeline; + lf->f_linestart = logfile_mod_daemon_linestart; + lf->f_lineend = logfile_mod_daemon_lineend; + lf->f_flush = logfile_mod_daemon_flush; + lf->f_rotate = logfile_mod_daemon_rotate; + cbdataLock(lf); debug(50, 1) ("Logfile Daemon: opening log %s\n", path); ll = xcalloc(1, sizeof(*ll)); @@ -250,13 +257,6 @@ /* Start the flush event */ eventAdd("logfileFlush", logfileFlushEvent, lf, 1.0, 1); - lf->f_close = logfile_mod_daemon_close; - lf->f_linewrite = logfile_mod_daemon_writeline; - lf->f_linestart = logfile_mod_daemon_linestart; - lf->f_lineend = logfile_mod_daemon_lineend; - lf->f_flush = logfile_mod_daemon_flush; - lf->f_rotate = logfile_mod_daemon_rotate; - return 1; } @@ -266,8 +266,12 @@ l_daemon_t *ll = (l_daemon_t *) lf->data; debug(50, 1) ("Logfile Daemon: closing log %s\n", lf->path); logfileFlush(lf); - fd_close(ll->rfd); - fd_close(ll->wfd); + if (ll->rfd == ll->wfd) + comm_close(ll->rfd); + else { + comm_close(ll->rfd); + comm_close(ll->wfd); + } kill(ll->pid, SIGTERM); eventDelete(logfileFlushEvent, lf); xfree(ll); diff -ruN squid-2.7.STABLE2/src/logfile_mod_stdio.c squid-2.7.STABLE3/src/logfile_mod_stdio.c --- squid-2.7.STABLE2/src/logfile_mod_stdio.c 2007-09-18 17:03:03.000000000 +0200 +++ squid-2.7.STABLE3/src/logfile_mod_stdio.c 2008-06-04 22:36:17.000000000 +0200 @@ -1,5 +1,5 @@ /* - * $Id: logfile_mod_stdio.c,v 1.1 2007/09/18 15:03:03 adrian Exp $ + * $Id: logfile_mod_stdio.c,v 1.1.2.1 2008/06/04 20:36:17 hno Exp $ * * DEBUG: section 50 Log file handling * AUTHOR: Duane Wessels @@ -188,6 +188,13 @@ { l_stdio_t *ll; + lf->f_close = logfile_mod_stdio_close; + lf->f_linewrite = logfile_mod_stdio_writeline; + lf->f_linestart = logfile_mod_stdio_linestart; + lf->f_lineend = logfile_mod_stdio_lineend; + lf->f_flush = logfile_mod_stdio_flush; + lf->f_rotate = logfile_mod_stdio_rotate; + ll = xcalloc(1, sizeof(*ll)); lf->data = ll; @@ -212,12 +219,5 @@ ll->buf = (char *) xmalloc(bufsz); ll->bufsz = bufsz; } - lf->f_close = logfile_mod_stdio_close; - lf->f_linewrite = logfile_mod_stdio_writeline; - lf->f_linestart = logfile_mod_stdio_linestart; - lf->f_lineend = logfile_mod_stdio_lineend; - lf->f_flush = logfile_mod_stdio_flush; - lf->f_rotate = logfile_mod_stdio_rotate; - return 1; } diff -ruN squid-2.7.STABLE2/src/logfile_mod_syslog.c squid-2.7.STABLE3/src/logfile_mod_syslog.c --- squid-2.7.STABLE2/src/logfile_mod_syslog.c 2007-09-24 15:07:25.000000000 +0200 +++ squid-2.7.STABLE3/src/logfile_mod_syslog.c 2008-06-04 22:36:17.000000000 +0200 @@ -1,5 +1,5 @@ /* - * $Id: logfile_mod_syslog.c,v 1.3 2007/09/24 13:07:25 hno Exp $ + * $Id: logfile_mod_syslog.c,v 1.3.2.1 2008/06/04 20:36:17 hno Exp $ * * DEBUG: section 50 Log file handling * AUTHOR: Duane Wessels @@ -160,6 +160,13 @@ { l_syslog_t *ll; + lf->f_close = logfile_mod_syslog_close; + lf->f_linewrite = logfile_mod_syslog_writeline; + lf->f_linestart = logfile_mod_syslog_linestart; + lf->f_lineend = logfile_mod_syslog_lineend; + lf->f_flush = logfile_mod_syslog_flush; + lf->f_rotate = logfile_mod_syslog_rotate; + ll = xcalloc(1, sizeof(*ll)); lf->data = ll; @@ -178,13 +185,6 @@ if ((ll->syslog_priority & PRIORITY_MASK) == 0) ll->syslog_priority |= LOG_INFO; - lf->f_close = logfile_mod_syslog_close; - lf->f_linewrite = logfile_mod_syslog_writeline; - lf->f_linestart = logfile_mod_syslog_linestart; - lf->f_lineend = logfile_mod_syslog_lineend; - lf->f_flush = logfile_mod_syslog_flush; - lf->f_rotate = logfile_mod_syslog_rotate; - return 1; } #endif diff -ruN squid-2.7.STABLE2/src/logfile_mod_udp.c squid-2.7.STABLE3/src/logfile_mod_udp.c --- squid-2.7.STABLE2/src/logfile_mod_udp.c 2007-09-24 15:08:36.000000000 +0200 +++ squid-2.7.STABLE3/src/logfile_mod_udp.c 2008-06-04 22:36:17.000000000 +0200 @@ -1,5 +1,5 @@ /* - * $Id: logfile_mod_udp.c,v 1.6 2007/09/24 13:08:36 hno Exp $ + * $Id: logfile_mod_udp.c,v 1.6.2.1 2008/06/04 20:36:17 hno Exp $ * * DEBUG: section 50 Log file handling * AUTHOR: Adrian Chadd @@ -152,6 +152,13 @@ struct sockaddr_in addr; char *strAddr; + lf->f_close = logfile_mod_udp_close; + lf->f_linewrite = logfile_mod_udp_writeline; + lf->f_linestart = logfile_mod_udp_linestart; + lf->f_lineend = logfile_mod_udp_lineend; + lf->f_flush = logfile_mod_udp_flush; + lf->f_rotate = logfile_mod_udp_rotate; + ll = xcalloc(1, sizeof(*ll)); lf->data = ll; @@ -218,12 +225,5 @@ ll->buf = (char *) xmalloc(bufsz); ll->bufsz = bufsz; } - lf->f_close = logfile_mod_udp_close; - lf->f_linewrite = logfile_mod_udp_writeline; - lf->f_linestart = logfile_mod_udp_linestart; - lf->f_lineend = logfile_mod_udp_lineend; - lf->f_flush = logfile_mod_udp_flush; - lf->f_rotate = logfile_mod_udp_rotate; - return 1; } diff -ruN squid-2.7.STABLE2/src/neighbors.c squid-2.7.STABLE3/src/neighbors.c --- squid-2.7.STABLE2/src/neighbors.c 2008-05-05 01:23:13.000000000 +0200 +++ squid-2.7.STABLE3/src/neighbors.c 2008-06-25 01:14:18.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.319.2.3 2008/05/04 23:23:13 hno Exp $ + * $Id: neighbors.c,v 1.319.2.7 2008/06/24 23:14:18 hno Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -227,7 +227,7 @@ } if (p != NULL && !p->options.no_query) return NULL; - debug(15, 3) ("getSingleParent: returning %s\n", p ? p->host : "NULL"); + debug(15, 3) ("getSingleParent: returning %s\n", p ? p->name : "NULL"); return p; } #endif @@ -245,7 +245,7 @@ continue; break; } - debug(15, 3) ("getFirstUpParent: returning %s\n", p ? p->host : "NULL"); + debug(15, 3) ("getFirstUpParent: returning %s\n", p ? p->name : "NULL"); return p; } @@ -261,11 +261,16 @@ continue; if (!peerHTTPOkay(p, request)) continue; - if (p->weight == 1) { - if (q && q->rr_count < p->rr_count) - continue; - } else if (p->weight == 0 || (q && q->rr_count < (p->rr_count / p->weight))) { + if (p->weight == 0) continue; + + if (q) { + if (p->weight == q->weight) { + if (q->rr_count < p->rr_count) + continue; + } else if ((double) q->rr_count / q->weight < (double) p->rr_count / p->weight) { + continue; + } } q = p; } @@ -277,14 +282,20 @@ /* This gets called every 5 minutes to clear the round-robin counter. */ void -peerClearRR(void *data) +peerClearRRLoop(void *data) { - peer *p = data; - p->rr_count -= p->rr_lastcount; - if (p->rr_count < 0) + peerClearRR(); + eventAdd("peerClearRR", peerClearRRLoop, data, 5 * 60.0, 0); +} + +/* Actually clear the round-robin counter. */ +void +peerClearRR(void) +{ + peer *p = NULL; + for (p = Config.peers; p; p = p->next) { p->rr_count = 0; - p->rr_lastcount = p->rr_count; - eventAdd("peerClearRR", peerClearRR, p, 5 * 60.0, 0); + } } peer * @@ -298,7 +309,7 @@ continue; if (!peerHTTPOkay(p, request)) continue; - debug(15, 3) ("getDefaultParent: returning %s\n", p->host); + debug(15, 3) ("getDefaultParent: returning %s\n", p->name); return p; } debug(15, 3) ("getDefaultParent: returning NULL\n"); @@ -320,7 +331,7 @@ continue; if (!peerHTTPOkay(p, request)) continue; - debug(15, 3) ("getAnyParent: returning %s\n", p->host); + debug(15, 3) ("getAnyParent: returning %s\n", p->name); return p; } debug(15, 3) ("getAnyParent: returning NULL\n"); @@ -446,12 +457,12 @@ for (i = 0, p = first_ping; i++ < Config.npeers; p = p->next) { if (p == NULL) p = Config.peers; - debug(15, 5) ("neighborsUdpPing: Peer %s\n", p->host); + debug(15, 5) ("neighborsUdpPing: Peer %s\n", p->name); if (!peerWouldBePinged(p, request)) continue; /* next peer */ peers_pinged++; debug(15, 4) ("neighborsUdpPing: pinging peer %s for '%s'\n", - p->host, url); + p->name, url); if (p->type == PEER_MULTICAST) mcastSetTtl(theOutIcpConnection, p->mcast.ttl); debug(15, 3) ("neighborsUdpPing: key = '%s'\n", storeKeyText(entry->hash.key)); @@ -588,7 +599,7 @@ const cache_key *key = request ? storeKeyPublicByRequest(request) : NULL; assert(p); assert(request); - debug(15, 5) ("peerDigestLookup: peer %s\n", p->host); + debug(15, 5) ("peerDigestLookup: peer %s\n", p->name); /* does the peeer have a valid digest? */ if (!p->digest) { debug(15, 5) ("peerDigestLookup: gone!\n"); @@ -605,12 +616,12 @@ p->digest->flags.requested ? "" : "!"); return LOOKUP_NONE; } - debug(15, 5) ("peerDigestLookup: OK to lookup peer %s\n", p->host); + debug(15, 5) ("peerDigestLookup: OK to lookup peer %s\n", p->name); assert(p->digest->cd); /* does digest predict a hit? */ if (!cacheDigestTest(p->digest->cd, key)) return LOOKUP_MISS; - debug(15, 5) ("peerDigestLookup: peer %s says HIT!\n", p->host); + debug(15, 5) ("peerDigestLookup: peer %s says HIT!\n", p->name); return LOOKUP_HIT; #endif return LOOKUP_NONE; @@ -646,7 +657,7 @@ continue; p_rtt = netdbHostRtt(p->host); debug(15, 5) ("neighborsDigestSelect: peer %s rtt: %d\n", - p->host, p_rtt); + p->name, p_rtt); /* is this peer better than others in terms of rtt ? */ if (!best_p || (p_rtt && p_rtt < best_rtt)) { best_p = p; @@ -654,7 +665,7 @@ if (p_rtt) /* informative choice (aka educated guess) */ ichoice_count++; debug(15, 4) ("neighborsDigestSelect: peer %s leads with rtt %d\n", - p->host, best_rtt); + p->name, best_rtt); } } debug(15, 4) ("neighborsDigestSelect: choices: %d (%d)\n", @@ -677,7 +688,7 @@ *request->hier.cd_host = '\0'; request->hier.cd_lookup = lookup; debug(15, 4) ("peerNoteDigestLookup: peer %s, lookup: %s\n", - p ? p->host : "", lookup_t_str[lookup]); + p ? p->name : "", lookup_t_str[lookup]); #endif } @@ -688,6 +699,7 @@ debug(15, 1) ("Detected REVIVED %s: %s\n", neighborTypeStr(p), p->name); p->stats.logged_state = PEER_ALIVE; + peerClearRR(); } p->stats.last_reply = squid_curtime; p->stats.probe_start = 0; @@ -720,6 +732,7 @@ debug(15, 1) ("Detected REVIVED %s: %s\n", neighborTypeStr(p), p->name); p->stats.logged_state = PEER_ALIVE; + peerClearRR(); } p->stats.last_reply = squid_curtime; p->stats.probe_start = 0; @@ -845,7 +858,7 @@ return; } debug(15, 3) ("neighborsUdpAck: %s for '%s' from %s \n", - opcode_d, storeKeyText(key), p ? p->host : "source"); + opcode_d, storeKeyText(key), p ? p->name : "source"); if (p) { ntype = neighborType(p, mem->request); } @@ -875,7 +888,7 @@ } } else if (opcode == ICP_SECHO) { if (p) { - debug(15, 1) ("Ignoring SECHO from neighbor %s\n", p->host); + debug(15, 1) ("Ignoring SECHO from neighbor %s\n", p->name); neighborCountIgnored(p); #if ALLOW_SOURCE_PING } else if (Config.onoff.source_ping) { @@ -889,8 +902,8 @@ neighborIgnoreNonPeer(from, opcode); } else if (p->stats.pings_acked > 100) { if (100 * p->icp.counts[ICP_DENIED] / p->stats.pings_acked > 95) { - debug(15, 0) ("95%% of replies from '%s' are UDP_DENIED\n", p->host); - debug(15, 0) ("Disabling '%s', please check your configuration.\n", p->host); + debug(15, 0) ("95%% of replies from '%s' are UDP_DENIED\n", p->name); + debug(15, 0) ("Disabling '%s', please check your configuration.\n", p->name); neighborRemove(p); p = NULL; } else { @@ -971,12 +984,34 @@ safe_free(p->host); safe_free(p->name); safe_free(p->domain); + safe_free(p->login); #if USE_CACHE_DIGESTS if (p->digest) { PeerDigest *pd = p->digest; p->digest = NULL; cbdataUnlock(pd); } + safe_free(p->digest_url); +#endif + safe_free(p->monitor.url) +#if USE_SSL + safe_free(p->sslcert); + safe_free(p->sslkey); + safe_free(p->ssloptions); + safe_free(p->sslcipher); + safe_free(p->sslcafile); + safe_free(p->sslcapath); + safe_free(p->sslcrlfile); + safe_free(p->sslflags); + safe_free(p->ssldomain); + if (p->sslContext) { + SSL_CTX_free(p->sslContext); + p->sslContext = NULL; + } + if (p->sslSession) { + SSL_SESSION_free(p->sslSession); + p->sslSession = NULL; + } #endif } @@ -999,14 +1034,14 @@ struct sockaddr_in *ap; int j; if (p->n_addresses == 0) { - debug(15, 1) ("Configuring %s %s/%d/%d\n", neighborTypeStr(p), - p->host, p->http_port, p->icp.port); + debug(15, 1) ("Configuring %s %s %s/%d/%d\n", p->name, neighborTypeStr(p), + p->name, p->http_port, p->icp.port); if (p->type == PEER_MULTICAST) debug(15, 1) (" Multicast TTL = %d\n", p->mcast.ttl); } p->n_addresses = 0; if (ia == NULL) { - debug(0, 0) ("WARNING: DNS lookup for '%s' failed!\n", p->host); + debug(0, 0) ("WARNING: DNS lookup of '%s' failed!\n", p->host); return; } if ((int) ia->count < 1) { @@ -1055,7 +1090,7 @@ { p->stats.last_connect_failure = squid_curtime; if (!p->tcp_up) { - debug(15, 2) ("TCP connection to %s/%d dead\n", p->host, p->http_port); + debug(15, 2) ("TCP connection to %s (%s:%d) dead\n", p->name, p->host, p->http_port); return; } p->tcp_up--; @@ -1069,7 +1104,7 @@ void peerConnectFailed(peer * p) { - debug(15, 1) ("TCP connection to %s/%d failed\n", p->host, p->http_port); + debug(15, 1) ("TCP connection to %s (%s:%d) failed\n", p->name, p->host, p->http_port); peerConnectFailedSilent(p); } @@ -1077,11 +1112,12 @@ peerConnectSucceded(peer * p) { if (!p->tcp_up) { - debug(15, 2) ("TCP connection to %s/%d succeded\n", p->host, p->http_port); + debug(15, 2) ("TCP connection to %s (%s:%d) succeded\n", p->name, p->host, p->http_port); debug(15, 1) ("Detected REVIVED %s: %s\n", neighborTypeStr(p), p->name); peerMonitorNow(p); p->stats.logged_state = PEER_ALIVE; + peerClearRR(); if (!p->n_addresses) ipcache_nbgethostbyname(p->host, peerDNSConfigure, p); } @@ -1112,7 +1148,7 @@ if (squid_curtime - p->stats.last_connect_probe == 0) return ret; /* don't probe to often */ fd = comm_open(SOCK_STREAM, IPPROTO_TCP, getOutgoingAddr(NULL), - 0, COMM_NONBLOCKING, p->host); + 0, COMM_NONBLOCKING, p->name); if (fd < 0) return ret; commSetTimeout(fd, ctimeout, peerProbeConnectTimeout, p); diff -ruN squid-2.7.STABLE2/src/net_db.c squid-2.7.STABLE3/src/net_db.c --- squid-2.7.STABLE2/src/net_db.c 2008-04-09 00:52:59.000000000 +0200 +++ squid-2.7.STABLE3/src/net_db.c 2008-06-25 00:53:49.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: net_db.c,v 1.176.2.2 2008/04/08 22:52:59 hno Exp $ + * $Id: net_db.c,v 1.176.2.3 2008/06/24 22:53:49 hno Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -556,7 +556,7 @@ netdbExchangeDone(ex); return; } - debug(38, 3) ("netdbExchangeHandleReply: for '%s:%d'\n", ex->p->host, ex->p->http_port); + debug(38, 3) ("netdbExchangeHandleReply: for %s'\n", ex->p->name); p = buf; if (0 == ex->used) { /* skip reply headers */ diff -ruN squid-2.7.STABLE2/src/peer_monitor.c squid-2.7.STABLE3/src/peer_monitor.c --- squid-2.7.STABLE2/src/peer_monitor.c 2008-04-09 00:52:59.000000000 +0200 +++ squid-2.7.STABLE3/src/peer_monitor.c 2008-06-25 01:14:18.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: peer_monitor.c,v 1.5.2.2 2008/04/08 22:52:59 hno Exp $ + * $Id: peer_monitor.c,v 1.5.2.3 2008/06/24 23:14:18 hno Exp $ * * DEBUG: section ?? Peer monitoring * AUTHOR: Henrik Nordstrom @@ -208,6 +208,7 @@ case PEER_ALIVE: debug(DBG, 1) ("Detected REVIVED %s: %s\n", neighborTypeStr(p), p->name); + peerClearRR(); break; case PEER_DEAD: debug(DBG, 1) ("Detected DEAD %s: %s\n", diff -ruN squid-2.7.STABLE2/src/peer_select.c squid-2.7.STABLE3/src/peer_select.c --- squid-2.7.STABLE2/src/peer_select.c 2008-05-05 01:23:13.000000000 +0200 +++ squid-2.7.STABLE3/src/peer_select.c 2008-06-25 00:53:49.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: peer_select.c,v 1.134.2.1 2008/05/04 23:23:13 hno Exp $ + * $Id: peer_select.c,v 1.134.2.3 2008/06/24 22:53:49 hno Exp $ * * DEBUG: section 44 Peer Selection Algorithm * AUTHOR: Duane Wessels @@ -392,7 +392,7 @@ } if (code != HIER_NONE) { assert(p); - debug(44, 3) ("peerGetSomeNeighbor: %s/%s\n", hier_strings[code], p->host); + debug(44, 3) ("peerGetSomeNeighbor: %s/%s\n", hier_strings[code], p->name); peerAddFwdServer(&ps->servers, p, code); } entry->ping_status = PING_DONE; @@ -433,7 +433,7 @@ code = FIRST_PARENT_MISS; } if (p && code != HIER_NONE) { - debug(44, 3) ("peerGetSomeNeighborReplies: %s/%s\n", hier_strings[code], p->host); + debug(44, 3) ("peerGetSomeNeighborReplies: %s/%s\n", hier_strings[code], p->name); peerAddFwdServer(&ps->servers, p, code); } } @@ -484,7 +484,7 @@ code = ANY_OLD_PARENT; } if (code != HIER_NONE) { - debug(44, 3) ("peerGetSomeParent: %s/%s\n", hier_strings[code], p->host); + debug(44, 3) ("peerGetSomeParent: %s/%s\n", hier_strings[code], p->name); peerAddFwdServer(&ps->servers, p, code); } } @@ -505,7 +505,7 @@ continue; if (!peerHTTPOkay(p, request)) continue; - debug(15, 3) ("peerGetAllParents: adding alive parent %s\n", p->host); + debug(15, 3) ("peerGetAllParents: adding alive parent %s\n", p->name); peerAddFwdServer(&ps->servers, p, ANY_OLD_PARENT); } /* XXX: should add dead parents here, but it is currently @@ -680,14 +680,20 @@ void peerAddFwdServer(FwdServer ** FS, peer * p, hier_code code) { - FwdServer *fs = memAllocate(MEM_FWD_SERVER); + FwdServer *fs; debug(44, 5) ("peerAddFwdServer: adding %s %s\n", - p ? p->host : "DIRECT", + p ? p->name : "DIRECT", hier_strings[code]); + while (*FS) { + if ((*FS)->peer == p) { + debug(44, 5) ("peerAddFwdServer: Skipping duplicate registration of %s\n", p ? p->name : "DIRECT"); + return; + } + FS = &(*FS)->next; + } + fs = memAllocate(MEM_FWD_SERVER); fs->peer = p; fs->code = code; cbdataLock(fs->peer); - while (*FS) - FS = &(*FS)->next; *FS = fs; } diff -ruN squid-2.7.STABLE2/src/pinger.c squid-2.7.STABLE3/src/pinger.c --- squid-2.7.STABLE2/src/pinger.c 2008-05-05 01:23:13.000000000 +0200 +++ squid-2.7.STABLE3/src/pinger.c 2008-06-04 22:32:48.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: pinger.c,v 1.50.6.2 2008/05/04 23:23:13 hno Exp $ + * $Id: pinger.c,v 1.50.6.4 2008/06/04 20:32:48 hno Exp $ * * DEBUG: section 42 ICMP Pinger program * AUTHOR: Duane Wessels @@ -58,7 +58,9 @@ #ifdef _SQUID_MSWIN_ +#if HAVE_WINSOCK2_H #include +#endif #include #define PINGER_TIMEOUT 5 @@ -188,6 +190,15 @@ static void pingerOpen(void); static void pingerClose(void); +#ifdef _SQUID_MSWIN_ +void +Win32SockCleanup(void) +{ + WSACleanup(); + return; +} +#endif /* ifdef _SQUID_MSWIN_ */ + void pingerOpen(void) { @@ -200,6 +211,7 @@ struct sockaddr_in PS; WSAStartup(2, &wsaData); + atexit(Win32SockCleanup); getCurrentTime(); _db_init(NULL, "ALL,1"); diff -ruN squid-2.7.STABLE2/src/protos.h squid-2.7.STABLE3/src/protos.h --- squid-2.7.STABLE2/src/protos.h 2008-05-27 14:49:39.000000000 +0200 +++ squid-2.7.STABLE3/src/protos.h 2008-06-25 01:14:18.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.547.2.7 2008/05/27 12:49:39 hno Exp $ + * $Id: protos.h,v 1.547.2.9 2008/06/24 23:14:18 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -688,7 +688,8 @@ extern peer *peerFindByNameAndPort(const char *, unsigned short); extern peer *getDefaultParent(request_t * request); extern peer *getRoundRobinParent(request_t * request); -EVH peerClearRR; +EVH peerClearRRLoop; +extern void peerClearRR(void); extern peer *getAnyParent(request_t * request); extern lookup_t peerDigestLookup(peer * p, request_t * request); extern peer *neighborsDigestSelect(request_t * request); @@ -932,6 +933,8 @@ extern StoreEntry *storeCreateEntry(const char *, request_flags, method_t); extern void storeSetPublicKey(StoreEntry *); extern void storeComplete(StoreEntry *); +extern void storeRequestFailed(StoreEntry *, ErrorState * err); + extern void storeInit(void); extern void storeAbort(StoreEntry *); extern void storeAppend(StoreEntry *, const char *, int); diff -ruN squid-2.7.STABLE2/src/store.c squid-2.7.STABLE3/src/store.c --- squid-2.7.STABLE2/src/store.c 2008-05-27 14:49:39.000000000 +0200 +++ squid-2.7.STABLE3/src/store.c 2008-06-19 03:08:30.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.584.2.3 2008/05/27 12:49:39 hno Exp $ + * $Id: store.c,v 1.584.2.4 2008/06/19 01:08:30 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1345,6 +1345,33 @@ InvokeHandlers(e); } +/* Aborted transfer into the local cache. */ +void +storeRequestFailed(StoreEntry * e, ErrorState * err) +{ + MemObject *mem = e->mem_obj; + assert(e->store_status == STORE_PENDING); + assert(mem != NULL); + debug(20, 6) ("storeAbort: %s\n", storeKeyText(e->hash.key)); + storeLockObject(e); /* lock while aborting */ + storeExpireNow(e); + storeReleaseRequest(e); + storeSetMemStatus(e, NOT_IN_MEMORY); + if (e->mem_obj->inmem_hi == 0) { + assert(err); + errorAppendEntry(e, err); + } else { + EBIT_SET(e->flags, ENTRY_ABORTED); + } + e->store_status = STORE_OK; + mem->object_sz = mem->inmem_hi; + /* Notify the client side */ + InvokeHandlers(e); + /* Close any swapout file */ + storeSwapOutFileClose(e); + storeUnlockObject(e); /* unlock */ +} + /* * Someone wants to abort this transfer. Set the reason in the * request structure, call the server-side callback and mark the diff -ruN squid-2.7.STABLE2/src/structs.h squid-2.7.STABLE3/src/structs.h --- squid-2.7.STABLE2/src/structs.h 2008-05-27 14:49:39.000000000 +0200 +++ squid-2.7.STABLE3/src/structs.h 2008-06-25 01:14:18.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.538.2.12 2008/05/27 12:49:39 hno Exp $ + * $Id: structs.h,v 1.538.2.14 2008/06/24 23:14:18 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -702,6 +702,7 @@ #endif int update_headers; int ignore_expect_100; + int WIN32_IpAddrChangeMonitor; } onoff; acl *aclList; struct { @@ -1505,7 +1506,6 @@ struct in_addr addresses[10]; int n_addresses; int rr_count; - int rr_lastcount; peer *next; int test_fd; #if USE_CARP diff -ruN squid-2.7.STABLE2/src/win32.c squid-2.7.STABLE3/src/win32.c --- squid-2.7.STABLE2/src/win32.c 2008-04-02 03:00:58.000000000 +0200 +++ squid-2.7.STABLE3/src/win32.c 2008-06-04 22:35:37.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: win32.c,v 1.18.2.2 2008/04/02 01:00:58 hno Exp $ + * $Id: win32.c,v 1.18.2.4 2008/06/04 20:35:37 hno Exp $ * * Windows support * AUTHOR: Guido Serassio @@ -362,16 +362,18 @@ WIN32_Exit(); } +#ifdef _SQUID_MSWIN_ void WIN32_IpAddrChangeMonitorExit() { DWORD status = ERROR_SUCCESS; - if (NotifyAddrChange_thread == INVALID_HANDLE_VALUE) { + if (NotifyAddrChange_thread = !INVALID_HANDLE_VALUE) { TerminateThread(NotifyAddrChange_thread, status); CloseHandle(NotifyAddrChange_thread); } } +#endif void WIN32_Exit() @@ -426,7 +428,7 @@ DWORD status = ERROR_SUCCESS; DWORD threadID = 0, ThrdParam = 0; - if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { + if ((WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) && (Config.onoff.WIN32_IpAddrChangeMonitor)) { NotifyAddrChange_thread = CreateThread(NULL, 0, WIN32_IpAddrChangeMonitor, &ThrdParam, 0, &threadID); if (NotifyAddrChange_thread == NULL) { diff -ruN squid-2.7.STABLE2/tools/cachemgr.c squid-2.7.STABLE3/tools/cachemgr.c --- squid-2.7.STABLE2/tools/cachemgr.c 2007-06-25 14:25:42.000000000 +0200 +++ squid-2.7.STABLE3/tools/cachemgr.c 2008-06-25 00:55:11.000000000 +0200 @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.c,v 1.6 2007/06/25 12:25:42 hno Exp $ + * $Id: cachemgr.c,v 1.6.2.1 2008/06/24 22:55:11 hno Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Duane Wessels @@ -363,7 +363,7 @@ printf("Cache Manager Error\n"); printf("\n"); printf("

    Cache Manager Error

    \n"); - printf("

    \n%s

    \n", msg); + printf("

    \n%s

    \n", html_quote(msg)); print_trailer(); } @@ -459,7 +459,7 @@ if (!strchr(buf, '\t') || *buf == '\t') { /* nope, just text */ snprintf(html, sizeof(html), "%s%s", - table_line_num ? "\n
    " : "", buf);
    +	    table_line_num ? "\n
    " : "", html_quote(buf));
     	table_line_num = 0;
     	return html;
         }
    @@ -487,7 +487,7 @@
     	l += snprintf(html + l, sizeof(html) - l, "<%s colspan=\"%d\" align=\"%s\">%s",
     	    ttag, column_span,
     	    is_header ? "center" : is_number(cell) ? "right" : "left",
    -	    cell, ttag);
    +	    html_quote(cell), ttag);
         }
         xfree(buf_copy);
         /* record ends */
    diff -ruN squid-2.7.STABLE2/tools/squidclient.c squid-2.7.STABLE3/tools/squidclient.c
    --- squid-2.7.STABLE2/tools/squidclient.c	2007-12-13 02:20:50.000000000 +0100
    +++ squid-2.7.STABLE3/tools/squidclient.c	2008-06-04 22:32:50.000000000 +0200
    @@ -1,6 +1,6 @@
     
     /*
    - * $Id: squidclient.c,v 1.9 2007/12/13 01:20:50 hno Exp $
    + * $Id: squidclient.c,v 1.9.2.1 2008/06/04 20:32:50 hno Exp $
      *
      * DEBUG: section 0     WWW Client
      * AUTHOR: Harvest Derived
    @@ -128,6 +128,15 @@
     int total_bytes = 0;
     int io_timeout = 120;
     
    +#ifdef _SQUID_MSWIN_
    +void
    +Win32SockCleanup(void)
    +{
    +    WSACleanup();
    +    return;
    +}
    +#endif /* ifdef _SQUID_MSWIN_ */
    +
     static void
     usage(const char *progname)
     {
    @@ -295,6 +304,7 @@
         {
     	WSADATA wsaData;
     	WSAStartup(2, &wsaData);
    +	atexit(Win32SockCleanup);
         }
     #endif
         /* Build the HTTP request */