/*
- * $Id: access_log.cc,v 1.3 1997/07/19 06:12:49 wessels Exp $
+ * $Id: access_log.cc,v 1.4 1997/07/26 04:48:21 wessels Exp $
*
* DEBUG: section 46 Access Log
* AUTHOR: Duane Wessels
accessLogSquid(AccessLogEntry * al)
{
const char *client = dash_str;
- if (Config.Log.log_fqdn)
+ if (Config.onoff.log_fqdn)
client = fqdncache_gethostbyaddr(al->cache.caddr, 0);
if (client == NULL)
client = inet_ntoa(al->cache.caddr);
accessLogCommon(AccessLogEntry * al)
{
const char *client = dash_str;
- if (Config.Log.log_fqdn)
+ if (Config.onoff.log_fqdn)
client = fqdncache_gethostbyaddr(al->cache.caddr, 0);
if (client == NULL)
client = inet_ntoa(al->cache.caddr);
al->private.method_str = RequestMethodStr[al->http.method];
if (al->hier.host[0] == '\0')
xstrncpy(al->hier.host, dash_str, SQUIDHOSTNAMELEN);
- if (Config.commonLogFormat)
+ if (Config.onoff.common_log)
l = accessLogCommon(al);
else
l = accessLogSquid(al);
- if (Config.logMimeHdrs) {
+ if (Config.onoff.log_mime_hdrs) {
char *ereq = log_quote(al->headers.request);
char *erep = log_quote(al->headers.reply);
if (LOG_BUF_SZ - l > 0)
/*
- * $Id: acl.cc,v 1.104 1997/07/15 23:23:14 wessels Exp $
+ * $Id: acl.cc,v 1.105 1997/07/26 04:48:22 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
q = xcalloc(1, sizeof(intlist));
q->i = (int) urlParseMethod(t);
if (q->i == METHOD_PURGE)
- Config.Options.enable_purge = 1;
+ Config.onoff.enable_purge = 1;
*(Tail) = q;
Tail = &q->next;
}
aclParseIntlist(&A->data);
break;
case ACL_USER:
- Config.identLookup = 1;
+ Config.onoff.ident_lookup = 1;
aclParseWordList(&A->data);
break;
case ACL_PROTO:
/*
- * $Id: cache_cf.cc,v 1.216 1997/07/19 07:20:00 wessels Exp $
+ * $Id: cache_cf.cc,v 1.217 1997/07/26 04:48:23 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
}
if (Config.Announce.period < 1) {
Config.Announce.period = 86400 * 365; /* one year */
- Config.Announce.on = 0;
+ Config.onoff.announce = 0;
}
if (Config.dnsChildren < 0)
Config.dnsChildren = 0;
COMMENT: on|off
TYPE: onoff
DEFAULT: off
-LOC: Config.singleParentBypass
+LOC: Config.onoff.single_parent_bypass
DOC_START
This tag specifies that it is okay to bypass the hierarchy
"Pinging" when there is only a single parent for a given URL.
COMMENT: on|off
TYPE: onoff
DEFAULT: off
-LOC: Config.sourcePing
+LOC: Config.onoff.source_ping
DOC_START
If source_ping is enabled, then squid will include the source
provider site in its selection algorithm. This is accomplished
COMMENT: on|off
TYPE: onoff
DEFAULT: off
-LOC: Config.commonLogFormat
+LOC: Config.onoff.common_log
DOC_START
The Cache can emulate the log file format which many 'httpd'
programs use. To disable/enable this emulation, set
NAME: log_mime_hdrs
COMMENT: on|off
TYPE: onoff
-LOC: Config.logMimeHdrs
+LOC: Config.onoff.log_mime_hdrs
DEFAULT: off
DOC_START
The Cache can record both the request and the response
COMMENT: on|off
TYPE: onoff
DEFAULT: off
-LOC: Config.identLookup
+LOC: Config.onoff.ident_lookup
DOC_START
If you wish to make an RFC931/ident lookup of the client username
for each connection, enable this. It is off by default.
COMMENT: on|off
TYPE: onoff
DEFAULT: off
-LOC: Config.Log.log_fqdn
+LOC: Config.onoff.log_fqdn
DOC_START
Turn this on if you wish to log fully qualified domain names
in the access.log.
COMMENT: on|off
TYPE: onoff
DEFAULT: off
-LOC: Config.Options.res_defnames
+LOC: Config.onoff.res_defnames
DOC_START
Normally the 'dnsserver' disables the RES_DEFNAMES resolver
option (see res_init(3)). This prevents caches in a hierarchy
COMMENT: on|off
TYPE: onoff
DEFAULT: off
-LOC: Config.Accel.withProxy
+LOC: Config.onoff.accel_with_proxy
DOC_START
If you want to use squid as both a local httpd accelerator
and as a proxy, change this to 'on'.
COMMENT: on|off
TYPE: onoff
DEFAULT: on
-LOC: Config.Options.log_udp
+LOC: Config.onoff.log_udp
DOC_START
If set, ICP queries are logged to access.log. ICP logging
is enabled by default, so uncomment and change the line
COMMENT: on|off
TYPE: onoff
DEFAULT: off
-LOC: Config.Options.icp_hit_stale
+LOC: Config.onoff.icp_hit_stale
DOC_START
If you want to return ICP_HIT for stale cache objects, set this
option to 'on'. If you have sibling relationships with caches
NAME: http_anonymizer
TYPE: httpanonymizer
-LOC: Config.Options.anonymizer
+LOC: Config.onoff.anonymizer
DEFAULT: off
DOC_START
If you want to filter out certain HTTP request headers for
COMMENT: on|off
TYPE: onoff
DEFAULT: on
-LOC: Config.Options.client_db
+LOC: Config.onoff.client_db
DOC_START
If you want to disable collecting per-client statistics, then
turn off client_db here.
COMMENT: on|off
TYPE: onoff
DEFAULT: off
-LOC: Config.Options.query_icmp
+LOC: Config.onoff.query_icmp
DOC_START
If you want to ask your peers to include ICMP data in their ICP
replies, enable this option.
COMMENT: on|off
TYPE: onoff
DEFAULT: off
-LOC: Config.Options.buffered_logs
+LOC: Config.onoff.buffered_logs
DOC_START
Some log files (cache.log, useragent.log) are written with
stdio functions, and as such they can be buffered or
/*
- * $Id: client_db.cc,v 1.14 1997/07/17 05:22:31 wessels Exp $
+ * $Id: client_db.cc,v 1.15 1997/07/26 04:48:24 wessels Exp $
*
* DEBUG: section 0 Client Database
* AUTHOR: Duane Wessels
{
char *key;
ClientInfo *c;
- if (!Config.Options.client_db)
+ if (!Config.onoff.client_db)
return;
key = inet_ntoa(addr);
c = (ClientInfo *) hash_lookup(client_table, key);
char *key;
int n = 100;
ClientInfo *c;
- if (!Config.Options.client_db)
+ if (!Config.onoff.client_db)
return 0;
key = inet_ntoa(addr);
c = (ClientInfo *) hash_lookup(client_table, key);
/*
- * $Id: client_side.cc,v 1.118 1997/07/16 20:32:00 wessels Exp $
+ * $Id: client_side.cc,v 1.119 1997/07/26 04:48:25 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
* we are in httpd-accel only mode */
if (!Config2.Accel.on)
return 0;
- if (Config.Accel.withProxy)
+ if (Config.onoff.accel_with_proxy)
return 0;
if (http->request->protocol == PROTO_CACHEOBJ)
return 0;
clientHttpRequest *http = data;
ConnStateData *conn = http->conn;
char *browser;
- if (Config.identLookup && conn->ident.state == IDENT_NONE) {
+ if (Config.onoff.ident_lookup && conn->ident.state == IDENT_NONE) {
identStart(-1, conn, clientAccessCheck);
return;
}
LOCAL_ARRAY(char, msg, 8192);
LOCAL_ARRAY(char, line, 256);
StoreEntry *entry;
- debug(0, 0) ("Config.Options.enable_purge = %d\n", Config.Options.enable_purge);
- if (!Config.Options.enable_purge) {
+ debug(0, 0) ("Config.onoff.enable_purge = %d\n", Config.onoff.enable_purge);
+ if (!Config.onoff.enable_purge) {
buf = access_denied_msg(http->http_code = 401,
http->request->method,
http->url,
/*
- * $Id: comm.cc,v 1.182 1997/07/16 22:58:24 wessels Exp $
+ * $Id: comm.cc,v 1.183 1997/07/26 04:48:26 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
cs->S.sin_family = AF_INET;
cs->S.sin_addr = cs->in_addr;
cs->S.sin_port = htons(cs->port);
- if (Config.Log.log_fqdn)
+ if (Config.onoff.log_fqdn)
fqdncache_gethostbyaddr(cs->S.sin_addr, FQDN_LOOKUP_IF_MISS);
}
switch (comm_connect_addr(fd, &cs->S)) {
/*
- * $Id: debug.cc,v 1.50 1997/07/21 07:20:56 wessels Exp $
+ * $Id: debug.cc,v 1.51 1997/07/26 04:48:27 wessels Exp $
*
* DEBUG: section 0 Debug Routines
* AUTHOR: Harvest Derived
#endif /* HAVE_SYSLOG */
/* write to log file */
vfprintf(debug_log, f, args);
- if (!Config.Options.buffered_logs)
+ if (!Config.onoff.buffered_logs)
fflush(debug_log);
if (opt_debug_stderr && debug_log != stderr)
vfprintf(stderr, f, args);
/*
- * $Id: dns.cc,v 1.38 1997/07/16 20:32:03 wessels Exp $
+ * $Id: dns.cc,v 1.39 1997/07/26 04:48:28 wessels Exp $
*
* DEBUG: section 34 Dnsserver interface
* AUTHOR: Harvest Derived
fclose(debug_log);
close(fd);
close(cfd);
- if (Config.Options.res_defnames)
+ if (Config.onoff.res_defnames)
execlp(command, "(dnsserver)", "-D", NULL);
else
execlp(command, "(dnsserver)", NULL);
/*
- * $Id: fqdncache.cc,v 1.57 1997/06/26 22:35:46 wessels Exp $
+ * $Id: fqdncache.cc,v 1.58 1997/07/26 04:48:28 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
{
const char *n;
static char buf[32];
- if (Config.Log.log_fqdn && (n = fqdncache_gethostbyaddr(addr, 0)))
+ if (Config.onoff.log_fqdn && (n = fqdncache_gethostbyaddr(addr, 0)))
return n;
xstrncpy(buf, inet_ntoa(addr), 32);
return buf;
/*
- * $Id: http.cc,v 1.178 1997/07/16 20:32:07 wessels Exp $
+ * $Id: http.cc,v 1.179 1997/07/26 04:48:29 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
if (n >= max)
return;
if (check) {
- if (Config.Options.anonymizer == ANONYMIZER_PARANOID) {
+ if (Config.onoff.anonymizer == ANONYMIZER_PARANOID) {
if (!httpAnonAllowed(line))
return;
- } else if (Config.Options.anonymizer == ANONYMIZER_STANDARD) {
+ } else if (Config.onoff.anonymizer == ANONYMIZER_STANDARD) {
if (httpAnonDenied(line))
return;
}
/*
- * $Id: main.cc,v 1.168 1997/07/21 07:20:58 wessels Exp $
+ * $Id: main.cc,v 1.169 1997/07/26 04:48:32 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
}
if (NHttpSockets < 1)
fatal("Cannot open HTTP Port");
- if (!Config2.Accel.on || Config.Accel.withProxy) {
+ if (!Config2.Accel.on || Config.onoff.accel_with_proxy) {
if ((port = Config.Port.icp) > (u_short) 0) {
enter_suid();
theInIcpConnection = comm_open(SOCK_DGRAM,
dnsOpenServers();
redirectOpenServers();
serverConnectionsOpen();
- if (theOutIcpConnection >= 0 && (!Config2.Accel.on || Config.Accel.withProxy))
+ if (theOutIcpConnection >= 0 && (!Config2.Accel.on || Config.onoff.accel_with_proxy))
neighbors_open(theOutIcpConnection);
debug(1, 0) ("Ready to serve requests.\n");
}
mimeInit(Config.mimeTablePathname);
}
serverConnectionsOpen();
- if (theOutIcpConnection >= 0 && (!Config2.Accel.on || Config.Accel.withProxy))
+ if (theOutIcpConnection >= 0 && (!Config2.Accel.on || Config.onoff.accel_with_proxy))
neighbors_open(theOutIcpConnection);
if (!configured_once)
if (!configured_once) {
eventAdd("storeMaintain", storeMaintainSwapSpace, NULL, 1);
eventAdd("storeDirClean", storeDirClean, NULL, 15);
- if (Config.Announce.on)
+ if (Config.onoff.announce)
eventAdd("start_announce", start_announce, NULL, 3600);
eventAdd("ipcache_purgelru", ipcache_purgelru, NULL, 10);
}
/*
- * $Id: neighbors.cc,v 1.153 1997/07/16 20:32:12 wessels Exp $
+ * $Id: neighbors.cc,v 1.154 1997/07/26 04:48:33 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
if (!BIT_TEST(request->flags, REQ_NOCACHE))
if (p->icp_version == ICP_VERSION_2)
flags |= ICP_FLAG_HIT_OBJ;
- if (Config.Options.query_icmp)
+ if (Config.onoff.query_icmp)
if (p->icp_version == ICP_VERSION_2)
flags |= ICP_FLAG_SRC_RTT;
query = icpCreateMessage(ICP_OP_QUERY, flags, url, reqnum, 0);
/* only do source_ping if we have neighbors */
if (Config.npeers) {
- if (!Config.sourcePing) {
+ if (!Config.onoff.source_ping) {
debug(15, 6) ("neighborsUdpPing: Source Ping is disabled.\n");
} else if ((ia = ipcache_gethostbyname(host, 0))) {
debug(15, 6) ("neighborsUdpPing: Source Ping: to %s for '%s'\n",
if (p) {
debug(15, 1) ("Ignoring SECHO from neighbor %s\n", p->host);
neighborCountIgnored(p, opcode);
- } else if (!Config.sourcePing) {
+ } else if (!Config.onoff.source_ping) {
debug(15, 1) ("Unsolicited SECHO from %s\n", inet_ntoa(from->sin_addr));
} else {
mem->icp_reply_callback(NULL, ntype, opcode, mem->ircb_data);
/*
- * $Id: peer_select.cc,v 1.23 1997/07/19 07:20:04 wessels Exp $
+ * $Id: peer_select.cc,v 1.24 1997/07/26 04:48:34 wessels Exp $
*
* DEBUG: section 44 Peer Selection Algorithm
* AUTHOR: Duane Wessels
fatal_dump("direct == DIRECT_YES");
if (!BIT_TEST(entry->flag, HIERARCHICAL) && direct != DIRECT_NO)
return 0;
- if (Config.singleParentBypass && !Config.sourcePing)
+ if (Config.onoff.single_parent_bypass && !Config.onoff.source_ping)
if (getSingleParent(request))
return 0;
if (BIT_TEST(entry->flag, KEY_PRIVATE) && !neighbors_do_private_keys)
/*
- * $Id: send-announce.cc,v 1.41 1997/07/07 05:29:52 wessels Exp $
+ * $Id: send-announce.cc,v 1.42 1997/07/26 04:48:34 wessels Exp $
*
* DEBUG: section 27 Cache Announcer
* AUTHOR: Duane Wessels
void
start_announce(void *unused)
{
- if (!Config.Announce.on)
+ if (!Config.onoff.announce)
return;
ipcache_nbgethostbyname(Config.Announce.host, send_announce, NULL);
eventAdd("send_announce", start_announce, NULL, Config.Announce.period);
char *swap;
char *useragent;
int rotateNumber;
- int log_fqdn;
} Log;
struct {
char *File;
} Program;
int dnsChildren;
int redirectChildren;
- int sourcePing;
- int commonLogFormat;
- int logMimeHdrs;
- int identLookup;
- int singleParentBypass;
struct {
char *host;
u_short port;
- int withProxy;
} Accel;
char *appendDomain;
size_t appendDomainLen;
char *host;
char *file;
time_t period;
- int on;
u_short port;
} Announce;
struct {
int query_icmp;
int icp_hit_stale;
int buffered_logs;
- } Options;
+ int source_ping;
+ int common_log;
+ int log_mime_hdrs;
+ int ident_lookup;
+ int single_parent_bypass;
+ int log_fqdn;
+ int announce;
+ int accel_with_proxy;
+ } onoff;
struct _acl *aclList;
struct {
struct _acl_access *http;
/*
- * $Id: useragent.cc,v 1.9 1997/07/21 07:21:02 wessels Exp $
+ * $Id: useragent.cc,v 1.10 1997/07/26 04:48:35 wessels Exp $
*
* DEBUG: section 40 User-Agent logging
* AUTHOR: Joe Ramey <ramey@csc.ti.com>
client,
time_str,
agent);
- if (!Config.Options.buffered_logs)
+ if (!Config.onoff.buffered_logs)
fflush(cache_useragent_log);
#endif
}