]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
parse HTCP port on cache_peer line as '4287/htcp'
authorwessels <>
Sat, 28 Mar 1998 12:26:08 +0000 (12:26 +0000)
committerwessels <>
Sat, 28 Mar 1998 12:26:08 +0000 (12:26 +0000)
src/cache_cf.cc

index f3a36376e635c78acb3bd0d6751def4757643e04..f475e59f4bb2a8a1a67f88c975b0749fc87e7083 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.264 1998/03/27 18:41:13 wessels Exp $
+ * $Id: cache_cf.cc,v 1.265 1998/03/28 05:26:08 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -653,6 +653,7 @@ 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;
@@ -666,8 +667,16 @@ parse_peer(peer ** head)
     p->type = parseNeighborType(token);
     GetInteger(i);
     p->http_port = (u_short) i;
-    GetInteger(i);
-    p->icp_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();
     if (strcmp(p->host, me) == 0) {
        for (u = Config.Port.http; u; u = u->next) {
            if (p->http_port != u->i)