ftpget will be disabled for http_accel-only mode.
/*
- * $Id: cache_cf.cc,v 1.108 1996/10/10 18:48:47 wessels Exp $
+ * $Id: cache_cf.cc,v 1.109 1996/10/15 16:40:04 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
else if (!strcmp(token, "cache_ftp_program"))
parseFtpProgramLine();
+ else if (!strcmp(token, "ftpget_program"))
+ parseFtpProgramLine();
else if (!strcmp(token, "cache_ftp_options"))
parseFtpOptionsLine();
+ else if (!strcmp(token, "ftpget_options"))
+ parseFtpOptionsLine();
else if (!strcmp(token, "cache_dns_program"))
parseDnsProgramLine();
Config.cleanRate = 86400 * 365; /* one year */
if (Config.Announce.rate < 1)
Config.Announce.rate = 86400 * 365; /* one year */
+ if (Config.dnsChildren < 0)
+ Config.dnsChildren = 0;
if (Config.dnsChildren < 1) {
- printf("WARNING: dns_children was set to a bad value: %d\n",
- Config.dnsChildren);
- Config.dnsChildren = DefaultDnsChildren;
- printf("Setting it to the default (%d).\n", DefaultDnsChildren);
+ printf("WARNING: dnsservers are disabled!\n");
+ printf("WARNING: Cache performance may be very poor\n");
} else if (Config.dnsChildren > DefaultDnsChildrenMax) {
printf("WARNING: dns_children was set to a bad value: %d\n",
Config.dnsChildren);
printf("Setting it to the maximum (%d).\n", DefaultDnsChildrenMax);
Config.dnsChildren = DefaultDnsChildrenMax;
}
- if (Config.redirectChildren < 1) {
- printf("WARNING: redirect_children was set to a bad value: %d\n",
- Config.redirectChildren);
- Config.redirectChildren = DefaultRedirectChildren;
- printf("Setting it to the default (%d).\n", DefaultRedirectChildren);
- } else if (Config.redirectChildren > DefaultRedirectChildrenMax) {
- printf("WARNING: redirect_children was set to a bad value: %d\n",
- Config.redirectChildren);
- printf("Setting it to the maximum (%d).\n", DefaultRedirectChildrenMax);
- Config.redirectChildren = DefaultRedirectChildrenMax;
+ if (Config.program.redirect) {
+ if (Config.redirectChildren < 1) {
+ Config.redirectChildren = 0;
+ safe_free(Config.program.redirect);
+ } else if (Config.redirectChildren > DefaultRedirectChildrenMax) {
+ printf("WARNING: redirect_children was set to a bad value: %d\n",
+ Config.redirectChildren);
+ printf("Setting it to the maximum (%d).\n", DefaultRedirectChildrenMax);
+ Config.redirectChildren = DefaultRedirectChildrenMax;
+ }
}
fclose(fp);
-
configDoConfigure();
return 0;
}
if (Config.errHtmlText == NULL)
Config.errHtmlText = xstrdup(null_string);
storeConfigure();
+ if (httpd_accel_mode && !Config.Accel.withProxy) {
+ safe_free(Config.program.ftpget);
+ Config.program.ftpget = xstrdup("none");
+ }
}
/*
- * $Id: errorpage.cc,v 1.44 1996/10/09 15:34:25 wessels Exp $
+ * $Id: errorpage.cc,v 1.45 1996/10/15 16:40:05 wessels Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
{"ERR_ZERO_SIZE_OBJECT",
"No Object Data",
"The remote server closed the connection before sending any data."},
+ {"ERR_FTP_DISABLED",
+ "FTP is disabled",
+ "This cache is configured to NOT retrieve FTP objects."},
{"ERR_PROXY_DENIED",
"Access Denied",
"You must authenticate yourself before accessing this cache."}
/*
- * $Id: ftp.cc,v 1.65 1996/10/13 06:19:44 wessels Exp $
+ * $Id: ftp.cc,v 1.66 1996/10/15 16:40:06 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
debug(9, 3, "FtpStart: FD %d <URL:%s>\n", unusedfd, url);
+ if (ftpget_server_write < 0) {
+ squid_error_entry(entry, ERR_FTP_DISABLED, NULL);
+ return COMM_ERROR;
+ }
+
ftpData = xcalloc(1, sizeof(FtpStateData));
storeLockObject(ftpData->entry = entry, NULL, NULL);
ftpData->request = requestLink(request);
if (squid_curtime - last_restart < 2) {
debug(9, 0, "ftpget server failing too rapidly\n");
debug(9, 0, "WARNING: FTP access is disabled!\n");
+ ftpget_server_write = -1;
+ ftpget_server_read = -1;
return;
}
last_restart = squid_curtime;
int len;
struct timeval slp;
+ if (!strcmp(ftpget, "none")) {
+ debug(9, 1, "ftpInitialize: ftpget is disabled.\n");
+ return -1;
+ }
debug(9, 5, "ftpInitialize: Initializing...\n");
if (pipe(squid_to_ftpget) < 0) {
debug(9, 0, "ftpInitialize: pipe: %s\n", xstrerror());
/*
- * $Id: ipcache.cc,v 1.71 1996/10/11 23:11:15 wessels Exp $
+ * $Id: ipcache.cc,v 1.72 1996/10/15 16:40:09 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
static long ipcache_low = 180;
static long ipcache_high = 200;
+#if LIBRESOLV_DNS_TTL_HACK
+extern int _dns_ttl_;
+#endif
+
static void
ipcacheEnqueue(ipcache_entry * i)
{
i = ipcache_get(name);
i->lastref = squid_curtime;
i->expires = squid_curtime + Config.positiveDnsTtl;
+#if LIBRESOLV_DNS_TTL_HACK
+ if (_dns_ttl_ > -1)
+ i->expires = squid_curtime + _dns_ttl_;
+#endif /* LIBRESOLV_DNS_TTL_HACK */
return &i->addrs;
}
/* bad address, negative cached */
/*
- * $Id: neighbors.cc,v 1.65 1996/10/15 04:57:54 wessels Exp $
+ * $Id: neighbors.cc,v 1.66 1996/10/15 16:40:09 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
E = &friends->edges_head;
next = friends->edges_head;
while ((e = next)) {
+ getCurrentTime();
next = e->next;
debug(15, 2, "Finding IP addresses for '%s'\n", e->host);
if ((ia = ipcache_gethostbyname(e->host, IP_BLOCKING_LOOKUP)) == NULL) {