diff -ruN squid-2.5.STABLE9-RC1/ChangeLog squid-2.5.STABLE9/ChangeLog
--- squid-2.5.STABLE9-RC1/ChangeLog	Sun Feb 20 03:44:07 2005
+++ squid-2.5.STABLE9/ChangeLog	Wed Feb 23 16:53:37 2005
@@ -1,5 +1,8 @@
-Changes to squid-2.5.STABLE9 ()
+Changes to squid-2.5.STABLE9 (24 Feb 2005)
 
+	- [Medium] Don't retry requests on 403 errors (Bug #1210)
+	- [Minor] Ignore invalid FQDN DNS responses (Bug #1222)
+	- [Minor] cache_peer related memory leaks on reconfigure (Bug #1246)
 	- [Minor] relaxed_header_parser extended to work around even more
 	  broken web servers (Bug #1242)
 	- [Minor] FTP gatewaying URLs cleaned up slightly, mainly to work
diff -ruN squid-2.5.STABLE9-RC1/RELEASENOTES.html squid-2.5.STABLE9/RELEASENOTES.html
--- squid-2.5.STABLE9-RC1/RELEASENOTES.html	Sun Feb 20 03:53:17 2005
+++ squid-2.5.STABLE9/RELEASENOTES.html	Wed Feb 23 16:55:05 2005
@@ -7,7 +7,7 @@
 <BODY>
 <H1>Squid 2.5 release notes</H1>
 
-<H2>Squid Developers</H2>$Id: release-2.5.html,v 1.1.2.42 2005/02/20 10:46:51 hno Exp $
+<H2>Squid Developers</H2>$Id: release-2.5.html,v 1.1.2.44 2005/02/23 00:26:20 hno Exp $
 <HR>
 <EM>This document contains the release notes for version 2.5 of Squid.
 Squid is a WWW Cache application developed by the National Laboratory
@@ -138,6 +138,7 @@
 <DT><B>reply_header_max_size</B><DD><P>New directive in 2.5.STABLE7 limiting the size of HTTP reply headers, similar to request_header_max_size but in the reply direction (from servers to clients). Default is 20KB.</P>
 <DT><B>acl req_hdr/resp_hdr</B><DD><P>New acl types in 2.5.STABLE7 to match arbitrary HTTP headers, useful to block certain malware/spyware etc.</P>
 <DT><B>relaxed_http_parser</B><DD><P>New directive in 2.5.STABLE8 to control how strict the HTTP parser should be.</P>
+<DT><B>retry_on_error</B><DD><P>New directive in 2.5.STABLE9 to aggressive retry requests on errors (was the default in earlier versions)</P>
 </DL>
 </P>
 
@@ -158,6 +159,12 @@
 <A HREF="http://www.squid-cache.org/bugs/show_bug.cgi?id=779">#779</A></B><DD><P>users going above their allowed IP count no longer logged in cache.log</P>
 <DT><B>Bug 
 <A HREF="http://www.squid-cache.org/bugs/show_bug.cgi?id=1204">#1204</A></B><DD><P>FTP listings uses "BASE HREF" much more than it needs to</P>
+<DT><B>Bug 
+<A HREF="http://www.squid-cache.org/bugs/show_bug.cgi?id=888">#888</A></B><DD><P>ntlm_user_pool assertion error on shutdown</P>
+<DT><B>Bug 
+<A HREF="http://www.squid-cache.org/bugs/show_bug.cgi?id=1223">#1223</A></B><DD><P>Authentication could be more informative on why a login failed</P>
+<DT><B>Bug 
+<A HREF="http://www.squid-cache.org/bugs/show_bug.cgi?id=1227">#1227</A></B><DD><P>Syslog facility should not be hardcoded to "local4"</P>
 </DL>
 </P>
 
@@ -379,6 +386,9 @@
 <LI>DNS related assertion error</LI>
 <LI>High characters allowed in FTP &amp; Gopher listings.</LI>
 <LI>Additional workarounds for broken web servers rejected by 2.5.STABLE8.</LI>
+<LI>No longer automatically retries requests on 403 Access Denied or
+many other server errors. New squid.conf directive retry_on_error to revert
+back to the old behaviour if needed.</LI>
 <LI>a number of other minor and cosmetic bugfixes. See the list of 
 <A HREF="http://www.squid-cache.org/Versions/v2/2.5/bugs/#STABLE8">squid-2.5.STABLE8 patches</A> and the 
 <A HREF="ChangeLog">ChangeLog</A> file for details.</LI>
diff -ruN squid-2.5.STABLE9-RC1/bootstrap.sh squid-2.5.STABLE9/bootstrap.sh
--- squid-2.5.STABLE9-RC1/bootstrap.sh	Thu Oct 31 14:22:23 2002
+++ squid-2.5.STABLE9/bootstrap.sh	Sun Feb 20 18:33:44 2005
@@ -52,6 +52,13 @@
   fi
 }
 
+fixmakefiles() {
+  bad_files="`find . -name Makefile.in | xargs grep -l "AR = ar"`"
+  if [ -n "$bad_files" ]; then
+    perl -i -p -e 's/^/#/ if /^AR = ar/' $bad_files
+  fi
+}
+
 # Make sure cfgaux exists
 mkdir -p cfgaux
 
@@ -63,6 +70,7 @@
 bootstrap aclocal$amver
 bootstrap autoheader$acver
 bootstrap automake$amver --foreign --add-missing
+fixmakefiles
 bootstrap autoconf$acver
 
 echo "Autotool bootstrapping complete."
diff -ruN squid-2.5.STABLE9-RC1/configure squid-2.5.STABLE9/configure
--- squid-2.5.STABLE9-RC1/configure	Sun Feb 20 03:53:06 2005
+++ squid-2.5.STABLE9/configure	Wed Feb 23 16:54:54 2005
@@ -1000,7 +1000,7 @@
 
 # Define the identity of the package.
 PACKAGE=squid
-VERSION=2.5.STABLE9-RC1
+VERSION=2.5.STABLE9
 cat >> confdefs.h <<EOF
 #define PACKAGE "$PACKAGE"
 EOF
diff -ruN squid-2.5.STABLE9-RC1/configure.in squid-2.5.STABLE9/configure.in
--- squid-2.5.STABLE9-RC1/configure.in	Sun Feb 20 03:53:06 2005
+++ squid-2.5.STABLE9/configure.in	Wed Feb 23 16:54:54 2005
@@ -3,15 +3,15 @@
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.251.2.80 2005/02/20 10:50:43 hno Exp $
+dnl  $Id: configure.in,v 1.251.2.81 2005/02/23 23:53:39 hno Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_AUX_DIR(cfgaux)
-AM_INIT_AUTOMAKE(squid, 2.5.STABLE9-RC1)
+AM_INIT_AUTOMAKE(squid, 2.5.STABLE9)
 AM_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.251.2.80 $)dnl
+AC_REVISION($Revision: 1.251.2.81 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AM_MAINTAINER_MODE
 
diff -ruN squid-2.5.STABLE9-RC1/helpers/basic_auth/LDAP/squid_ldap_auth.c squid-2.5.STABLE9/helpers/basic_auth/LDAP/squid_ldap_auth.c
--- squid-2.5.STABLE9-RC1/helpers/basic_auth/LDAP/squid_ldap_auth.c	Sat Feb  5 03:53:07 2005
+++ squid-2.5.STABLE9/helpers/basic_auth/LDAP/squid_ldap_auth.c	Sun Feb 20 12:07:44 2005
@@ -273,7 +273,7 @@
 static int
 validUsername(const char *user)
 {
-    const unsigned char *p = user;
+    const unsigned char *p = (const unsigned char *)user;
 
     /* Leading whitespace? */
     if (isspace(p[0]))
diff -ruN squid-2.5.STABLE9-RC1/helpers/basic_auth/winbind/wbntlm.h squid-2.5.STABLE9/helpers/basic_auth/winbind/wbntlm.h
--- squid-2.5.STABLE9-RC1/helpers/basic_auth/winbind/wbntlm.h	Sat Jul 20 05:26:55 2002
+++ squid-2.5.STABLE9/helpers/basic_auth/winbind/wbntlm.h	Sun Feb 20 12:07:44 2005
@@ -37,7 +37,7 @@
 
 /* Debugging stuff */
 extern char *myname;
-static char *__foo;
+static const char *__foo;
 extern pid_t mypid;
 extern char debug_enabled;
 
diff -ruN squid-2.5.STABLE9-RC1/helpers/ntlm_auth/SMB/libntlmssp.c squid-2.5.STABLE9/helpers/ntlm_auth/SMB/libntlmssp.c
--- squid-2.5.STABLE9-RC1/helpers/ntlm_auth/SMB/libntlmssp.c	Fri Jun 11 10:07:55 2004
+++ squid-2.5.STABLE9/helpers/ntlm_auth/SMB/libntlmssp.c	Sun Feb 20 12:07:44 2005
@@ -72,8 +72,8 @@
 
 
 #define ENCODED_PASS_LEN 24
-static char challenge[NONCE_LEN];
-static char lmencoded_empty_pass[ENCODED_PASS_LEN],
+static unsigned char challenge[NONCE_LEN];
+static unsigned char lmencoded_empty_pass[ENCODED_PASS_LEN],
 	ntencoded_empty_pass[ENCODED_PASS_LEN];
 SMB_Handle_Type handle = NULL;
 
@@ -139,8 +139,8 @@
 	return 3;
     }
     memcpy(challenge, handle->Encrypt_Key, NONCE_LEN);
-		SMBencrypt("",challenge,lmencoded_empty_pass);
-		SMBNTencrypt("",challenge,ntencoded_empty_pass);
+		SMBencrypt((unsigned char *)"",challenge,lmencoded_empty_pass);
+		SMBNTencrypt((unsigned char *)"",challenge,ntencoded_empty_pass);
     return 0;
 }
 
diff -ruN squid-2.5.STABLE9-RC1/helpers/ntlm_auth/SMB/ntlm.h squid-2.5.STABLE9/helpers/ntlm_auth/SMB/ntlm.h
--- squid-2.5.STABLE9-RC1/helpers/ntlm_auth/SMB/ntlm.h	Wed Nov 28 01:01:59 2001
+++ squid-2.5.STABLE9/helpers/ntlm_auth/SMB/ntlm.h	Sun Feb 20 12:07:44 2005
@@ -50,7 +50,7 @@
 #ifdef DEBUG
 #include <stdio.h>
 #include <unistd.h>
-static char *__foo;
+static const char *__foo;
 extern char debug_enabled;
 #define debug(X...) if (debug_enabled) { \
                     fprintf(stderr,"ntlm-auth[%d](%s:%d): ", getpid(), \
diff -ruN squid-2.5.STABLE9-RC1/helpers/ntlm_auth/SMB/smbval/Makefile.in squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/Makefile.in
--- squid-2.5.STABLE9-RC1/helpers/ntlm_auth/SMB/smbval/Makefile.in	Sat Jul 10 06:11:46 2004
+++ squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/Makefile.in	Sun Feb 20 18:35:48 2005
@@ -173,7 +173,7 @@
 	  CONFIG_HEADERS= CONFIG_LINKS= \
 	  CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
 
-AR = ar
+#AR = ar
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
diff -ruN squid-2.5.STABLE9-RC1/helpers/ntlm_auth/SMB/smbval/smblib-priv.h squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/smblib-priv.h
--- squid-2.5.STABLE9-RC1/helpers/ntlm_auth/SMB/smbval/smblib-priv.h	Fri Mar  9 17:55:38 2001
+++ squid-2.5.STABLE9/helpers/ntlm_auth/SMB/smbval/smblib-priv.h	Sun Feb 20 12:07:44 2005
@@ -497,7 +497,7 @@
 /* The following two arrays need to be in step!              */
 /* We must make it possible for callers to specify these ... */
 
-
+#if 0
 extern char *SMB_Prots[];
 
 /*
@@ -532,6 +532,8 @@
  * SMB_P_NT1,
  * -1};
  */
+#endif
+
 typedef struct SMB_Status {
 
     union {
diff -ruN squid-2.5.STABLE9-RC1/helpers/ntlm_auth/winbind/wb_ntlm_auth.c squid-2.5.STABLE9/helpers/ntlm_auth/winbind/wb_ntlm_auth.c
--- squid-2.5.STABLE9-RC1/helpers/ntlm_auth/winbind/wb_ntlm_auth.c	Fri Sep 12 04:11:25 2003
+++ squid-2.5.STABLE9/helpers/ntlm_auth/winbind/wb_ntlm_auth.c	Sun Feb 20 12:07:45 2005
@@ -137,7 +137,7 @@
 }
 
 static unsigned char challenge[CHALLENGE_LEN + 1];
-static char *
+static unsigned char *
 build_challenge(void)
 {
     size_t gotchars;
diff -ruN squid-2.5.STABLE9-RC1/helpers/ntlm_auth/winbind/wbntlm.h squid-2.5.STABLE9/helpers/ntlm_auth/winbind/wbntlm.h
--- squid-2.5.STABLE9-RC1/helpers/ntlm_auth/winbind/wbntlm.h	Sun May 19 17:45:31 2002
+++ squid-2.5.STABLE9/helpers/ntlm_auth/winbind/wbntlm.h	Sun Feb 20 12:07:45 2005
@@ -37,7 +37,7 @@
 
 /* Debugging stuff */
 extern char *myname;
-static char *__foo;
+static const char *__foo;
 extern pid_t mypid;
 extern char debug_enabled;
 
diff -ruN squid-2.5.STABLE9-RC1/include/config.h squid-2.5.STABLE9/include/config.h
--- squid-2.5.STABLE9-RC1/include/config.h	Sat Apr 17 19:29:51 2004
+++ squid-2.5.STABLE9/include/config.h	Sun Feb 20 04:02:56 2005
@@ -1,5 +1,5 @@
 /*
- * $Id: config.h,v 1.4.2.1 2004/04/18 01:29:51 hno Exp $
+ * $Id: config.h,v 1.4.2.2 2005/02/20 11:02:56 hno Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -163,6 +163,7 @@
 #define xisascii(x) isascii((unsigned char)x)
 #define xislower(x) islower((unsigned char)x)
 #define xisalpha(x) isalpha((unsigned char)x)
+#define xisalnum(x) isalnum((unsigned char)x)
 #define xisgraph(x) isgraph((unsigned char)x)
 
 #if HAVE_RANDOM
diff -ruN squid-2.5.STABLE9-RC1/include/ntlmauth.h squid-2.5.STABLE9/include/ntlmauth.h
--- squid-2.5.STABLE9-RC1/include/ntlmauth.h	Mon May 12 12:48:07 2003
+++ squid-2.5.STABLE9/include/ntlmauth.h	Sun Feb 20 12:07:45 2005
@@ -1,5 +1,5 @@
 /*
- * $Id: ntlmauth.h,v 1.8.2.1 2003/05/12 18:48:07 hno Exp $
+ * $Id: ntlmauth.h,v 1.8.2.2 2005/02/20 19:07:45 hno Exp $
  *
  * * * * * * * * Legal stuff * * * * * * *
  *
@@ -173,7 +173,7 @@
 } ntlm_authenticate;
 
 const char *ntlm_make_challenge(char *domain, char *domain_controller,
-    char *challenge_nonce, int challenge_nonce_len);
+    unsigned char *challenge_nonce, int challenge_nonce_len);
 lstring ntlm_fetch_string(char *packet, int32_t length, strhdr * str);
 void ntlm_add_to_payload(char *payload, int *payload_length,
     strhdr * hdr, char *toadd,
diff -ruN squid-2.5.STABLE9-RC1/include/version.h squid-2.5.STABLE9/include/version.h
--- squid-2.5.STABLE9-RC1/include/version.h	Sun Feb 20 03:53:06 2005
+++ squid-2.5.STABLE9/include/version.h	Wed Feb 23 16:54:54 2005
@@ -9,5 +9,5 @@
  */
 
 #ifndef SQUID_RELEASE_TIME
-#define SQUID_RELEASE_TIME 1108896783
+#define SQUID_RELEASE_TIME 1109202891
 #endif
diff -ruN squid-2.5.STABLE9-RC1/lib/GNUregex.c squid-2.5.STABLE9/lib/GNUregex.c
--- squid-2.5.STABLE9-RC1/lib/GNUregex.c	Thu Jun 19 18:09:06 2003
+++ squid-2.5.STABLE9/lib/GNUregex.c	Sun Feb 20 12:07:45 2005
@@ -1,5 +1,5 @@
 /*
- * $Id: GNUregex.c,v 1.12.2.1 2003/06/20 00:09:06 hno Exp $
+ * $Id: GNUregex.c,v 1.12.2.2 2005/02/20 19:07:45 hno Exp $
  */
 
 /* Extended regular expression matching and search library,
@@ -3663,7 +3663,7 @@
 		    /* Compare that many; failure if mismatch, else move
 		     * past them.  */
 		    if (translate
-			? bcmp_translate(d, d2, mcnt, translate)
+			? bcmp_translate((unsigned char *)d, (unsigned char *)d2, mcnt, translate)
 			: memcmp(d, d2, mcnt))
 			goto fail;
 		    d += mcnt, d2 += mcnt;
diff -ruN squid-2.5.STABLE9-RC1/lib/Makefile.in squid-2.5.STABLE9/lib/Makefile.in
--- squid-2.5.STABLE9-RC1/lib/Makefile.in	Wed Sep  1 04:30:29 2004
+++ squid-2.5.STABLE9/lib/Makefile.in	Sun Feb 20 18:35:48 2005
@@ -14,7 +14,7 @@
 @SET_MAKE@
 
 #
-#  $Id: Makefile.in,v 1.57.2.14 2004/09/01 10:30:29 hno Exp $
+#  $Id: Makefile.in,v 1.57.2.15 2005/02/21 01:35:48 hno Exp $
 #
 
 SHELL = @SHELL@
@@ -254,7 +254,7 @@
 	  CONFIG_HEADERS= CONFIG_LINKS= \
 	  CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
 
-AR = ar
+#AR = ar
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
diff -ruN squid-2.5.STABLE9-RC1/lib/ntlmauth.c squid-2.5.STABLE9/lib/ntlmauth.c
--- squid-2.5.STABLE9-RC1/lib/ntlmauth.c	Fri Aug 20 02:09:58 2004
+++ squid-2.5.STABLE9/lib/ntlmauth.c	Sun Feb 20 12:07:45 2005
@@ -1,5 +1,5 @@
 /*
- * $Id: ntlmauth.c,v 1.5.2.3 2004/08/20 08:09:58 hno Exp $
+ * $Id: ntlmauth.c,v 1.5.2.4 2005/02/20 19:07:45 hno Exp $
  *
  * * * * * * * * Legal stuff * * * * * * *
  *
@@ -123,7 +123,7 @@
  */
 const char *
 ntlm_make_challenge(char *domain, char *domain_controller,
-    char *challenge_nonce, int challenge_nonce_len)
+    unsigned char *challenge_nonce, int challenge_nonce_len)
 {
     ntlm_challenge ch;
     int pl = 0;
diff -ruN squid-2.5.STABLE9-RC1/snmplib/Makefile.in squid-2.5.STABLE9/snmplib/Makefile.in
--- squid-2.5.STABLE9-RC1/snmplib/Makefile.in	Sat Jul 10 06:11:48 2004
+++ squid-2.5.STABLE9/snmplib/Makefile.in	Sun Feb 20 18:35:48 2005
@@ -169,7 +169,7 @@
 	  CONFIG_HEADERS= CONFIG_LINKS= \
 	  CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
 
-AR = ar
+#AR = ar
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
diff -ruN squid-2.5.STABLE9-RC1/src/acl.c squid-2.5.STABLE9/src/acl.c
--- squid-2.5.STABLE9-RC1/src/acl.c	Sun Feb 13 11:03:20 2005
+++ squid-2.5.STABLE9/src/acl.c	Sun Feb 20 12:07:45 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: acl.c,v 1.270.2.33 2005/02/13 18:03:20 serassio Exp $
+ * $Id: acl.c,v 1.270.2.34 2005/02/20 19:07:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -2856,7 +2856,7 @@
 #if defined(_SQUID_LINUX_)
     struct arpreq arpReq;
     struct sockaddr_in ipAddr;
-    unsigned char ifbuffer[sizeof(struct ifreq) * 64];
+    char ifbuffer[sizeof(struct ifreq) * 64];
     struct ifconf ifc;
     struct ifreq *ifr;
     int offset;
diff -ruN squid-2.5.STABLE9-RC1/src/auth/Makefile.in squid-2.5.STABLE9/src/auth/Makefile.in
--- squid-2.5.STABLE9-RC1/src/auth/Makefile.in	Sat Jul 10 06:11:49 2004
+++ squid-2.5.STABLE9/src/auth/Makefile.in	Sun Feb 20 18:35:48 2005
@@ -15,7 +15,7 @@
 
 #  Makefile for authentication modules in the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.6.2.9 2004/07/10 12:11:49 hno Exp $
+#  $Id: Makefile.in,v 1.6.2.10 2005/02/21 01:35:48 hno Exp $
 #
 
 SHELL = @SHELL@
@@ -189,7 +189,7 @@
 	  CONFIG_HEADERS= CONFIG_LINKS= \
 	  CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
 
-AR = ar
+#AR = ar
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
diff -ruN squid-2.5.STABLE9-RC1/src/auth/ntlm/auth_ntlm.h squid-2.5.STABLE9/src/auth/ntlm/auth_ntlm.h
--- squid-2.5.STABLE9-RC1/src/auth/ntlm/auth_ntlm.h	Wed Aug 25 14:24:04 2004
+++ squid-2.5.STABLE9/src/auth/ntlm/auth_ntlm.h	Sun Feb 20 12:07:46 2005
@@ -85,8 +85,4 @@
 typedef struct _auth_ntlm_config auth_ntlm_config;
 typedef struct _ntlm_challenge_hash_pointer ntlm_challenge_hash_pointer;
 
-extern MemPool *ntlm_helper_state_pool;
-extern MemPool *ntlm_user_pool;
-extern MemPool *ntlm_request_pool;
-
 #endif
diff -ruN squid-2.5.STABLE9-RC1/src/cache_cf.c squid-2.5.STABLE9/src/cache_cf.c
--- squid-2.5.STABLE9-RC1/src/cache_cf.c	Thu Feb 10 03:07:05 2005
+++ squid-2.5.STABLE9/src/cache_cf.c	Sun Feb 20 19:55:04 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.c,v 1.396.2.19 2005/02/10 10:07:05 hno Exp $
+ * $Id: cache_cf.c,v 1.396.2.20 2005/02/21 02:55:04 hno Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -1573,9 +1573,12 @@
     while ((p = *P) != NULL) {
 	*P = p->next;
 #if USE_CACHE_DIGESTS
-	if (p->digest)
-	    cbdataUnlock(p->digest);
-	p->digest = NULL;
+	if (p->digest) {
+	    PeerDigest *pd = p->digest;
+	    p->digest = NULL;
+	    peerDigestNotePeerGone(pd);
+	    cbdataUnlock(pd);
+	}
 #endif
 	cbdataFree(p);
     }
diff -ruN squid-2.5.STABLE9-RC1/src/cf.data.pre squid-2.5.STABLE9/src/cf.data.pre
--- squid-2.5.STABLE9-RC1/src/cf.data.pre	Thu Feb 10 03:07:05 2005
+++ squid-2.5.STABLE9/src/cf.data.pre	Tue Feb 22 17:06:34 2005
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.245.2.84 2005/02/10 10:07:05 hno Exp $
+# $Id: cf.data.pre,v 1.245.2.85 2005/02/23 00:06:34 hno Exp $
 #
 #
 # SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -3247,6 +3247,17 @@
 
 	Note: This is in addition to the request reforwarding which
 	takes place if Squid fails to get a satisfying response.
+DOC_END
+
+NAME: retry_on_error
+TYPE: onoff
+LOC: Config.retry.onerror
+DEFAULT: off
+DOC_START
+	If set to on Squid will automatically retry requests when
+	receiving an error response. This is mainly useful if you
+	are in a complex cache hierarchy to work around access
+	control errors.
 DOC_END
 
 NAME: snmp_port
diff -ruN squid-2.5.STABLE9-RC1/src/client_side.c squid-2.5.STABLE9/src/client_side.c
--- squid-2.5.STABLE9-RC1/src/client_side.c	Thu Feb  3 17:10:09 2005
+++ squid-2.5.STABLE9/src/client_side.c	Sun Feb 20 12:07:45 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.c,v 1.561.2.70 2005/02/04 00:10:09 hno Exp $
+ * $Id: client_side.c,v 1.561.2.71 2005/02/20 19:07:45 hno Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -3016,7 +3016,7 @@
     /* Process next request */
     while (conn->in.offset > 0 && conn->body.size_left == 0) {
 	int nrequests;
-	size_t req_line_sz;
+	size_t req_line_sz = 0;
 	/* Skip leading (and trailing) whitespace */
 	while (conn->in.offset > 0 && xisspace(conn->in.buf[0])) {
 	    xmemmove(conn->in.buf, conn->in.buf + 1, conn->in.offset - 1);
diff -ruN squid-2.5.STABLE9-RC1/src/event.c squid-2.5.STABLE9/src/event.c
--- squid-2.5.STABLE9-RC1/src/event.c	Sun Nov 10 07:17:24 2002
+++ squid-2.5.STABLE9/src/event.c	Sun Feb 20 19:55:04 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: event.c,v 1.31.2.1 2002/11/10 14:17:24 hno Exp $
+ * $Id: event.c,v 1.31.2.2 2005/02/21 02:55:04 hno Exp $
  *
  * DEBUG: section 41    Event Processing
  * AUTHOR: Henrik Nordstrom
@@ -147,6 +147,26 @@
 	    func(arg);
 	}
 	memFree(event, MEM_EVENT);
+    }
+}
+
+void
+eventCleanup(void)
+{
+    struct ev_entry **p = &tasks;
+
+    debug(41, 0) ("eventCleanup\n");
+
+    while (*p) {
+	struct ev_entry *event = *p;
+	if (!cbdataValid(event->arg)) {
+	    debug(41, 0) ("eventCleanup: cleaning '%s'\n", event->name);
+	    *p = event->next;
+	    cbdataUnlock(event->arg);
+	    memFree(event, MEM_EVENT);
+	} else {
+	    p = &event->next;
+	}
     }
 }
 
diff -ruN squid-2.5.STABLE9-RC1/src/external_acl.c squid-2.5.STABLE9/src/external_acl.c
--- squid-2.5.STABLE9-RC1/src/external_acl.c	Sun Feb 13 14:23:19 2005
+++ squid-2.5.STABLE9/src/external_acl.c	Sun Feb 20 04:02:56 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: external_acl.c,v 1.1.2.32 2005/02/13 21:23:19 serassio Exp $
+ * $Id: external_acl.c,v 1.1.2.33 2005/02/20 11:02:56 hno Exp $
  *
  * DEBUG: section 82    External ACL
  * AUTHOR: Henrik Nordstrom, MARA Systems AB
@@ -231,7 +231,7 @@
 	    if (member) {
 		/* Split in header and member */
 		*member++ = '\0';
-		if (!isalnum((int) *member))
+		if (!xisalnum(*member))
 		    format->separator = *member++;
 		else
 		    format->separator = ',';
diff -ruN squid-2.5.STABLE9-RC1/src/forward.c squid-2.5.STABLE9/src/forward.c
--- squid-2.5.STABLE9-RC1/src/forward.c	Tue Oct  5 16:34:42 2004
+++ squid-2.5.STABLE9/src/forward.c	Tue Feb 22 17:06:35 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.c,v 1.82.2.13 2004/10/05 22:34:42 hno Exp $
+ * $Id: forward.c,v 1.82.2.14 2005/02/23 00:06:35 hno Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -837,13 +837,14 @@
 fwdReforwardableStatus(http_status s)
 {
     switch (s) {
+    case HTTP_BAD_GATEWAY:
+    case HTTP_GATEWAY_TIMEOUT:
+	return 1;
     case HTTP_FORBIDDEN:
     case HTTP_INTERNAL_SERVER_ERROR:
     case HTTP_NOT_IMPLEMENTED:
-    case HTTP_BAD_GATEWAY:
     case HTTP_SERVICE_UNAVAILABLE:
-    case HTTP_GATEWAY_TIMEOUT:
-	return 1;
+	return Config.retry.onerror;
     default:
 	return 0;
     }
diff -ruN squid-2.5.STABLE9-RC1/src/fqdncache.c squid-2.5.STABLE9/src/fqdncache.c
--- squid-2.5.STABLE9-RC1/src/fqdncache.c	Sat Feb 12 22:53:56 2005
+++ squid-2.5.STABLE9/src/fqdncache.c	Mon Feb 21 09:59:45 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.c,v 1.149.2.6 2005/02/13 05:53:56 hno Exp $
+ * $Id: fqdncache.c,v 1.149.2.7 2005/02/21 16:59:45 hno Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -303,8 +303,14 @@
 	    continue;
 	if (answers[k].class != RFC1035_CLASS_IN)
 	    continue;
-	if (!answers[k].rdata[0])
+	if (!answers[k].rdata[0]) {
+	    debug(35, 2) ("fqdncacheParse: blank PTR record for '%s'\n", name);
 	    continue;
+	}
+	if (strchr(answers[k].rdata, ' ')) {
+	    debug(35, 2) ("fqdncacheParse: invalid PTR record '%s' for '%s'\n", answers[k].rdata, name);
+	    continue;
+	}
 	f->names[f->name_count++] = xstrdup(answers[k].rdata);
 	if (ttl == 0 || answers[k].ttl < ttl)
 	    ttl = answers[k].ttl;
@@ -312,7 +318,7 @@
 	    break;
     }
     if (f->name_count == 0) {
-	debug(35, 1) ("fqdncacheParse: No PTR record\n");
+	debug(35, 1) ("fqdncacheParse: No PTR record for '%s'\n", name);
 	f->error_message = xstrdup("No PTR record");
 	return f;
     }
diff -ruN squid-2.5.STABLE9-RC1/src/fs/Makefile.in squid-2.5.STABLE9/src/fs/Makefile.in
--- squid-2.5.STABLE9-RC1/src/fs/Makefile.in	Sat Jul 10 06:11:49 2004
+++ squid-2.5.STABLE9/src/fs/Makefile.in	Sun Feb 20 18:35:49 2005
@@ -15,7 +15,7 @@
 
 #  Makefile for storage modules in the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.8.2.10 2004/07/10 12:11:49 hno Exp $
+#  $Id: Makefile.in,v 1.8.2.11 2005/02/21 01:35:49 hno Exp $
 #
 
 SHELL = @SHELL@
@@ -223,7 +223,7 @@
 	  CONFIG_HEADERS= CONFIG_LINKS= \
 	  CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
 
-AR = ar
+#AR = ar
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
diff -ruN squid-2.5.STABLE9-RC1/src/ftp.c squid-2.5.STABLE9/src/ftp.c
--- squid-2.5.STABLE9-RC1/src/ftp.c	Mon Feb 14 19:13:13 2005
+++ squid-2.5.STABLE9/src/ftp.c	Sun Feb 20 20:35:08 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.c,v 1.316.2.20 2005/02/15 02:13:13 hno Exp $
+ * $Id: ftp.c,v 1.316.2.21 2005/02/21 03:35:08 hno Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -1045,6 +1045,12 @@
 	strCat(ftpState->title_url, xitoa(request->port));
     }
     strCat(ftpState->title_url, strBuf(request->urlpath));
+    {
+	char *t = xstrdup(strBuf(ftpState->title_url));
+	rfc1738_unescape(t);
+	stringReset(&ftpState->title_url, t);
+	xfree(t);
+    }
 
     stringReset(&ftpState->base_href, "ftp://");
     if (strcmp(ftpState->user, "anonymous")) {
diff -ruN squid-2.5.STABLE9-RC1/src/htcp.c squid-2.5.STABLE9/src/htcp.c
--- squid-2.5.STABLE9-RC1/src/htcp.c	Wed Aug  6 07:49:01 2003
+++ squid-2.5.STABLE9/src/htcp.c	Sun Feb 20 12:07:45 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: htcp.c,v 1.38.2.4 2003/08/06 13:49:01 hno Exp $
+ * $Id: htcp.c,v 1.38.2.5 2005/02/20 19:07:45 hno Exp $
  *
  * DEBUG: section 31    Hypertext Caching Protocol
  * AUTHOR: Duane Wesssels
@@ -832,7 +832,7 @@
     static char buf[8192];
     int len;
     static struct sockaddr_in from;
-    int flen = sizeof(struct sockaddr_in);
+    socklen_t flen = sizeof(struct sockaddr_in);
     memset(&from, '\0', flen);
     statCounter.syscalls.sock.recvfroms++;
     len = recvfrom(fd, buf, 8192, 0, (struct sockaddr *) &from, &flen);
diff -ruN squid-2.5.STABLE9-RC1/src/main.c squid-2.5.STABLE9/src/main.c
--- squid-2.5.STABLE9-RC1/src/main.c	Sun Feb 13 14:19:44 2005
+++ squid-2.5.STABLE9/src/main.c	Sun Feb 20 19:55:04 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.c,v 1.345.2.17 2005/02/13 21:19:44 serassio Exp $
+ * $Id: main.c,v 1.345.2.19 2005/02/21 02:55:04 hno Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -390,6 +390,7 @@
     }
     storeDirOpenSwapLogs();
     mimeInit(Config.mimeTablePathname);
+    eventCleanup();
     writePidFile();		/* write PID file */
     debug(1, 1) ("Ready to serve requests.\n");
     reconfiguring = 0;
@@ -807,7 +808,7 @@
     xstrncpy(&script[sl], squid_start_script, MAXPATHLEN - sl);
     if ((cpid = fork()) == 0) {
 	/* child */
-	execl(script, squid_start_script, 0);
+	execl(script, squid_start_script, NULL);
 	_exit(0);
     } else {
 	do {
diff -ruN squid-2.5.STABLE9-RC1/src/neighbors.c squid-2.5.STABLE9/src/neighbors.c
--- squid-2.5.STABLE9-RC1/src/neighbors.c	Sat Nov 29 11:53:00 2003
+++ squid-2.5.STABLE9/src/neighbors.c	Sun Feb 20 19:55:04 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.c,v 1.299.2.4 2003/11/29 18:53:00 hno Exp $
+ * $Id: neighbors.c,v 1.299.2.5 2005/02/21 02:55:04 hno Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -961,6 +961,7 @@
 	safe_free(l->domain);
 	safe_free(l);
     }
+    aclDestroyAccessList(&p->access);
     safe_free(p->host);
 #if USE_CACHE_DIGESTS
     if (p->digest) {
diff -ruN squid-2.5.STABLE9-RC1/src/protos.h squid-2.5.STABLE9/src/protos.h
--- squid-2.5.STABLE9-RC1/src/protos.h	Fri Jan 21 05:22:59 2005
+++ squid-2.5.STABLE9/src/protos.h	Sun Feb 20 19:55:04 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.420.2.26 2005/01/21 12:22:59 hno Exp $
+ * $Id: protos.h,v 1.420.2.27 2005/02/21 02:55:04 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -257,6 +257,7 @@
 extern int eventNextTime(void);
 extern void eventDelete(EVH * func, void *arg);
 extern void eventInit(void);
+extern void eventCleanup(void);
 extern void eventFreeMemory(void);
 extern int eventFind(EVH *, void *);
 
diff -ruN squid-2.5.STABLE9-RC1/src/repl/Makefile.in squid-2.5.STABLE9/src/repl/Makefile.in
--- squid-2.5.STABLE9-RC1/src/repl/Makefile.in	Sat Jul 10 06:11:50 2004
+++ squid-2.5.STABLE9/src/repl/Makefile.in	Sun Feb 20 18:35:51 2005
@@ -15,7 +15,7 @@
 
 #  Makefile for storage modules in the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.7.2.10 2004/07/10 12:11:50 hno Exp $
+#  $Id: Makefile.in,v 1.7.2.11 2005/02/21 01:35:51 hno Exp $
 #
 
 SHELL = @SHELL@
@@ -186,7 +186,7 @@
 	  CONFIG_HEADERS= CONFIG_LINKS= \
 	  CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
 
-AR = ar
+#AR = ar
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
diff -ruN squid-2.5.STABLE9-RC1/src/structs.h squid-2.5.STABLE9/src/structs.h
--- squid-2.5.STABLE9-RC1/src/structs.h	Thu Feb  3 17:30:01 2005
+++ squid-2.5.STABLE9/src/structs.h	Tue Feb 22 17:06:35 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.408.2.36 2005/02/04 00:30:01 hno Exp $
+ * $Id: structs.h,v 1.408.2.37 2005/02/23 00:06:35 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -657,6 +657,7 @@
     char *errorDirectory;
     struct {
 	int maxtries;
+	int onerror;
     } retry;
     struct {
 	size_t limit;
diff -ruN squid-2.5.STABLE9-RC1/src/wccp.c squid-2.5.STABLE9/src/wccp.c
--- squid-2.5.STABLE9-RC1/src/wccp.c	Fri Feb  4 04:38:15 2005
+++ squid-2.5.STABLE9/src/wccp.c	Sun Feb 20 12:07:45 2005
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wccp.c,v 1.19.2.9 2005/02/04 11:38:15 hno Exp $
+ * $Id: wccp.c,v 1.19.2.10 2005/02/20 19:07:45 hno Exp $
  *
  * DEBUG: section 80    WCCP Support
  * AUTHOR: Glenn Chisholm
@@ -123,7 +123,7 @@
 {
     u_short port = WCCP_PORT;
     struct sockaddr_in router, local;
-    int local_len, router_len;
+    socklen_t local_len, router_len;
     debug(80, 5) ("wccpConnectionOpen: Called\n");
     if (Config.Wccp.router.s_addr == any_addr.s_addr) {
 	debug(1, 1) ("WCCP Disabled.\n");
