-/* $Id: cache_cf.cc,v 1.10 1996/03/29 21:14:32 wessels Exp $ */
+/* $Id: cache_cf.cc,v 1.11 1996/04/04 04:33:09 wessels Exp $ */
/* DEBUG: Section 3 cache_cf: Configuration file parsing */
char *debugOptions;
char *pidFilename;
char *visibleHostname;
+ char *ftpUser;
} Config;
#define DefaultMemMaxSize (16 << 20) /* 16 MB */
#define DefaultSingleParentBypass 0 /* default off */
#define DefaultPidFilename (char *)NULL /* default NONE */
#define DefaultVisibleHostname (char *)NULL /* default NONE */
+#define DefaultFtpUser "cached@" /* Default without domain */
extern char *config_file;
Config.visibleHostname = xstrdup(token);
}
+static void parseFtpUserLine(line_in)
+ char *line_in;
+{
+ char *token;
+ token = strtok(NULL, w_space);
+ safe_free(Config.ftpUser);
+ if (token == (char *) NULL)
+ self_destruct(line_in);
+ Config.ftpUser = xstrdup(token);
+}
+
int parseConfigFile(file_name)
char *file_name;
{
else if (!strcmp(token, "visible_hostname"))
parseVisibleHostnameLine(line_in);
+ else if (!strcmp(token, "ftp_user"))
+ parseFtpUserLine(line_in);
+
/* If unknown, treat as a comment line */
else {
/* EMPTY */ ;
{
return Config.visibleHostname;
}
+char *getFtpUser()
+{
+ return Config.ftpUser;
+}
int setAsciiPortNum(p)
int p;
Config.Accel.withProxy = DefaultAccelWithProxy;
Config.pidFilename = safe_xstrdup(DefaultPidFilename);
Config.visibleHostname = safe_xstrdup(DefaultVisibleHostname);
+ Config.ftpUser = safe_xstrdup(DefaultFtpUser);
}
static void configDoConfigure()
-/* $Id: ftp.cc,v 1.18 1996/04/04 01:30:43 wessels Exp $ */
+/* $Id: ftp.cc,v 1.19 1996/04/04 04:33:11 wessels Exp $ */
/*
* DEBUG: Section 9 ftp: FTP
if (t < 3) {
strcpy(host, user); /* no login/passwd information */
strcpy(user, "anonymous");
- strcpy(password, "harvest@");
+ strcpy(password, getFtpUser());
}
/* we need to convert user and password for URL encodings */
tmp = url_convert_hex(user);