/*
- * $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
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)
}
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
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();
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);
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;
/*
- * $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
"SOURCE_FASTEST",
"SIBLING_UDP_HIT_OBJ",
"PARENT_UDP_HIT_OBJ",
+ "PASSTHROUGH_PARENT",
"INVALID CODE"
};
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));
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);
+}
/*
- * $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
}
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);
sslClientClosed,
(void *) sslState);
- if (Config.sslProxy.host) {
+ if (Config.sslProxy) {
ipcache_nbgethostbyname(request->host,
sslState->server.fd,
sslSelectForwarding,
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;
/*
- * $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
}
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);
sslClientClosed,
(void *) sslState);
- if (Config.sslProxy.host) {
+ if (Config.sslProxy) {
ipcache_nbgethostbyname(request->host,
sslState->server.fd,
sslSelectForwarding,
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;