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
Received on Wed Feb 09 2005 - 01:48:25 MST
This archive was generated by hypermail pre-2.1.9 : Fri Feb 25 2005 - 12:00:03 MST