diff -u -r -N squid-3.0.STABLE17/ChangeLog squid-3.0.STABLE18/ChangeLog
--- squid-3.0.STABLE17/ChangeLog	2009-07-27 00:24:36.000000000 +1200
+++ squid-3.0.STABLE18/ChangeLog	2009-08-04 23:57:34.000000000 +1200
@@ -1,3 +1,14 @@
+Changes to squid-3.0.STABLE18 (04 Aug 2009):
+
+	- Bug 2728: regression: assertion failed: !eof
+	- Bug 2732: reply_body_max_size smaller than error page loops
+	            infinitely until out of memory
+	- Bug 2725: pconn failure if domain or client_address are unset
+	- Bug 2648: reserved helpers not shut down after reconfigure/rotate
+	- Bug 2462: make check should tell when cppunit is missing
+	- Remove excess messages about headers < minimum size
+	- Support Libtool 2.2.6
+
 Changes to squid-3.0.STABLE17 (27 Jul 2009):
 
 	- Bug 2680 regression: Crash after rotate with no helpers running
diff -u -r -N squid-3.0.STABLE17/configure squid-3.0.STABLE18/configure
--- squid-3.0.STABLE17/configure	2009-07-27 00:24:48.000000000 +1200
+++ squid-3.0.STABLE18/configure	2009-08-04 23:57:50.000000000 +1200
@@ -1,7 +1,7 @@
 #! /bin/sh
 # From configure.in Revision.
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for Squid Web Proxy 3.0.STABLE17.
+# Generated by GNU Autoconf 2.62 for Squid Web Proxy 3.0.STABLE18.
 #
 # Report bugs to <http://www.squid-cache.org/bugs/>.
 #
@@ -751,8 +751,8 @@
 # Identity of this package.
 PACKAGE_NAME='Squid Web Proxy'
 PACKAGE_TARNAME='squid'
-PACKAGE_VERSION='3.0.STABLE17'
-PACKAGE_STRING='Squid Web Proxy 3.0.STABLE17'
+PACKAGE_VERSION='3.0.STABLE18'
+PACKAGE_STRING='Squid Web Proxy 3.0.STABLE18'
 PACKAGE_BUGREPORT='http://www.squid-cache.org/bugs/'
 
 ac_unique_file="src/main.cc"
@@ -984,11 +984,11 @@
 SH
 FALSE
 TRUE
-RM
 MV
 MKDIR
 LN
 PERL
+RM
 AR_R
 ALLOCA
 CRYPTLIB
