-/* $Id: cache_cf.cc,v 1.19 1996/04/05 21:51:45 wessels Exp $ */
+/* $Id: cache_cf.cc,v 1.20 1996/04/06 00:53:03 wessels Exp $ */
/* DEBUG: Section 3 cache_cf: Configuration file parsing */
int ageMaxDefault;
int cleanRate;
int dnsChildren;
+ int maxRequestSize;
double hotVmFactor;
struct {
int ascii;
#define DefaultCleanRate -1 /* disabled */
#define DefaultDnsChildren 5 /* 3 processes */
#define DefaultDnsChildrenMax 32 /* 32 processes */
+#define DefaultMaxRequestSize (102400) /* 100Kb */
#define DefaultHotVmFactor 0.0 /* disabled */
#define DefaultAsciiPortNum CACHE_HTTP_PORT
ip_acl *list;
{
static struct in_addr localhost =
- {0};
+ {}; /* Initialized to all zero */
ip_acl *p = NULL;
struct in_addr naddr; /* network byte-order IP addr */
Config.dnsChildren = i;
}
+static void parseRequestSizeLine(line_in)
+ char *line_in;
+{
+ char *token;
+ int i;
+ GetInteger(i);
+ Config.maxRequestSize = i * 1024;
+}
+
static void parseMgrLine(line_in)
char *line_in;
{
else if (!strcmp(token, "client_lifetime"))
parseLifetimeLine(line_in);
+ /* Parse a request_size line */
+ else if (!strcmp(token, "request_size"))
+ parseRequestSizeLine(line_in);
+
/* Parse a connect_timeout line */
else if (!strcmp(token, "connect_timeout"))
parseConnectTimeout(line_in);
{
return Config.lifetimeDefault;
}
+int getMaxRequestSize()
+{
+ return Config.maxRequestSize;
+}
int getConnectTimeout()
{
return Config.connectTimeout;
Config.negativeTtl = DefaultNegativeTtl;
Config.readTimeout = DefaultReadTimeout;
Config.lifetimeDefault = DefaultLifetimeDefault;
+ Config.maxRequestSize = DefaultMaxRequestSize;
Config.connectTimeout = DefaultConnectTimeout;
Config.ageMaxDefault = DefaultDefaultAgeMax;
Config.cleanRate = DefaultCleanRate;
-/* $Id: errorpage.cc,v 1.14 1996/04/05 23:21:11 wessels Exp $ */
+/* $Id: errorpage.cc,v 1.15 1996/04/06 00:53:05 wessels Exp $ */
/* DEBUG: Section 4 cached_error: Error printing routines */
int log_errors = 1;
-void errorInitialize() {
- tmp_error_buf = (char *) xmalloc(MAX_URL * 4);
- tbuf = (char *) xmalloc(MAX_URL * 3);
+void errorInitialize()
+{
+ tmp_error_buf = (char *) xmalloc(MAX_URL * 4);
+ tbuf = (char *) xmalloc(MAX_URL * 3);
}
-/* $Id: neighbors.cc,v 1.9 1996/04/04 01:30:49 wessels Exp $ */
+/* $Id: neighbors.cc,v 1.10 1996/04/06 00:53:06 wessels Exp $ */
/*
* DEBUG: Section 15 neighbors:
header->opcode, header->version, header->shostid,
header->length, header->reqnum);
debug(15, 6, " from: fam=%d, port=%d, addr=0x%x\n",
- from->sin_family, from->sin_port, from->sin_addr.s_addr);
+ ntohs(from->sin_family),
+ ntohs(from->sin_port),
+ ntohl(from->sin_addr.s_addr));
/* look up for neighbor/parent entry */
e = whichEdge(header, from);