Re: digest only peering?

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Mon, 23 Nov 1998 21:30:00 -0700 (MST)

On Fri, 20 Nov 1998, Allen Smith wrote:

> This isn't at all difficult to do (see the patch below), and if cache
> digest hits did take that much time to calculate they wouldn't be
> worth very much...
>
> diff -Naurd squid-2.1.PATCH1.old/src/forward.c squid-2.1.PATCH1/src/forward.c
> --- squid-2.1.PATCH1.old/src/forward.c Wed Nov 18 12:09:46 1998
> +++ squid-2.1.PATCH1/src/forward.c Fri Nov 20 21:25:48 1998
> @@ -335,6 +335,11 @@
> ch.src_addr = peer_addr;
> ch.request = r;
> answer = aclCheckFast(Config.accessList.miss, &ch);
> +#if USE_CACHE_DIGESTS
> + if (answer == 0) {
> + answer = cacheDigestTest(store_digest, r->canonical);
> + }
> +#endif
> if (answer == 0) {
> err = errorCon(ERR_FORWARDING_DENIED, HTTP_FORBIDDEN);
> err->request = requestLink(r);
>
>

Err.. As far as I can see, you are using request URL to do a digest lookup.
That will not work as digests are built using object "keys", not URLs:
        int cacheDigestTest(const CacheDigest * cd, const cache_key * key);

Perhaps you want to do something like this:

 +#if USE_CACHE_DIGESTS
 + if (answer == 0 && store_digest) {
 + answer = cacheDigestTest(store_digest, e->key);
 + }
 +#endif

Even that is not bullet-proof, but should work in most [reasonable] cases.

Overall, it seems like a useful addition similar to a miss_access option.
Something like "false_hit_access" (serve misses if we are advertising them as
hits)?

        answer = store_digest &&
                cacheDigestTest(store_digest,e->key) &&
                aclCheckFast(Config.accessList.false_hit, &ch);

However, I am certainly not an access control guru.

Any comments?

Alex.
Received on Mon Nov 23 1998 - 21:16:29 MST

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