One more item with the 1.1.20-retry patches...

From: Michael Pelletier <mikep@dont-contact.us>
Date: Wed, 25 Feb 1998 12:19:40 -0500 (EST)

Another user noticed a difference between the non-ifdef and the ifdef
patches, in ipcache.c, in the ipcacheCycleAddr() function. This
difference is that there is a line similar to the original ipcache.c
ipcacheCycleAddr() function:

        if (++i->addrs.cur == i->addrs.count) i->addrs.cur = 0;

before it goes through to check for bad addresses.

This change was intentional, because the previous behaviour was that Squid
would use the same IP address out of a multi-address host's address list
over and over again until it was marked bad, rather than actually cycling
to the next-OK address. This has been like this since the beginning. It
probably came about due to a change in where the increment of ia->cur was
taking place -- notice the comment on the function describes the desired
behavior, rather than the actual behaviour. You may notice that all your
bad addresses are at the beginning of the list on the IPcache contents
display.

The new ifdef'd patch takes the opportunity to fix this minor problem, by
clicking over to the next address in the list before entering the while
loop. If the next address is bad, the while loop will execute and select
the next good address. If the next address is good, the while loop won't
execute and the pointer will be at the next address in the list, so that
eventually all the good addresses in the list will be used for requests.
Which is how it should have worked in the first place.

        -Mike Pelletier.
Received on Wed Feb 25 1998 - 09:23:39 MST

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