Re: Direct

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 26 Mar 1999 02:25:43 +0100

Haydn Chandler wrote:

> When ever i try to put more then one "cache_peer" entry, squid does not
> force anything through a parent, rather it tries to make a DIRECT connection.

This is a limitation of Squid 2.1 which I was previously unaware of.
Non-ICP peers are only selected if there only is one peer available
(SINGLE_PARENT), or if never_direct is in effect. Patch is attached.

---
Henrik Nordstrom
Spare time Squid hacker

Index: squid/src/peer_select.c
===================================================================
RCS file: /usr/src/CVS/squid/src/peer_select.c,v
retrieving revision 1.1.1.24
diff -u -w -r1.1.1.24 peer_select.c
--- peer_select.c 1998/11/13 22:27:49 1.1.1.24
+++ peer_select.c 1999/03/26 01:22:50
@@ -384,15 +384,15 @@
         debug(44, 3) ("peerSelect: %s/%s\n", hier_strings[code], p->host);
         hierarchyNote(&request->hier, code, &psstate->ping, p->host);
         peerSelectCallback(psstate, p);
+ } else if ((p = peerGetSomeParent(request, &code))) {
+ debug(44, 3) ("peerSelect: %s/%s\n", hier_strings[code], p->host);
+ hierarchyNote(&request->hier, code, &psstate->ping, p->host);
+ peerSelectCallback(psstate, p);
     } else if (direct != DIRECT_NO) {
         code = DIRECT;
         debug(44, 3) ("peerSelect: %s/%s\n", hier_strings[code], request->host);
         hierarchyNote(&request->hier, code, &psstate->ping, request->host);
         peerSelectCallback(psstate, NULL);
- } else if ((p = peerGetSomeParent(request, &code))) {
- debug(44, 3) ("peerSelect: %s/%s\n", hier_strings[code], p->host);
- hierarchyNote(&request->hier, code, &psstate->ping, p->host);
- peerSelectCallback(psstate, p);
     } else {
         code = NO_DIRECT_FAIL;
         hierarchyNote(&request->hier, code, &psstate->ping, NULL);
Received on Thu Mar 25 1999 - 18:57:48 MST

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