]> git.ipfire.org Git - thirdparty/squid.git/commit - src/carp.cc
A number of CARP bug fixes.
authorwessels <>
Tue, 5 Dec 2000 17:10:57 +0000 (17:10 +0000)
committerwessels <>
Tue, 5 Dec 2000 17:10:57 +0000 (17:10 +0000)
commit8ee9b49f341045275e07665b7e52f92c06676c00
treef520672cb14c294b11c465c76c74ad34f94fa3bf
parent11ba72dc0c42707aeaae52d2110438a1eda8546a
A number of CARP bug fixes.

peer->carp.hash was an unsigned long, but the spec requires 32-bit math
on integers.  Since longs are known to sometimes be 64-bits, its safer
to use unsigned int.

peer->carp.load_factor was a float, but its better to use double to
be consistent with other floating point functions and variables.

In parse_peer() I'm concerned that *token could be signed, so its
now casted to unsigned int.

In parse_peer() there is a bug in calculating the proxy hostname hash.
On the final ROTATE_LEFT, it should be "=" rather than "+=".

In carpInit() pay special attention to int/double conversion bugs
and passing ints to functions that expect doubles.

In carpInit() there is a bug with the value of "k".  In the loop,
k needs to be incremented *before* its used.  The internet-draft
begins with k=1, so the first time through the loop k should equal 2.

Added "carp" to cache manager for info and debugging.

I think there are still two bugs: (1) the draft says the multipliers
must be calculated in order of smallest to largest factor.  We don't
do that yet. (2) the 'score' calculation needs to be converted to
double when we multiply by the multiplier.  Otherwise there will
be overflows since the multiplier can be greater than 1.
src/cache_cf.cc
src/carp.cc
src/structs.h