@@ -1664,7 +1664,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 3.0.STABLE17 to adapt to many kinds of systems.
+\`configure' configures Squid Web Proxy 3.0.STABLE18 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1734,7 +1734,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Squid Web Proxy 3.0.STABLE17:";;
+     short | recursive ) echo "Configuration of Squid Web Proxy 3.0.STABLE18:";;
    esac
   cat <<\_ACEOF
 
@@ -2046,7 +2046,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Squid Web Proxy configure 3.0.STABLE17
+Squid Web Proxy configure 3.0.STABLE18
 generated by GNU Autoconf 2.62
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -2060,7 +2060,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 3.0.STABLE17, which was
+It was created by Squid Web Proxy $as_me 3.0.STABLE18, which was
 generated by GNU Autoconf 2.62.  Invocation command line was
 
   $ $0 $@
@@ -2778,7 +2778,7 @@
 
 # Define the identity of the package.
  PACKAGE='squid'
- VERSION='3.0.STABLE17'
+ VERSION='3.0.STABLE18'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -24539,47 +24539,6 @@
 fi
 
 
-# Extract the first word of "rm", so it can be a program name with args.
-set dummy rm; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_RM+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $RM in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_RM="$RM" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_RM" && ac_cv_path_RM="$FALSE"
-  ;;
-esac
-fi
-RM=$ac_cv_path_RM
-if test -n "$RM"; then
-  { $as_echo "$as_me:$LINENO: result: $RM" >&5
-$as_echo "$RM" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
 # Extract the first word of "mv", so it can be a program name with args.
 set dummy mv; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -24786,6 +24745,49 @@
 
 
 
+# Extract the first word of "rm", so it can be a program name with args.
+set dummy rm; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_RM+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $RM in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_RM="$RM" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_RM" && ac_cv_path_RM="$FALSE"
+  ;;
+esac
+fi
+RM=$ac_cv_path_RM
+if test -n "$RM"; then
+  { $as_echo "$as_me:$LINENO: result: $RM" >&5
+$as_echo "$RM" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+RM="$RM -f"
+
 if test "$ac_cv_path_PERL" = "none"; then
 	echo "Perl is required to compile Squid"
 	echo "Please install Perl and then re-run configure"
@@ -48082,7 +48084,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 3.0.STABLE17, which was
+This file was extended by Squid Web Proxy $as_me 3.0.STABLE18, which was
 generated by GNU Autoconf 2.62.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -48135,7 +48137,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-Squid Web Proxy config.status 3.0.STABLE17
+Squid Web Proxy config.status 3.0.STABLE18
 configured by $0, generated by GNU Autoconf 2.62,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff -u -r -N squid-3.0.STABLE17/configure.in squid-3.0.STABLE18/configure.in
--- squid-3.0.STABLE17/configure.in	2009-07-27 00:24:48.000000000 +1200
+++ squid-3.0.STABLE18/configure.in	2009-08-04 23:57:50.000000000 +1200
@@ -1,7 +1,7 @@
 dnl  Configuration input file for Squid
 dnl
 dnl
-AC_INIT(Squid Web Proxy, 3.0.STABLE17, http://www.squid-cache.org/bugs/, squid)
+AC_INIT(Squid Web Proxy, 3.0.STABLE18, http://www.squid-cache.org/bugs/, squid)
 AC_PREREQ(2.52)
 AM_CONFIG_HEADER(include/autoconf.h)
 AC_CONFIG_AUX_DIR(cfgaux)
@@ -1902,7 +1902,6 @@
 AC_PATH_PROG(SH, sh, /bin/sh)
 AC_PATH_PROG(FALSE, false, /usr/bin/false)
 AC_PATH_PROG(TRUE, true, /usr/bin/true)
-AC_PATH_PROG(RM, rm, $FALSE)
 AC_PATH_PROG(MV, mv, $FALSE)
 AC_PATH_PROG(MKDIR, mkdir, $FALSE)
 AC_PATH_PROG(LN, ln, cp)
@@ -1910,6 +1909,10 @@
 dnl automake handles this AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE)
 AC_PATH_PROG(AR, ar, $FALSE)
 
+AC_PATH_PROG(RM, rm, $FALSE)
+dnl Libtool 2.2.6 requires: rm -f
+RM="$RM -f"
+
 if test "$ac_cv_path_PERL" = "none"; then
 	echo "Perl is required to compile Squid"
 	echo "Please install Perl and then re-run configure"
diff -u -r -N squid-3.0.STABLE17/include/version.h squid-3.0.STABLE18/include/version.h
--- squid-3.0.STABLE17/include/version.h	2009-07-27 00:24:48.000000000 +1200
+++ squid-3.0.STABLE18/include/version.h	2009-08-04 23:57:50.000000000 +1200
@@ -9,5 +9,5 @@
  */
 
 #ifndef SQUID_RELEASE_TIME
-#define SQUID_RELEASE_TIME 1248611075
+#define SQUID_RELEASE_TIME 1249387052
 #endif
diff -u -r -N squid-3.0.STABLE17/Makefile.am squid-3.0.STABLE18/Makefile.am
--- squid-3.0.STABLE17/Makefile.am	2009-07-27 00:24:36.000000000 +1200
+++ squid-3.0.STABLE18/Makefile.am	2009-08-04 23:57:34.000000000 +1200
@@ -45,3 +45,14 @@
 
 all-am:
 	@echo "Build Successful."
+
+## hack to insert the test first, before building recursive child directories
+check: have-cppunit check-recursive
+
+have-cppunit:
+	@if test "@SQUID_CPPUNIT_INC@@SQUID_CPPUNIT_LA@@SQUID_CPPUNIT_LIBS@" = "" ; then \
+		echo "FATAL: 'make check' requires cppunit and cppunit development packages. They do not appear to be installed." ; \
+		exit 1 ; \
+	fi
+
+.PHONY: have-cppunit
diff -u -r -N squid-3.0.STABLE17/Makefile.in squid-3.0.STABLE18/Makefile.in
--- squid-3.0.STABLE17/Makefile.in	2009-07-27 00:24:36.000000000 +1200
+++ squid-3.0.STABLE18/Makefile.in	2009-08-04 23:57:34.000000000 +1200
@@ -741,6 +741,16 @@
 
 all-am:
 	@echo "Build Successful."
+
+check: have-cppunit check-recursive
+
+have-cppunit:
+	@if test "@SQUID_CPPUNIT_INC@@SQUID_CPPUNIT_LA@@SQUID_CPPUNIT_LIBS@" = "" ; then \
+		echo "FATAL: 'make check' requires cppunit and cppunit development packages. They do not appear to be installed." ; \
+		exit 1 ; \
+	fi
+
+.PHONY: have-cppunit
 # 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 -u -r -N squid-3.0.STABLE17/RELEASENOTES.html squid-3.0.STABLE18/RELEASENOTES.html
--- squid-3.0.STABLE17/RELEASENOTES.html	2009-07-27 00:25:31.000000000 +1200
+++ squid-3.0.STABLE18/RELEASENOTES.html	2009-08-04 23:58:33.000000000 +1200
@@ -2,10 +2,10 @@
 <HTML>
 <HEAD>
  <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.50">
- <TITLE>Squid 3.0.STABLE17 release notes</TITLE>
+ <TITLE>Squid 3.0.STABLE18 release notes</TITLE>
 </HEAD>
 <BODY>
-<H1>Squid 3.0.STABLE17 release notes</H1>
+<H1>Squid 3.0.STABLE18 release notes</H1>
 
 <H2>Squid Developers</H2>
 <HR>
@@ -13,9 +13,54 @@
 Squid is a WWW Cache application developed by the National Laboratory
 for Applied Network Research and members of the Web Caching community.</EM>
 <HR>
-<H2><A NAME="s1">1. Notice</A></H2>
+<P>
+<H2><A NAME="toc1">1.</A> <A HREF="#s1">Notice</A></H2>
+
+<P>
+<H2><A NAME="toc2">2.</A> <A HREF="#s2">Known issues</A></H2>
+
+<P>
+<H2><A NAME="toc3">3.</A> <A HREF="#s3">Changes since earlier STABLE releases of Squid-3.0</A></H2>
+
+<P>
+<H2><A NAME="toc4">4.</A> <A HREF="#s4">Changes since Squid-2.6</A></H2>
+
+<UL>
+<LI><A NAME="toc4.1">4.1</A> <A HREF="#ss4.1">Major new features</A>
+<LI><A NAME="toc4.2">4.2</A> <A HREF="#ss4.2">2.6 features not found in Squid-3.0</A>
+<LI><A NAME="toc4.3">4.3</A> <A HREF="#ss4.3">Logging changes</A>
+</UL>
+<P>
+<H2><A NAME="toc5">5.</A> <A HREF="#s5">Windows support</A></H2>
+
+<P>
+<H2><A NAME="toc6">6.</A> <A HREF="#s6">Changes to squid.conf since Squid-2.6</A></H2>
+
+<UL>
+<LI><A NAME="toc6.1">6.1</A> <A HREF="#ss6.1">New tags</A>
+<LI><A NAME="toc6.2">6.2</A> <A HREF="#ss6.2">Changes to existing tags</A>
+<LI><A NAME="toc6.3">6.3</A> <A HREF="#ss6.3">Removed tags</A>
+</UL>
+<P>
+<H2><A NAME="toc7">7.</A> <A HREF="#s7">Changes to ./configure Options since Squid-2.6</A></H2>
+
+<UL>
+<LI><A NAME="toc7.1">7.1</A> <A HREF="#ss7.1">New options</A>
+<LI><A NAME="toc7.2">7.2</A> <A HREF="#ss7.2">Changes to existing options</A>
+<LI><A NAME="toc7.3">7.3</A> <A HREF="#ss7.3">Removed options</A>
+</UL>
+<P>
+<H2><A NAME="toc8">8.</A> <A HREF="#s8">Regressions since Squid-2.7</A></H2>
+
+<UL>
+<LI><A NAME="toc8.1">8.1</A> <A HREF="#ss8.1">Missing squid.conf options available in Squid-2.7</A>
+<LI><A NAME="toc8.2">8.2</A> <A HREF="#ss8.2">Missing ./configure options available in Squid-2.7</A>
+</UL>
+
+<HR>
+<H2><A NAME="s1">1.</A> <A HREF="#toc1">Notice</A></H2>
 
-<P>The Squid Team are pleased to announce the release of Squid-3.0.STABLE17.</P>
+<P>The Squid Team are pleased to announce the release of Squid-3.0.STABLE18.</P>
 <P>This new release is available for download from 
 <A HREF="http://www.squid-cache.org/Versions/v3/3.0/">http://www.squid-cache.org/Versions/v3/3.0/</A> or the 
 <A HREF="http://www.squid-cache.org/Mirrors/http-mirrors.html">mirrors</A>.</P>
@@ -23,19 +68,19 @@
 <P>We welcome feedback and bug reports. If you find a bug, please see 
 <A HREF="http://wiki.squid-cache.org/SquidFaq/TroubleShooting#head-7067fc0034ce967e67911becaabb8c95a34d576d">http://wiki.squid-cache.org/SquidFaq/TroubleShooting#head-7067fc0034ce967e67911becaabb8c95a34d576d</A> for how to submit a report with a stack trace.</P>
 
-<H2><A NAME="s2">2. Known issues</A></H2>
+<H2><A NAME="s2">2.</A> <A HREF="#toc2">Known issues</A></H2>
 
 <P>Although this release is deemed good enough for use in many setups, please note the existence of 
 <A HREF="http://www.squid-cache.org/bugs/buglist.cgi?query_format=advanced&amp;short_desc_type=allwordssubstr&amp;short_desc=&amp;target_milestone=3.0&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;status_whiteboard_type=allwordssubstr&amp;status_whiteboard=&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;emailtype1=substring&amp;email1=&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;cmdtype=doit&amp;order=bugs.bug_severity&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=">open bugs against Squid-3.0</A>.</P>
 
-<H2><A NAME="s3">3. Changes since earlier STABLE releases of Squid-3.0</A></H2>
+<H2><A NAME="s3">3.</A> <A HREF="#toc3">Changes since earlier STABLE releases of Squid-3.0</A></H2>
 
 <P>The 3.0 change history can be 
 <A HREF="http://www.squid-cache.org/Versions/v3/3.0/changesets/">viewed here</A>.</P>
 
-<H2><A NAME="s4">4. Changes since Squid-2.6</A></H2>
+<H2><A NAME="s4">4.</A> <A HREF="#toc4">Changes since Squid-2.6</A></H2>
 
-<H2><A NAME="ss4.1">4.1 Major new features</A>
+<H2><A NAME="ss4.1">4.1</A> <A HREF="#toc4.1">Major new features</A>
 </H2>
 
 <P>Squid 3.0 represents a major rewrite of Squid and has a number of new features.</P>
@@ -87,7 +132,7 @@
 <P>More information about ESI can be found from the ESI website 
 <A HREF="http://www.esi.org">http://www.esi.org</A></P>
 
-<H2><A NAME="ss4.2">4.2 2.6 features not found in Squid-3.0</A>
+<H2><A NAME="ss4.2">4.2</A> <A HREF="#toc4.2">2.6 features not found in Squid-3.0</A>
 </H2>
 
 <P>Some of the features found in Squid-2.6 is not available in Squid-3.
@@ -107,7 +152,7 @@
 </UL>
 </P>
 
-<H2><A NAME="ss4.3">4.3 Logging changes</A>
+<H2><A NAME="ss4.3">4.3</A> <A HREF="#toc4.3">Logging changes</A>
 </H2>
 
 <H3>access.log</H3>
@@ -125,7 +170,7 @@
 <A HREF="http://www.squid-cache.org/Doc/FAQ/FAQ-6.html#ss6.7">http://www.squid-cache.org/Doc/FAQ/FAQ-6.html#ss6.7</A> for a definition of all log types.</P>
 
 
-<H2><A NAME="s5">5. Windows support</A></H2>
+<H2><A NAME="s5">5.</A> <A HREF="#toc5">Windows support</A></H2>
 
 <P>This Squid version can run on Windows as a system service using the Cygwin emulation environment, 
 or can be compiled in Windows native mode using the MinGW + MSYS development environment. Windows NT 4 SP4 and later are supported.<BR>
@@ -348,7 +393,7 @@
 
 
 
-<H2><A NAME="s6">6. Changes to squid.conf since Squid-2.6</A></H2>
+<H2><A NAME="s6">6.</A> <A HREF="#toc6">Changes to squid.conf since Squid-2.6</A></H2>
 
 <P>There have been many changes to Squid's configuration file since Squid-2.6.</P>
 
@@ -365,7 +410,7 @@
 </P>
 
 
-<H2><A NAME="newtags"></A> <A NAME="ss6.1">6.1 New tags</A>
+<H2><A NAME="newtags"></A> <A NAME="ss6.1">6.1</A> <A HREF="#toc6.1">New tags</A>
 </H2>
 
 <P>
@@ -682,7 +727,7 @@
 </P>
 
 
-<H2><A NAME="modifiedtags"></A> <A NAME="ss6.2">6.2 Changes to existing tags</A>
+<H2><A NAME="modifiedtags"></A> <A NAME="ss6.2">6.2</A> <A HREF="#toc6.2">Changes to existing tags</A>
 </H2>
 
 <P>
@@ -878,7 +923,7 @@
 </DL>
 </P>
 
-<H2><A NAME="removedtags"></A> <A NAME="ss6.3">6.3 Removed tags</A>
+<H2><A NAME="removedtags"></A> <A NAME="ss6.3">6.3</A> <A HREF="#toc6.3">Removed tags</A>
 </H2>
 
 <P>
@@ -896,7 +941,7 @@
 </P>
 
 
-<H2><A NAME="s7">7. Changes to ./configure Options since Squid-2.6</A></H2>
+<H2><A NAME="s7">7.</A> <A HREF="#toc7">Changes to ./configure Options since Squid-2.6</A></H2>
 
 <P>There have been some changes to Squid's build configuration since Squid-2.6.</P>
 
@@ -914,7 +959,7 @@
 
 
 
-<H2><A NAME="newoptions"></A> <A NAME="ss7.1">7.1 New options</A>
+<H2><A NAME="newoptions"></A> <A NAME="ss7.1">7.1</A> <A HREF="#toc7.1">New options</A>
 </H2>
 
 <P>
@@ -1029,7 +1074,7 @@
 
 </DL>
 </P>
-<H2><A NAME="modifiedoptions"></A> <A NAME="ss7.2">7.2 Changes to existing options</A>
+<H2><A NAME="modifiedoptions"></A> <A NAME="ss7.2">7.2</A> <A HREF="#toc7.2">Changes to existing options</A>
 </H2>
 
 <P>
@@ -1073,7 +1118,7 @@
 
 </DL>
 </P>
-<H2><A NAME="removedoptions"></A> <A NAME="ss7.3">7.3 Removed options</A>
+<H2><A NAME="removedoptions"></A> <A NAME="ss7.3">7.3</A> <A HREF="#toc7.3">Removed options</A>
 </H2>
 
 <P>The following configure options have been removed.</P>
@@ -1098,13 +1143,13 @@
 </P>
 
 
-<H2><A NAME="s8">8. Regressions since Squid-2.7</A></H2>
+<H2><A NAME="s8">8.</A> <A HREF="#toc8">Regressions since Squid-2.7</A></H2>
 
 <P>Some squid.conf and ./configure options which were available in Squid-2.7 are not yet available in Squid-3.0</P>
 
 <P>If you need something to do then porting one of these from Squid-2 to Squid-3 is most welcome.</P>
 
-<H2><A NAME="ss8.1">8.1 Missing squid.conf options available in Squid-2.7</A>
+<H2><A NAME="ss8.1">8.1</A> <A HREF="#toc8.1">Missing squid.conf options available in Squid-2.7</A>
 </H2>
 
 <P>
@@ -1248,7 +1293,7 @@
 </DL>
 </P>
 
-<H2><A NAME="ss8.2">8.2 Missing ./configure options available in Squid-2.7</A>
+<H2><A NAME="ss8.2">8.2</A> <A HREF="#toc8.2">Missing ./configure options available in Squid-2.7</A>
 </H2>
 
 <P>
diff -u -r -N squid-3.0.STABLE17/src/client_side_reply.cc squid-3.0.STABLE18/src/client_side_reply.cc
--- squid-3.0.STABLE17/src/client_side_reply.cc	2009-07-27 00:24:47.000000000 +1200
+++ squid-3.0.STABLE18/src/client_side_reply.cc	2009-08-04 23:57:49.000000000 +1200
@@ -1682,6 +1682,7 @@
     }
 
     if (http->isReplyBodyTooLarge(reply->content_length)) {
+        http->logType = LOG_TCP_DENIED_REPLY;
         ErrorState *err =
             clientBuildError(ERR_TOO_BIG, HTTP_FORBIDDEN, NULL,
                              http->getConn() != NULL ? &http->getConn()->peer.sin_addr : &no_addr,
diff -u -r -N squid-3.0.STABLE17/src/helper.cc squid-3.0.STABLE18/src/helper.cc
--- squid-3.0.STABLE17/src/helper.cc	2009-07-27 00:24:47.000000000 +1200
+++ squid-3.0.STABLE18/src/helper.cc	2009-08-04 23:57:49.000000000 +1200
@@ -474,15 +474,14 @@
 
     if (srv->queue.head) {
         srv->flags.reserved = S_HELPER_DEFERRED;
-        helperStatefulServerKickQueue(srv);
     } else {
         srv->flags.reserved = S_HELPER_FREE;
 
         if ((srv->parent->OnEmptyQueue != NULL) && (srv->data))
             srv->parent->OnEmptyQueue(srv->data);
-
-        helperStatefulKickQueue(hlp);
     }
+
+    helperStatefulServerKickQueue(srv);
 }
 
 /*
@@ -521,7 +520,9 @@
 
     srv->flags.reserved = S_HELPER_FREE;
     if (srv->parent->OnEmptyQueue != NULL && srv->data)
-	srv->parent->OnEmptyQueue(srv->data);
+        srv->parent->OnEmptyQueue(srv->data);
+
+    helperStatefulServerKickQueue(srv);
 }
 
 void *
@@ -854,8 +855,6 @@
     if (!concurrency)
         concurrency = 1;
 
-    assert(srv->rfd == fd);
-
     if (srv->rbuf) {
         memFreeBuf(srv->rbuf_sz, srv->rbuf);
         srv->rbuf = NULL;
@@ -922,7 +921,6 @@
     helper_stateful_server *srv = (helper_stateful_server *)data;
     statefulhelper *hlp = srv->parent;
     helper_stateful_request *r;
-    assert(srv->rfd == fd);
 
     if (srv->rbuf) {
         memFreeBuf(srv->rbuf_sz, srv->rbuf);
@@ -989,7 +987,6 @@
     char *t = NULL;
     helper_server *srv = (helper_server *)data;
     helper *hlp = srv->parent;
-    assert(fd == srv->rfd);
     assert(cbdataReferenceValid(data));
 
     /* Bail out early on COMM_ERR_CLOSING - close handlers will tidy up for us */
@@ -998,6 +995,8 @@
         return;
     }
 
+    assert(fd == srv->rfd);
+
     debugs(84, 5, "helperHandleRead: " << len << " bytes from " << hlp->id_name << " #" << srv->index + 1);
 
     if (flag != COMM_OK || len <= 0) {
@@ -1079,17 +1078,21 @@
         srv->roffset -= (t - srv->rbuf);
         memmove(srv->rbuf, t, srv->roffset + 1);
 
-        if (srv->flags.shutdown) {
+        if (!srv->flags.shutdown) {
+            helperKickQueue(hlp);
+        } else if (!srv->flags.closing && !srv->stats.pending) {
             int wfd = srv->wfd;
             srv->wfd = -1;
+            if (srv->rfd == wfd)
+                srv->rfd = -1;
             srv->flags.closing=1;
             comm_close(wfd);
-	    return;
-        } else
-            helperKickQueue(hlp);
+            return;
+        }
     }
 
-    comm_read(fd, srv->rbuf + srv->roffset, srv->rbuf_sz - srv->roffset - 1, helperHandleRead, srv);
+    if (srv->rfd != -1)
+        comm_read(fd, srv->rbuf + srv->roffset, srv->rbuf_sz - srv->roffset - 1, helperHandleRead, srv);
 }
 
 static void
@@ -1099,7 +1102,6 @@
     helper_stateful_server *srv = (helper_stateful_server *)data;
     helper_stateful_request *r;
     statefulhelper *hlp = srv->parent;
-    assert(fd == srv->rfd);
     assert(cbdataReferenceValid(data));
 
     /* Bail out early on COMM_ERR_CLOSING - close handlers will tidy up for us */
@@ -1108,6 +1110,8 @@
         return;
     }
 
+    assert(fd == srv->rfd);
+
     debugs(84, 5, "helperStatefulHandleRead: " << len << " bytes from " <<
            hlp->id_name << " #" << srv->index + 1);
 
@@ -1209,22 +1213,11 @@
                        tvSubMsec(srv->dispatch_time, current_time),
                        hlp->stats.replies, REDIRECT_AV_FACTOR);
 
-        if (srv->flags.shutdown
-                && srv->flags.reserved == S_HELPER_FREE
-                && !srv->deferred_requests) {
-            int wfd = srv->wfd;
-            srv->wfd = -1;
-            srv->flags.closing=1;
-            comm_close(wfd);
-        } else {
-            if (srv->queue.head)
-                helperStatefulServerKickQueue(srv);
-            else
-                helperStatefulKickQueue(hlp);
-        }
+        helperStatefulServerKickQueue(srv);
     }
 
-    comm_read(srv->rfd, srv->rbuf + srv->roffset, srv->rbuf_sz - srv->roffset - 1,
+    if (srv->rfd != -1)
+        comm_read(srv->rfd, srv->rbuf + srv->roffset, srv->rbuf_sz - srv->roffset - 1,
               helperStatefulHandleRead, srv);
 }
 
@@ -1542,21 +1535,8 @@
         /* and push the queue. Note that the callback may have submitted a new
          * request to the helper which is why we test for the request*/
 
-        if (srv->request == NULL) {
-            if (srv->flags.shutdown
-                    && srv->flags.reserved == S_HELPER_FREE
-                    && !srv->deferred_requests) {
-                int wfd = srv->wfd;
-                srv->wfd = -1;
-                srv->flags.closing=1;
-                comm_close(wfd);
-            } else {
-                if (srv->queue.head)
-                    helperStatefulServerKickQueue(srv);
-                else
-                    helperStatefulKickQueue(hlp);
-            }
-        }
+        if (srv->request == NULL)
+            helperStatefulServerKickQueue(srv);
 
         return;
     }
@@ -1603,8 +1583,22 @@
 {
     helper_stateful_request *r;
 
-    if ((r = StatefulServerDequeue(srv)))
+    if ((r = StatefulServerDequeue(srv))) {
         helperStatefulDispatch(srv, r);
+        return;
+    }
+
+    if (!srv->flags.shutdown) {
+        helperStatefulKickQueue(srv->parent);
+    } else if (!srv->flags.closing && srv->flags.reserved == S_HELPER_FREE && !srv->flags.busy) {
+        int wfd = srv->wfd;
+        srv->wfd = -1;
+        if (srv->rfd == wfd)
+            srv->rfd = -1;
+        srv->flags.closing=1;
+        comm_close(wfd);
+        return;
+    }
 }
 
 static void
diff -u -r -N squid-3.0.STABLE17/src/HttpMsg.cc squid-3.0.STABLE18/src/HttpMsg.cc
--- squid-3.0.STABLE17/src/HttpMsg.cc	2009-07-27 00:24:46.000000000 +1200
+++ squid-3.0.STABLE18/src/HttpMsg.cc	2009-08-04 23:57:48.000000000 +1200
@@ -154,8 +154,11 @@
 
     // sanity check the start line to see if this is in fact an HTTP message
     if (!sanityCheckStartLine(buf, hdr_len, error)) {
-        debugs(58,1, HERE << "first line of HTTP message is invalid");
-        // NP: sanityCheck sets *error
+        // NP: sanityCheck sets *error and sends debug warnings on syntax errors.
+        // if we have seen the connection close, this is an error too
+        if (eof && *error==HTTP_STATUS_NONE)
+            *error = HTTP_INVALID_HEADER;
+
         return false;
     }
 
diff -u -r -N squid-3.0.STABLE17/src/HttpReply.cc squid-3.0.STABLE18/src/HttpReply.cc
--- squid-3.0.STABLE17/src/HttpReply.cc	2009-07-27 00:24:46.000000000 +1200
+++ squid-3.0.STABLE18/src/HttpReply.cc	2009-08-04 23:57:48.000000000 +1200
@@ -446,8 +446,10 @@
     // content is long enough to possibly hold a reply
     // 4 being magic size of a 3-digit number plus space delimiter
     if ( buf->contentSize() < (protoPrefix.size() + 4) ) {
-        if (hdr_len > 0)
+        if (hdr_len > 0) {
+            debugs(58, 3, HERE << "Too small reply header (" << hdr_len << " bytes)");
             *error = HTTP_INVALID_HEADER;
+        }
         return false;
     }
 
diff -u -r -N squid-3.0.STABLE17/src/HttpRequest.cc squid-3.0.STABLE18/src/HttpRequest.cc
--- squid-3.0.STABLE17/src/HttpRequest.cc	2009-07-27 00:24:46.000000000 +1200
+++ squid-3.0.STABLE18/src/HttpRequest.cc	2009-08-04 23:57:48.000000000 +1200
@@ -156,6 +156,7 @@
     if ( buf->contentSize() < 2 ) {
         // this is ony a real error if the headers apparently complete.
         if (hdr_len > 0) {
+            debugs(58, 3, HERE << "Too large request header (" << hdr_len << " bytes)");
             *error = HTTP_INVALID_HEADER;
         }
         return false;
diff -u -r -N squid-3.0.STABLE17/src/pconn.cc squid-3.0.STABLE18/src/pconn.cc
--- squid-3.0.STABLE17/src/pconn.cc	2009-07-27 00:24:48.000000000 +1200
+++ squid-3.0.STABLE18/src/pconn.cc	2009-08-04 23:57:50.000000000 +1200
@@ -188,7 +188,7 @@
     else
         snprintf(buf, SQUIDHOSTNAMELEN * 3 + 10, "%s:%d", host, (int) port);
 
-    debugs(48,6,"PconnPool::key(" << host << "," << port << "," << domain << "," << inet_ntoa(*client_address) << "is {" << buf << "}" );
+    debugs(48,6,"PconnPool::key(" << (host?host:"(no host!)") << "," << port << "," << (domain?domain:"(no domain)") << "," << (client_address?inet_ntoa(*client_address):"(no client IP)") << "is {" << buf << "}" );
     return buf;
 }
 
