Re: Specifying a Proxied URL on the CERN Server

Ari Luotonen (luotonen@neon.mcom.com)
Tue, 6 Dec 1994 10:45:32 +0100

Date: Tue, 6 Dec 1994 10:45:32 +0100
Message-Id: <199412060945.JAA02389@neon.mcom.com>
From: Ari Luotonen <luotonen@neon.mcom.com>
To: Multiple recipients of list <www-proxy@www0.cern.ch>
Subject: Re: Specifying a Proxied URL on the CERN Server

> If you have the source, it's very easy to fix though; in 3.0 version,
> in WWW/Daemon/Implementation/HTDaemon.c:1742 you have the line;
>
> if (cc.cache_root && !req->authorization && !HTReqArgKeywords &&
>
> Remove the !HTReqArgKeywords from the if condition:
>
> if (cc.cache_root && !req->authorization &&
>
> If your queries are relatively simple you won't have a problem.
> However, if they are very complex and long (e.g. like WAIS URLs) the
> filesystem underneath may make it break, which is the reason CERN
> doesn't do it in the first place.

..and while I was going thru the code finding the way to fix this
problem, I noticed that there's a couple of other fixes you need to do
in HTCache.c, too: there's another check in HTCache.c:251:

if (!url || strchr(url, '?') || (res = reserved_name(url)) ||

that should then read:

if (!url || (res = reserved_name(url)) ||

And then later when you allocate room for "cfn" variable you should
add (HTArgKeywords ? strlen(HTArgKeywords) + 1 : 0), and then later
after the sprintf() statement concatenate "?" and HTArgKeywords, if
HTArgKeywords != NULL.

So while you are in that function, cache_file_name(), you could fix it
so that it somehow alleviates the problem with long queries, for
example, if you know that your queries will contain a bunch of equal
signs, or other known characters, you could use those to chop the
query into parts, and add '/' characters after them, or replace those
chars with '/' if there's no risk of ambiguity or whatever.

Boy, it wasn't as easy as I thought, now was it... Sorry about the
code quotes...

-- Cheers, Ari --