]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Unified peer selection algorithm
authorwessels <>
Wed, 26 Feb 1997 02:18:18 +0000 (02:18 +0000)
committerwessels <>
Wed, 26 Feb 1997 02:18:18 +0000 (02:18 +0000)
ChangeLog
src/Makefile.in
src/neighbors.cc
src/squid.h
src/ssl.cc
src/tunnel.cc

index cbdebff6eeee16310a84fabe8cb053baa5080c51..833e97223f008a2aafcd18782f09c2cf1113d71f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
-Changes to squid-1.1.7 (February @@@, 1997):
+Changes to squid-1.2.alpha1 ():
+
+       - Unified peer selection algorithm.
+
+Changes to squid-1.1.7 (February 25 1997):
 
        - Fixed urlParse to leave trailing slashes on FTP URLs.  Although
          stripping the slashes offers a slight hit rate increase, it
index 94d515ce93d8f53f5d2c865229f77195d3825906..2bbdbb6b5d60f7250984650396e25bc7b8442053 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.65 1997/02/20 23:54:13 wessels Exp $
+#  $Id: Makefile.in,v 1.66 1997/02/25 19:18:19 wessels Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -101,6 +101,7 @@ OBJS                = \
                net_db.o \
                objcache.o \
                pass.o \
+               peer_select.o \
                proto.o \
                redirect.o \
                refresh.o \
index fab1047772131058e7b0cd7889cf3046f3f43bf8..dd092dfa4d9fe7c35bf8541d371e014131de020d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: neighbors.cc,v 1.122 1997/02/25 16:09:12 wessels Exp $
+ * $Id: neighbors.cc,v 1.123 1997/02/25 19:18:21 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -433,12 +433,10 @@ neighbors_open(int fd)
 }
 
 int
-neighborsUdpPing(protodispatch_data * proto)
+neighborsUdpPing(request_t *request, StoreEntry *entry)
 {
-    request_t *request = proto->request;
     char *host = request->host;
-    char *url = proto->url;
-    StoreEntry *entry = proto->entry;
+    char *url = entry->url;
     const ipcache_addrs *ia = NULL;
     struct sockaddr_in to_addr;
     peer *e = NULL;
@@ -532,7 +530,7 @@ neighborsUdpPing(protodispatch_data * proto)
 
     /* only do source_ping if we have neighbors */
     if (Peers.n) {
-       if (!proto->source_ping) {
+       if (Config.sourcePing) {
            debug(15, 6, "neighborsUdpPing: Source Ping is disabled.\n");
        } else if ((ia = ipcache_gethostbyname(host, IP_BLOCKING_LOOKUP))) {
            debug(15, 6, "neighborsUdpPing: Source Ping: to %s for '%s'\n",
index f954bd1276dcae91ea799bd76fb87973e9e0ec2d..b169f30cb0fd06b974c8221f2feca08e321a2baf 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.95 1997/02/23 09:02:21 wessels Exp $
+ * $Id: squid.h,v 1.96 1997/02/25 19:18:24 wessels Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -300,6 +300,7 @@ typedef int (*QS) (const void *, const void *);
 #include "client_db.h"
 #include "objcache.h"
 #include "refresh.h"
+#include "peer_select.h"
 
 #if !HAVE_TEMPNAM
 #include "tempnam.h"
index 11c0ab50879e284db46a87f9c4433bb008142308..db3d1099a8272f8f63a95552d47a052da081ae24 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.cc,v 1.38 1997/02/19 23:53:43 wessels Exp $
+ * $Id: ssl.cc,v 1.39 1997/02/25 19:18:24 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -491,23 +491,11 @@ sslSelectNeighbor(int fd, const ipcache_addrs * ia, void *data)
     request_t *request = sslState->request;
     peer *e = NULL;
     peer *g = NULL;
-    int fw_ip_match = IP_ALLOW;
-    if (ia && Config.firewall_ip_list)
-       fw_ip_match = ip_access_check(ia->in_addrs[ia->cur], Config.firewall_ip_list);
-    if (matchInsideFirewall(request->host)) {
+    hier_code code;
+    if (peerSelectDirect(request)) {
        hierarchyNote(request, HIER_DIRECT, 0, request->host);
-    } else if (fw_ip_match == IP_DENY) {
-       hierarchyNote(request, HIER_FIREWALL_IP_DIRECT, 0, request->host);
-    } else if ((e = Config.sslProxy)) {
-       hierarchyNote(request, HIER_SSL_PARENT, 0, e->host);
-    } else if ((e = getDefaultParent(request))) {
-       hierarchyNote(request, HIER_DEFAULT_PARENT, 0, e->host);
-    } else if ((e = getSingleParent(request))) {
-       hierarchyNote(request, HIER_SINGLE_PARENT, 0, e->host);
-    } else if ((e = getRoundRobinParent(request))) {
-       hierarchyNote(request, HIER_ROUNDROBIN_PARENT, 0, e->host);
-    } else if ((e = getFirstUpParent(request))) {
-       hierarchyNote(request, HIER_FIRSTUP_PARENT, 0, e->host);
+    } else if ((e = peerGetSomeParent(request, &code))) {
+       hierarchyNote(request, code, 0, e->host);
     } else {
        hierarchyNote(request, HIER_DIRECT, 0, request->host);
     }
index 3c438afe8e333bfcf4b077309483b4ac9c2c43d3..c2fd528d110ab4a51a7f7deafb413cf5feeaa67d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.38 1997/02/19 23:53:43 wessels Exp $
+ * $Id: tunnel.cc,v 1.39 1997/02/25 19:18:24 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -491,23 +491,11 @@ sslSelectNeighbor(int fd, const ipcache_addrs * ia, void *data)
     request_t *request = sslState->request;
     peer *e = NULL;
     peer *g = NULL;
-    int fw_ip_match = IP_ALLOW;
-    if (ia && Config.firewall_ip_list)
-       fw_ip_match = ip_access_check(ia->in_addrs[ia->cur], Config.firewall_ip_list);
-    if (matchInsideFirewall(request->host)) {
+    hier_code code;
+    if (peerSelectDirect(request)) {
        hierarchyNote(request, HIER_DIRECT, 0, request->host);
-    } else if (fw_ip_match == IP_DENY) {
-       hierarchyNote(request, HIER_FIREWALL_IP_DIRECT, 0, request->host);
-    } else if ((e = Config.sslProxy)) {
-       hierarchyNote(request, HIER_SSL_PARENT, 0, e->host);
-    } else if ((e = getDefaultParent(request))) {
-       hierarchyNote(request, HIER_DEFAULT_PARENT, 0, e->host);
-    } else if ((e = getSingleParent(request))) {
-       hierarchyNote(request, HIER_SINGLE_PARENT, 0, e->host);
-    } else if ((e = getRoundRobinParent(request))) {
-       hierarchyNote(request, HIER_ROUNDROBIN_PARENT, 0, e->host);
-    } else if ((e = getFirstUpParent(request))) {
-       hierarchyNote(request, HIER_FIRSTUP_PARENT, 0, e->host);
+    } else if ((e = peerGetSomeParent(request, &code))) {
+       hierarchyNote(request, code, 0, e->host);
     } else {
        hierarchyNote(request, HIER_DIRECT, 0, request->host);
     }