RE: Limited cache_dir entries? (fwd)

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 11 Feb 2005 02:42:34 +0100 (CET)

---------- Forwarded message ----------
Date: Fri, 11 Feb 2005 11:11:12 +1100
From: "Liapis, Sam (Melb, Aust)" <Sam.Liapis@global360.com.au>
To: 'Henrik Nordstrom' <hno@squid-cache.org>
Subject: RE: Limited cache_dir entries?

Thanks for the speedy response and feedback Henrik.

Regards,
Sam Liapis.
(Melbourne, Australia)

-----Original Message-----
From: Henrik Nordstrom [mailto:hno@squid-cache.org]
Sent: Wednesday, February 09, 2005 7:48 PM
To: Liapis, Sam (Melb, Aust)
Cc: Squid Developers
Subject: Re: Limited cache_dir entries?

On Wed, 9 Feb 2005, Liapis, Sam (Melb, Aust) wrote:

> Hence the comment appended to the line where the assert occured inside of
> cache_cf.c:
>
> 1285 assert(swap->n_configured < 63); /* 7 bits, signed */
>
> I understand 7 bits signed provides a permissible range of +64 to -64.
> That being the case this test could be altered to <= to permit the 64th
> cache_dir to be accepted in the squid.conf parse. Would this seems the
> case to you? (Note: swap->n_configured is incremented after this line).

a 7-bit unsigned allows for -64 to +63, but you are right the code should
accept 64 cache_dirs (dir # 0 to 63 == 64 directories), not 63. The
swap->n_configured is a full integer, it's only the SIO where the
directory number is 7 bits.

In addition, if you need more it shouldn't be too hard to change swap_dirn
to be an unsigned variable, allowing for 127 cache_dirs. The only reason
why it's signed is to allow for -1 meaning "no cache dir" and there is
only two lines in the code looking for -1, both in swap.c.

Regards
Henrik

_____________________________________________________________________
This e-mail has been scanned for viruses by MessageLabs.
For further information contact - postmaster@global360.com.au
Received on Thu Feb 10 2005 - 18:42:36 MST

This archive was generated by hypermail pre-2.1.9 : Fri Feb 25 2005 - 12:00:03 MST