]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Produce full list of peer options on maybe-direct forwarding case
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 24 Oct 2011 00:18:26 +0000 (13:18 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 24 Oct 2011 00:18:26 +0000 (13:18 +1300)
Now that we are generating the set of possible peers before attempting to
connect.  The retry_on_error directive is no longer repeatedly cycling
through the peer selecting process failing on one peer until that peer
works.

The maybe-direct case seems to have been depending on this behaviour to
locate alternative peers before going DIRECT. The attached patch seeks
to make the maybe-direct case produce a list of all available parents
with the specific algorithm choice first.

src/peer_select.cc

index 52e37f87eafe4c3d5ac1170d2428e3c40089aa78..a4546e2feed1ce055ba51016121b8c5270d94f79 100644 (file)
@@ -435,8 +435,10 @@ peerSelectFoo(ps_state * ps)
         if (Config.onoff.prefer_direct)
             peerGetSomeDirect(ps);
 
-        if (request->flags.hierarchical || !Config.onoff.nonhierarchical_direct)
+        if (request->flags.hierarchical || !Config.onoff.nonhierarchical_direct) {
             peerGetSomeParent(ps);
+            peerGetAllParents(ps);
+        }
 
         if (!Config.onoff.prefer_direct)
             peerGetSomeDirect(ps);