]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added 'passthrough_proxy' support
authorwessels <>
Tue, 26 Nov 1996 01:47:15 +0000 (01:47 +0000)
committerwessels <>
Tue, 26 Nov 1996 01:47:15 +0000 (01:47 +0000)
src/cache_cf.cc
src/neighbors.cc
src/ssl.cc
src/tunnel.cc

index 0b6c4742f4815b7bbe8c88e70618a1cdb56f3f62..75ceb4a5649d6b3c15ac4e6b1bfeb303949c3880 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cache_cf.cc,v 1.143 1996/11/24 02:37:33 wessels Exp $
+ * $Id: cache_cf.cc,v 1.144 1996/11/25 18:47:15 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -256,6 +256,7 @@ static void parseMinutesLine _PARAMS((int *));
 static void ip_acl_destroy _PARAMS((ip_acl **));
 static void parseCachemgrPasswd _PARAMS((void));
 static void parsePathname _PARAMS((char **));
+static void parseProxyLine _PARAMS((edge **));
 
 static void
 self_destruct(void)
@@ -954,20 +955,25 @@ parseVizHackLine(void)
 }
 
 static void
-parseSslProxyLine(void)
+parseProxyLine(edge **E)
 {
     char *token;
     char *t;
+    edge *e;
     token = strtok(NULL, w_space);
     if (token == NULL)
        self_destruct();
-    safe_free(Config.sslProxy.host);
-    Config.sslProxy.port = 0;
+    if (*E) {
+       edgeDestroy(*E);
+       *E = NULL;
+    }
+    e = xcalloc (1, sizeof(edge));
     if ((t = strchr(token, ':'))) {
        *t++ = '\0';
-       Config.sslProxy.port = atoi(t);
+       e->http_port = atoi(t);
     }
-    Config.sslProxy.host = xstrdup(token);
+    e->host = xstrdup(token);
+    *E = e;
 }
 
 static void
@@ -1310,7 +1316,9 @@ parseConfigFile(const char *file_name)
            parseAnnounceToLine();
 
        else if (!strcmp(token, "ssl_proxy"))
-           parseSslProxyLine();
+           parseProxyLine(&Config.sslProxy);
+       else if (!strcmp(token, "passthrough_proxy"))
+           parseProxyLine(&Config.passProxy);
 
        else if (!strcmp(token, "err_html_text"))
            parseErrHtmlLine();
@@ -1446,7 +1454,8 @@ configFreeMemory(void)
     safe_free(Config.Announce.host);
     safe_free(Config.Announce.file);
     safe_free(Config.errHtmlText);
-    safe_free(Config.sslProxy.host);
+    edgeDestroy(Config.sslProxy);
+    edgeDestroy(Config.passProxy);
     wordlistDestroy(&Config.cache_dirs);
     wordlistDestroy(&Config.hierarchy_stoplist);
     wordlistDestroy(&Config.local_domain_list);
@@ -1544,8 +1553,6 @@ configSetFactoryDefaults(void)
     Config.Addrs.udp_outgoing.s_addr = DefaultUdpOutgoingAddr;
     Config.Addrs.udp_incoming.s_addr = DefaultUdpIncomingAddr;
     Config.Addrs.client_netmask.s_addr = DefaultClientNetmask;
-    Config.sslProxy.port = DefaultSslProxyPort;
-    Config.sslProxy.host = safe_xstrdup(DefaultSslProxyHost);
     Config.ipcache.size = DefaultIpcacheSize;
     Config.ipcache.low = DefaultIpcacheLow;
     Config.ipcache.high = DefaultIpcacheHigh;
index 7501e4f65db55ff60aa528756e3d225fac8e4210..7412f4b834603b000d17ee17828ae90eff6ee336 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: neighbors.cc,v 1.87 1996/11/18 02:25:45 wessels Exp $
+ * $Id: neighbors.cc,v 1.88 1996/11/25 18:47:17 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -143,6 +143,7 @@ const char *hier_strings[] =
     "SOURCE_FASTEST",
     "SIBLING_UDP_HIT_OBJ",
     "PARENT_UDP_HIT_OBJ",
