Re: Re : Re: about peerGetSomeParent()

From: Henrik Nordstrom <hno@dont-contact.us>
Date: 19 Mar 2003 12:56:09 +0100

peerGetAllParent is only used if never_direct is true (DIRECT_NEVER).
It then adds all your parents as secondary paths after the selected
parent, in case the selected parent does not really work.

The reason to this is that when never_direct is true Squid MUST NOT go
direct. Because of this we want Squid to automatically retry on your
other parents if you have more than one and the parent Squid first
selected did not work.

Regards
Henrik

ons 2003-03-19 klockan 17.26 skrev atit_ldce:
> Mr. Henrik
> thanks for reply
> I got yr point.
>
> but if we have parent in functin peergetSomeParent()
> we have added it to the forward server list...
> flow backs to peerSelectFoo()
> and from here we call peerGetAllParent()
> i think call of peerGetAllParent() is unneccesary()
> does it true?
> or it servers some other purpose?
>
> regards
> atit jariwala
>
> ----- Original Message -----
> From: Henrik Nordstrom <hno@squid-cache.org>
> To: atit_ldce <atit_ldce@icenet.net>
> Cc: squid-dev@squid-cache.org
> Sent: Wed Mar 19 13:56:58 GMT+05:30 2003
> Subject: Re: about peerGetSomeParent()
>
>
> atit_ldce wrote:
> >
> > i have confusion in following code...
> >
> > if ((p = getDefaultParent(request))) {
> > code = DEFAULT_PARENT;
> > } else if ((p = getRoundRobinParent(request))) {
> > code = ROUNDROBIN_PARENT;
> > } else if ((p = getFirstUpParent(request))) {
> > code = FIRSTUP_PARENT;
> > } else if ((p = getAnyParent(request))) {
> > code = ANY_OLD_PARENT;
> > }
> > if (code != HIER_NONE) {
> > debug(44, 3) ("peerSelect: %s/%s\n", hier_strings[code], p->host);
> > peerAddFwdServer(&ps->servers, p, code);
> > }
> >
> > stmt p = getDefaultParent(request) are assignment stmt
> > so outcome of if cond is definately 0
>
> The if is a long chain of if ... else if ... else if ... else if ...,
> and the order of the ifs tell the priority of these different parent
> selection algorithms.
>
> 1. default (by cache_peer default option)
> 2. round-tobin (by cache_peer round-robin option)
> 3. first alive parent (by order of your cache_peer lines)
> 4. any parent
>
> I don't think 4 ever happens in the current code.
>
>
> > in this case
> > code will be HIER_NONE.
> >
> > does it indicate error in code or it has any other purpose?
>
> HIER_NONE here just indicates that no parent has been selected.
>
> Regards
> Henrik
>
>
>
> _____________________________________________________________________
> Get your internet connection from the fastest growing digital network.
> ICENET
> visit our site www.icenet.net

-- 
Henrik Nordstrom <hno@squid-cache.org>
MARA Systems AB, Sweden
Received on Wed Mar 19 2003 - 04:56:24 MST

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