]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
change HTCP vs ICP configuration to be a cache_peer flag instead of
authorwessels <>
Sat, 28 Mar 1998 13:26:42 +0000 (13:26 +0000)
committerwessels <>
Sat, 28 Mar 1998 13:26:42 +0000 (13:26 +0000)
separate port members

src/cache_cf.cc
src/enums.h
src/neighbors.cc
src/structs.h

index f475e59f4bb2a8a1a67f88c975b0749fc87e7083..9c071ab5747c005454b868732f9c895c6e035856 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.265 1998/03/28 05:26:08 wessels Exp $
+ * $Id: cache_cf.cc,v 1.266 1998/03/28 06:26:42 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -653,7 +653,6 @@ parse_peer(peer ** head)
     int i;
     ushortlist *u;
     const char *me = null_string;      /* XXX */
-    char *t;
     p = xcalloc(1, sizeof(peer));
     p->http_port = CACHE_HTTP_PORT;
     p->icp_port = CACHE_ICP_PORT;
@@ -667,16 +666,8 @@ parse_peer(peer ** head)
     p->type = parseNeighborType(token);
     GetInteger(i);
     p->http_port = (u_short) i;
-    if ((token = strtok(NULL, w_space)) == NULL)
-       self_destruct();
-    if (NULL == (t = strchr(token, '/')))
-       p->icp_port = atoi(token);
-    else if (0 == strcmp(t, "/icp"))
-       p->icp_port = atoi(token);
-    else if (0 == strcmp(t, "/htcp"))
-       p->htcp_port = atoi(token);
-    else
-       self_destruct();
+    GetInteger(i);
+    p->icp_port = (u_short) i;
     if (strcmp(p->host, me) == 0) {
        for (u = Config.Port.http; u; u = u->next) {
            if (p->http_port != u->i)
@@ -707,6 +698,8 @@ parse_peer(peer ** head)
            EBIT_SET(p->options, NEIGHBOR_DEFAULT_PARENT);
        } else if (!strncasecmp(token, "round-robin", 11)) {
            EBIT_SET(p->options, NEIGHBOR_ROUNDROBIN);
+       } else if (!strncasecmp(token, "htcp", 4)) {
+           EBIT_SET(p->options, NEIGHBOR_HTCP);
        } else {
            debug(3, 0) ("parse_peer: token='%s'\n", token);
            self_destruct();
index 23d48ad69a28bd724ea1f0d0f934ce2325377875..bb77b03d831f14149681afef94da41cd4df0ac49 100644 (file)
@@ -437,7 +437,8 @@ enum {
     NEIGHBOR_DEFAULT_PARENT,
     NEIGHBOR_ROUNDROBIN,
     NEIGHBOR_MCAST_RESPONDER,
-    NEIGHBOR_CLOSEST_ONLY
+    NEIGHBOR_CLOSEST_ONLY,
+    NEIGHBOR_HTCP
 };
 
 typedef enum {
index 9a6b9a5c10ad086846a33c84d3f5ce6565aba787..dee27758551c864efc561d7367ea289e34f50f50 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.184 1998/03/28 05:28:54 wessels Exp $
+ * $Id: neighbors.cc,v 1.185 1998/03/28 06:26:44 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -442,7 +442,7 @@ neighborsUdpPing(request_t * request,
        debug(15, 3) ("neighborsUdpPing: key = '%s'\n", storeKeyText(entry->key));
        debug(15, 3) ("neighborsUdpPing: reqnum = %d\n", reqnum);
 
-       if (p->htcp_port > 0) {
+       if (EBIT_TEST(p->options, NEIGHBOR_HTCP)) {
            debug(15, 0)("neighborsUdpPing: sending HTCP query\n");
            htcpQuery(entry, request, p);
        } else if (p->icp_port == echo_port) {
@@ -1005,6 +1005,8 @@ dump_peer_options(StoreEntry * sentry, peer * p)
        storeAppendPrintf(sentry, " multicast-responder");
     if (EBIT_TEST(p->options, NEIGHBOR_CLOSEST_ONLY))
        storeAppendPrintf(sentry, " closest-only");
+    if (EBIT_TEST(p->options, NEIGHBOR_HTCP))
+       storeAppendPrintf(sentry, " htcp");
     if (p->mcast.ttl > 0)
        storeAppendPrintf(sentry, " ttl=%d", p->mcast.ttl);
     storeAppendPrintf(sentry, "\n");
index 5d584d06e3a23528ba33d0980ceb3cb58dd907b8..8c335ee6fad357e5b38965c033231b2dddb82ed7 100644 (file)
@@ -775,9 +775,6 @@ struct _peer {
        int logged_state;       /* so we can print dead/revived msgs */
     } stats;
     u_short icp_port;
-#if USE_HTCP
-    u_short htcp_port;
-#endif
     u_short http_port;
     int icp_version;
     struct _domain_ping *pinglist;