Re: Peer cache connect problem

From: Irfan Akber <irfan@dont-contact.us>
Date: Wed, 20 Oct 1999 16:48:26 +0500

I have noticed that it not only fails with having special characters in domain
name but also anywhere in the url e.g

www.example.net/one&only

would also fail

Now regarding the cache peer connect timeout problem I modify the source to reduce
the connect timeout value (is it hard coded ?), if you can point out where to do
so.

thanks

Irfan Akber

> Irfan Akber wrote:
>
> > 1) I get in cache log
> >
> > 1999/10/17 12:53:25| TCP connection to 192.168.1.2/3130 failed
> > 1999/10/17 12:53:25| TCP connection to 192.168.1.2/3130 failed
> > 1999/10/17 12:53:25| TCP connection to 192.168.1.2/3130 failed
> > 1999/10/17 12:53:55| TCP connection to 192.168.1.2/3130 succeeded
> >
> > The connect failure is only because the parent sometime in under extra
> > load but squid waits for 30 seconds and as I not want squid to go direct
> > I have enabled never_direct allow all and squid stops serving clients
> > for 30 seconds. Can this 30 second timeout be reduced to 5 seconds or
> > so.
>
> You may want to try my TCP peering patches. Has a couple of improvements
> in this area. See my Squid 2.2 patches page
> <http://hem.passagen.se/hno/squid/#patch-2.2>
>
> > 2) I get very often and the site is not served to the client.
> >
> > 1999/10/17 02:39:11| urlParse: Illegal character in hostname 'one&only'
> >
> > why & , ; are treated invalid characters, can this behaviour be changed
> > and squid should accept these characters ?
>
> Good question. Why should it be up to Squid to enforce common sense in
> host names?
>
> The best exmpanation is that various internet standars says that host
> and domain labels leading up to host names must consists of only
> letters, digits or hypens, and it is easier to get people on to the
> right path when troubleshooting if Squid returns a appripriate errore
> message saying so rather than having it return various strange error
> codes from the resolver libraries.
>
> Attached is a small patch which removes this check from Squid. If you
> underlying resolver is happy with the name then Squid will be happy.
> However, most modern host name resolvers barf on such host names so it
> will probably only change the error code returned to "DNS Domain
> 'one&only.example.net' is invalid: Non recoverable errors." or similar
> less intiutive error.
>
> --
> Henrik Nordstrom
> Squid hacker
>
> ------------------------------------------------------------------------
> Index: squid-2.2/src/url.c
> ===================================================================
> RCS file: /home/CVSROOT/squid/src/url.c,v
> retrieving revision 1.1.1.26.2.2
> diff -u -w -r1.1.1.26.2.2 url.c
> --- squid-2.2/src/url.c 1999/07/27 18:47:49 1.1.1.26.2.2
> +++ squid-2.2/src/url.c 1999/10/17 15:19:38
> @@ -76,6 +76,7 @@
> };
>
> static request_t *urnParse(method_t method, char *urn);
> +#if 0 /* Don't bother validating validity of hostname characters */
> static const char *const valid_hostname_chars =
> #if ALLOW_HOSTNAME_UNDERSCORES
> "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
> @@ -86,6 +87,7 @@
> "abcdefghijklmnopqrstuvwxyz"
> "0123456789-.";
> #endif
> +#endif
>
> /* convert %xx in url string to a character
> * Allocate a new string and return a pointer to converted string */
> @@ -233,10 +235,12 @@
> }
> for (t = host; *t; t++)
> *t = xtolower(*t);
> +#if 0 /* Don't bother verifying validity of host names */
> if (strspn(host, valid_hostname_chars) != strlen(host)) {
> debug(23, 1) ("urlParse: Illegal character in hostname '%s'\n", host);
> return NULL;
> }
> +#endif
> /* remove trailing dots from hostnames */
> while ((l = strlen(host)) > 0 && host[--l] == '.')
> host[l] = '\0';
Received on Wed Oct 20 1999 - 06:36:08 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:49:00 MST