+    "PASSTHROUGH_PARENT",
     "INVALID CODE"
 };
 
@@ -314,8 +315,7 @@ neighborsDestroy(void)
 
     for (e = friends.edges_head; e; e = next) {
        next = e->next;
-       safe_free(e->host);
-       safe_free(e);
+       edgeDestroy(e);
        friends.n--;
     }
     memset(&friends, '\0', sizeof(friends));
@@ -878,3 +878,12 @@ parseNeighborType(const char *s)
     debug(15, 0, "WARNING: Unknown neighbor type: %s\n", s);
     return EDGE_SIBLING;
 }
+
+void
+edgeDestroy(edge *e)
+{
+       if (e == NULL)
+           return;
+       safe_free(e->host);
+       safe_free(e);
+}
index c679cf935842fdc88824071e0dddb2342512a72f..5b265b4bb40eb2afe97777dbb809e1ec394c9cf5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.cc,v 1.27 1996/11/22 08:38:20 wessels Exp $
+ * $Id: ssl.cc,v 1.28 1996/11/25 18:47:19 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -381,7 +381,7 @@ sslConnectDone(int fd, int status, void *data)
     }
     if (opt_no_ipcache)
        ipcacheInvalidate(sslState->host);
-    if (Config.sslProxy.host == sslState->host)
+    if (Config.sslProxy && Config.sslProxy->host == sslState->host)
        sslProxyConnected(sslState->server.fd, sslState);
     else
        sslConnected(sslState->server.fd, sslState);
@@ -441,7 +441,7 @@ sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size
        sslClientClosed,
        (void *) sslState);
 
-    if (Config.sslProxy.host) {
+    if (Config.sslProxy) {
        ipcache_nbgethostbyname(request->host,
            sslState->server.fd,
            sslSelectForwarding,
@@ -508,9 +508,9 @@ sslSelectForwarding(int fd, const ipcache_addrs * ia, void *data)
        sslState->host = request->host;
        sslState->port = request->port;
     } else {
-       sslState->host = Config.sslProxy.host;
-       if ((sslState->port = Config.sslProxy.port) == 0) {
-           if ((e = neighborFindByName(Config.sslProxy.host)))
+       sslState->host = Config.sslProxy->host;
+       if ((sslState->port = Config.sslProxy->http_port) == 0) {
+           if ((e = neighborFindByName(Config.sslProxy->host)))
                sslState->port = e->http_port;
            else
                sslState->port = CACHE_HTTP_PORT;
index 1d925844d405d25e1f704f71e52a9d99dbb4278b..9e9ef8090f6b4f4428d249a8ea20b486628dbfd1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.27 1996/11/22 08:38:20 wessels Exp $
+ * $Id: tunnel.cc,v 1.28 1996/11/25 18:47:19 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -381,7 +381,7 @@ sslConnectDone(int fd, int status, void *data)
     }
     if (opt_no_ipcache)
        ipcacheInvalidate(sslState->host);
-    if (Config.sslProxy.host == sslState->host)
+    if (Config.sslProxy && Config.sslProxy->host == sslState->host)
        sslProxyConnected(sslState->server.fd, sslState);
     else
        sslConnected(sslState->server.fd, sslState);
@@ -441,7 +441,7 @@ sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size
        sslClientClosed,
        (void *) sslState);
 
-    if (Config.sslProxy.host) {
+    if (Config.sslProxy) {
        ipcache_nbgethostbyname(request->host,
            sslState->server.fd,
            sslSelectForwarding,
@@ -508,9 +508,9 @@ sslSelectForwarding(int fd, const ipcache_addrs * ia, void *data)
        sslState->host = request->host;
        sslState->port = request->port;
     } else {
-       sslState->host = Config.sslProxy.host;
-       if ((sslState->port = Config.sslProxy.port) == 0) {
-           if ((e = neighborFindByName(Config.sslProxy.host)))
+       sslState->host = Config.sslProxy->host;
+       if ((sslState->port = Config.sslProxy->http_port) == 0) {
+           if ((e = neighborFindByName(Config.sslProxy->host)))
                sslState->port = e->http_port;
            else
                sslState->port = CACHE_HTTP_PORT;