/*
- * $Id: acl.cc,v 1.103 1997/07/14 03:33:34 wessels Exp $
+ * $Id: acl.cc,v 1.104 1997/07/15 23:23:14 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
for (Tail = curlist; *Tail; Tail = &((*Tail)->next));
while ((t = strtokFile())) {
if (strcmp(t, "-i") == 0) {
- flags |= REG_ICASE;
- continue;
+ flags |= REG_ICASE;
+ continue;
}
if (strcmp(t, "+i") == 0) {
- flags &= ~REG_ICASE;
- continue;
+ flags &= ~REG_ICASE;
+ continue;
}
if ((errcode = regcomp(&comp, t, flags)) != 0) {
char errbuf[256];
#endif /* USE_SPLAY_TREE */
void
-aclParseAclLine(acl **head)
+aclParseAclLine(acl ** head)
{
/* we're already using strtok() to grok the line */
char *t = NULL;
}
void
-aclDestroyAcls(acl **head)
+aclDestroyAcls(acl ** head)
{
struct _acl *a = NULL;
struct _acl *next = NULL;
/*
- * $Id: cache_cf.cc,v 1.206 1997/07/15 23:15:34 wessels Exp $
+ * $Id: cache_cf.cc,v 1.207 1997/07/15 23:23:15 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
static void configDoConfigure _PARAMS((void));
static void parse_refreshpattern _PARAMS((refresh_t **));
static int parseTimeUnits _PARAMS((const char *unit));
-static void parseTimeLine _PARAMS((time_t *tptr, const char *units));
+static void parseTimeLine _PARAMS((time_t * tptr, const char *units));
static void parse_string _PARAMS((char **));
static void parse_wordlist _PARAMS((wordlist **));
static void default_all _PARAMS((void));
static int parse_line _PARAMS((char *));
static cache_peer *configFindPeer _PARAMS((const char *name));
-static void parseBytesLine _PARAMS((size_t *bptr, const char *units));
+static void parseBytesLine _PARAMS((size_t * bptr, const char *units));
static size_t parseBytesUnits _PARAMS((const char *unit));
/* These come from cf_gen.c */
cache_peer *p;
memset(&Config2, '\0', sizeof(SquidConfig2));
if (Config.Accel.host) {
- snprintf(buf, BUFSIZ, "http://%s:%d", Config.Accel.host, Config.Accel.port);
- Config2.Accel.prefix = xstrdup(buf);
- Config2.Accel.on = 1;
+ snprintf(buf, BUFSIZ, "http://%s:%d", Config.Accel.host, Config.Accel.port);
+ Config2.Accel.prefix = xstrdup(buf);
+ Config2.Accel.on = 1;
}
if (Config.appendDomain)
if (*Config.appendDomain != '.')
safe_free(debug_options)
debug_options = xstrdup(Config.debugOptions);
/* ICK */
- for (p = Config.peers; p; p=p->next) {
+ for (p = Config.peers; p; p = p->next) {
neighborAdd(p->host,
- p->type,
- p->http,
- p->icp,
- p->options,
- p->weight,
- p->mcast_ttl);
+ p->type,
+ p->http,
+ p->icp,
+ p->options,
+ p->weight,
+ p->mcast_ttl);
}
}
/* Parse a time specification from the config file. Store the
* result in 'tptr', after converting it to 'units' */
static void
-parseTimeLine(time_t *tptr, const char *units)
+parseTimeLine(time_t * tptr, const char *units)
{
char *token;
double d;
d = atof(token);
m = u; /* default to 'units' if none specified */
if ((token = strtok(NULL, w_space)) == NULL)
- debug(3,0)("WARNING: No units on '%s', assuming %f %s\n",
- config_input_line, d, units);
+ debug(3, 0) ("WARNING: No units on '%s', assuming %f %s\n",
+ config_input_line, d, units);
else if ((m = parseTimeUnits(token)) == 0)
- self_destruct();
+ self_destruct();
*tptr = m * d / u;
}
if (!strncasecmp(unit, B_BYTES_STR, strlen(B_BYTES_STR)))
return 1;
if (!strncasecmp(unit, B_KBYTES_STR, strlen(B_KBYTES_STR)))
- return 1<<10;
+ return 1 << 10;
if (!strncasecmp(unit, B_MBYTES_STR, strlen(B_MBYTES_STR)))
- return 1<<20;
+ return 1 << 20;
if (!strncasecmp(unit, B_GBYTES_STR, strlen(B_GBYTES_STR)))
- return 1<<30;
+ return 1 << 30;
debug(3, 1) ("parseBytesUnits: unknown bytes unit '%s'\n", unit);
return 0;
}
*****************************************************************************/
static void
-dump_acl(acl *acl)
+dump_acl(acl * acl)
{
assert(0);
}
static void
-parse_acl(acl **acl)
+parse_acl(acl ** acl)
{
aclParseAclLine(acl);
}
static void
-free_acl(acl **acl)
+free_acl(acl ** acl)
{
aclDestroyAcls(acl);
}
static void
free_acl_access(struct _acl_access **head)
{
- aclDestroyAccessList(head);
+ aclDestroyAccessList(head);
}
static void
static void
free_address(struct in_addr *addr)
{
- memset(addr, '\0', sizeof(struct in_addr));
+ memset(addr, '\0', sizeof(struct in_addr));
}
static void
if (!strcasecmp(token, "read-only"))
readonly = 1;
for (i = 0; i < swap->n_configured; i++) {
- tmp = swap->swapDirs+i;
+ tmp = swap->swapDirs + i;
if (!strcmp(path, tmp->path)) {
/* just reconfigure it */
- tmp->max_size = size;
- tmp->read_only = readonly;
+ tmp->max_size = size;
+ tmp->read_only = readonly;
return;
}
}
static void
free_cachedir(struct _cacheSwap *swap)
{
- SwapDir *s;
- int i;
- for (i = 0; i<swap->n_configured; i++) {
- s = swap->swapDirs+i;
- xfree(s->path);
- filemapFreeMemory(s->map);
- }
- safe_free(swap->swapDirs);
- swap->swapDirs = NULL;
- swap->n_allocated = 0;
- swap->n_configured = 0;
+ SwapDir *s;
+ int i;
+ for (i = 0; i < swap->n_configured; i++) {
+ s = swap->swapDirs + i;
+ xfree(s->path);
+ filemapFreeMemory(s->map);
+ }
+ safe_free(swap->swapDirs);
+ swap->swapDirs = NULL;
+ swap->n_allocated = 0;
+ swap->n_configured = 0;
}
static void
-dump_cache_peer(cache_peer *p)
+dump_cache_peer(cache_peer * p)
{
assert(0);
}
static void
-parse_cache_peer(cache_peer **head)
+parse_cache_peer(cache_peer ** head)
{
char *token = NULL;
cache_peer peer;
peer.http = CACHE_HTTP_PORT;
peer.icp = CACHE_ICP_PORT;
peer.weight = 1;
- if (!(peer.host = strtok(NULL, w_space)))
+ if (!(peer.host = strtok(NULL, w_space)))
self_destruct();
if (!(peer.type = strtok(NULL, w_space)))
self_destruct();
}
static void
-free_cache_peer(cache_peer **P)
+free_cache_peer(cache_peer ** P)
{
- cache_peer *p;
- while ((p = *P)) {
- *P = p->next;
- xfree(p->host);
- xfree(p->type);
- xfree(p);
- }
+ cache_peer *p;
+ while ((p = *P)) {
+ *P = p->next;
+ xfree(p->host);
+ xfree(p->type);
+ xfree(p);
+ }
}
static void
-dump_cachemgrpasswd(cachemgr_passwd *list)
+dump_cachemgrpasswd(cachemgr_passwd * list)
{
assert(0);
}
static void
-parse_cachemgrpasswd(cachemgr_passwd **head)
+parse_cachemgrpasswd(cachemgr_passwd ** head)
{
char *passwd = NULL;
wordlist *actions = NULL;
}
static void
-free_cachemgrpasswd(cachemgr_passwd **head)
+free_cachemgrpasswd(cachemgr_passwd ** head)
{
- cachemgr_passwd *p;
- while ((p = *head)) {
- *head = p->next;
- xfree(p->passwd);
- xfree(p);
- }
+ cachemgr_passwd *p;
+ while ((p = *head)) {
+ *head = p->next;
+ xfree(p->passwd);
+ xfree(p);
+ }
}
}
void
-free_denyinfo(acl_deny_info_list **list)
+free_denyinfo(acl_deny_info_list ** list)
{
struct _acl_deny_info_list *a = NULL;
struct _acl_deny_info_list *a_next = NULL;
struct _acl_name_list *l = NULL;
struct _acl_name_list *l_next = NULL;
for (a = *list; a; a = a_next) {
- for (l = a->acl_list; l; l = l_next) {
- l_next = l->next;
- safe_free(l);
- }
- a_next = a->next;
- safe_free(a);
+ for (l = a->acl_list; l; l = l_next) {
+ l_next = l->next;
+ safe_free(l);
+ }
+ a_next = a->next;
+ safe_free(a);
}
*list = NULL;
}
}
static cache_peer *
-configFindPeer (const char *name)
+configFindPeer(const char *name)
{
cache_peer *p = NULL;
for (p = Config.peers; p; p = p->next) {
- if (!strcasecmp(name, p->host))
- break;
+ if (!strcasecmp(name, p->host))
+ break;
}
return p;
}
static void
-dump_ushortlist(ushortlist *u)
+dump_ushortlist(ushortlist * u)
{
while (u) {
printf("%d ", (int) u->i);
}
static void
-free_ushortlist(ushortlist **P)
+free_ushortlist(ushortlist ** P)
{
- ushortlist *u;
- while ((u = *P)) {
- *P = u->next;
- xfree(u);
- }
+ ushortlist *u;
+ while ((u = *P)) {
+ *P = u->next;
+ xfree(u);
+ }
}
static void
static void
free_int(int *var)
{
- *var = 0;
+ *var = 0;
}
static void
}
static void
-dump_refreshpattern(refresh_t *head)
+dump_refreshpattern(refresh_t * head)
{
assert(0);
}
}
static void
-free_refreshpattern(refresh_t **head)
+free_refreshpattern(refresh_t ** head)
{
refresh_t *t;
while ((t = *head)) {
static void
free_string(char **var)
{
- xfree(*var);
- *var = NULL;
+ xfree(*var);
+ *var = NULL;
}
static void
}
static void
-parse_time_t(time_t *var)
+parse_time_t(time_t * var)
{
parseTimeLine(var, T_SECOND_STR);
}
static void
-free_time_t(time_t *var)
+free_time_t(time_t * var)
{
- *var = 0;
+ *var = 0;
}
static void
}
static void
-parse_size_t(size_t *var)
+parse_size_t(size_t * var)
{
parseBytesLine(var, B_BYTES_STR);
}
static void
-parse_kb_size_t(size_t *var)
+parse_kb_size_t(size_t * var)
{
parseBytesLine(var, B_KBYTES_STR);
}
static void
-free_size_t(size_t *var)
+free_size_t(size_t * var)
{
- *var = 0;
+ *var = 0;
}
#define free_kb_size_t free_size_t
}
static void
-free_ushort(u_short *u)
+free_ushort(u_short * u)
{
*u = 0;
}
debug(15, 0) ("WARNING: Unknown neighbor type: %s\n", s);
return PEER_SIBLING;
}
-
+
/*
- * $Id: cachemgr.cc,v 1.54 1997/04/28 04:22:59 wessels Exp $
+ * $Id: cachemgr.cc,v 1.55 1997/07/15 23:23:16 wessels Exp $
*
* DEBUG: section 0 CGI Cache Manager
* AUTHOR: Harvest Derived
+
/*
- * $Id: client.cc,v 1.18 1997/06/26 22:35:40 wessels Exp $
+ * $Id: client.cc,v 1.19 1997/07/15 23:23:18 wessels Exp $
*
* DEBUG: section 0 WWW Client
* AUTHOR: Harvest Derived
/*
- * $Id: client_side.cc,v 1.116 1997/07/07 05:29:41 wessels Exp $
+ * $Id: client_side.cc,v 1.117 1997/07/15 23:23:19 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
/* We have an existing entry, but failed to validate it */
if (BIT_SET(entry->flag, ENTRY_REVALIDATE)) {
/* We can't send the old one, so send the abort message */
- http->log_type = LOG_TCP_REFRESH_MISS;
- storeUnregister(http->old_entry, http);
- storeUnlockObject(http->old_entry);
+ http->log_type = LOG_TCP_REFRESH_MISS;
+ storeUnregister(http->old_entry, http);
+ storeUnlockObject(http->old_entry);
} else {
/* Its okay to send the old one anyway */
http->log_type = entry->mem_obj->abort_code;
/*
- * $Id: comm.cc,v 1.178 1997/07/15 04:03:09 wessels Exp $
+ * $Id: comm.cc,v 1.179 1997/07/15 23:23:21 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
assert(fd < Squid_MaxFD);
F = &fd_table[fd];
if (!F->open) {
- debug(5,1)("comm_close: FD %d is not open!\n", fd);
+ debug(5, 1) ("comm_close: FD %d is not open!\n", fd);
return;
}
assert(F->type != FD_FILE);
-extern FILE *debug_log; /* NULL */
-extern FILE *cache_useragent_log; /* NULL */
+extern FILE *debug_log; /* NULL */
+extern FILE *cache_useragent_log; /* NULL */
extern Meta_data meta_data;
extern SquidConfig Config;
extern SquidConfig2 Config2;
extern cacheinfo *ICPCacheInfo;
extern char *ConfigFile; /* NULL */
extern char *IcpOpcodeStr[];
-extern char *dns_error_message; /* NULL */
+extern char *dns_error_message; /* NULL */
extern char *log_tags[];
-extern char *tmp_error_buf; /* NULL */
-extern char *volatile debug_options; /* NULL */
+extern char *tmp_error_buf; /* NULL */
+extern char *volatile debug_options; /* NULL */
extern char ThisCache[SQUIDHOSTNAMELEN << 1];
extern char config_input_line[BUFSIZ];
-extern const char *AclMatchedName; /* NULL */
+extern const char *AclMatchedName; /* NULL */
extern const char *DefaultConfigFile; /* DEFAULT_CONFIG_FILE */
extern const char *DefaultSwapDir; /* DEFAULT_SWAP_DIR */
extern const char *RequestMethodStr[];
extern const char *cfg_filename; /* NULL */
-extern const char *const appname; /* "squid" */
-extern const char *const close_bracket; /* "}\n" */
-extern const char *const dash_str; /* "-" */
-extern const char *const localhost; /* "127.0.0.1" */
-extern const char *const null_string; /* "" */
-extern const char *const open_bracket; /* "{\n" */
-extern const char *const version_string ; /* SQUID_VERSION */
-extern const char *const w_space; /* " \t\n\r" */
+extern const char *const appname; /* "squid" */
+extern const char *const close_bracket; /* "}\n" */
+extern const char *const dash_str; /* "-" */
+extern const char *const localhost; /* "127.0.0.1" */
+extern const char *const null_string; /* "" */
+extern const char *const open_bracket; /* "{\n" */
+extern const char *const version_string; /* SQUID_VERSION */
+extern const char *const w_space; /* " \t\n\r" */
extern const char *fdstatTypeStr[];
extern const char *hier_strings[];
extern const char *memStatusStr[];
extern const char *storeStatusStr[];
extern const char *swapStatusStr[];
extern dnsStatData DnsStats;
-extern fde *fd_table; /* NULL */
-extern int Biggest_FD; /* -1 */
+extern fde *fd_table; /* NULL */
+extern int Biggest_FD; /* -1 */
extern int HttpSockets[MAXHTTPPORTS];
extern int NDnsServersAlloc; /* 0 */
-extern int NHttpSockets; /* 0 */
+extern int NHttpSockets; /* 0 */
extern int RESERVED_FD;
-extern int Squid_MaxFD; /* SQUID_MAXFD */
+extern int Squid_MaxFD; /* SQUID_MAXFD */
extern int config_lineno; /* 0 */
-extern int configured_once; /* 0 */
+extern int configured_once; /* 0 */
extern int debugLevels[MAX_DEBUG_SECTIONS];
-extern int do_mallinfo; /* 0 */
-extern int do_reuse; /* 1 */
+extern int do_mallinfo; /* 0 */
+extern int do_reuse; /* 1 */
extern int hash_links_allocated;
-extern int icmp_sock; /* -1 */
-extern int neighbors_do_private_keys; /* 1 */
-extern int opt_accel_uses_host; /* 0 */
-extern int opt_catch_signals; /* 1 */
-extern int opt_debug_stderr; /* 0 */
-extern int opt_dns_tests; /* 1 */
-extern int opt_foreground_rebuild; /* 0 */
-extern int opt_forwarded_for; /* 1 */
-extern int opt_mem_pools; /* 1 */
-extern int opt_reload_hit_only; /* 0 */
-extern int opt_syslog_enable; /* 0 */
-extern int opt_udp_hit_obj; /* 0 */
-extern int opt_zap_disk_store; /* 0 */
-extern int select_loops; /* 0 */
-extern int syslog_enable; /* 0 */
-extern int theInIcpConnection; /* -1 */
-extern int theOutIcpConnection; /* -1 */
-extern int vhost_mode; /* 0 */
-extern int vizSock; /* -1 */
+extern int icmp_sock; /* -1 */
+extern int neighbors_do_private_keys; /* 1 */
+extern int opt_accel_uses_host; /* 0 */
+extern int opt_catch_signals; /* 1 */
+extern int opt_debug_stderr; /* 0 */
+extern int opt_dns_tests; /* 1 */
+extern int opt_foreground_rebuild; /* 0 */
+extern int opt_forwarded_for; /* 1 */
+extern int opt_mem_pools; /* 1 */
+extern int opt_reload_hit_only; /* 0 */
+extern int opt_syslog_enable; /* 0 */
+extern int opt_udp_hit_obj; /* 0 */
+extern int opt_zap_disk_store; /* 0 */
+extern int select_loops; /* 0 */
+extern int syslog_enable; /* 0 */
+extern int theInIcpConnection; /* -1 */
+extern int theOutIcpConnection; /* -1 */
+extern int vhost_mode; /* 0 */
+extern int vizSock; /* -1 */
extern iostats IOStats;
extern stmem_stats disk_stats;
extern stmem_stats mem_obj_pool;
extern stmem_stats request_pool;
extern stmem_stats sm_stats;
-extern struct _acl_deny_info_list *DenyInfoList; /* NULL */
+extern struct _acl_deny_info_list *DenyInfoList; /* NULL */
extern struct in_addr any_addr;
extern struct in_addr local_addr;
extern struct in_addr no_addr;
extern struct in_addr theOutICPAddr;
extern struct timeval current_time;
-extern time_t squid_curtime; /* 0 */
-extern time_t squid_starttime; /* 0 */
-extern volatile int reconfigure_pending; /* 0 */
-extern volatile int shutdown_pending; /* 0 */
+extern time_t squid_curtime; /* 0 */
+extern time_t squid_starttime; /* 0 */
+extern volatile int reconfigure_pending; /* 0 */
+extern volatile int shutdown_pending; /* 0 */
extern volatile int unbuffered_logs; /* 0 */
-extern volatile unsigned long nudpconn; /* 0 */
-extern volatile unsigned long ntcpconn; /* 0 */
-extern int unlinkd_count; /* 0 */
-extern int fileno_stack_count; /* 0 */
+extern volatile unsigned long nudpconn; /* 0 */
+extern volatile unsigned long ntcpconn; /* 0 */
+extern int unlinkd_count; /* 0 */
+extern int fileno_stack_count; /* 0 */
#ifdef HAVE_SYSLOG
extern int _db_level;
#endif
-
+
/*
- * $Id: gopher.cc,v 1.89 1997/07/15 03:29:02 wessels Exp $
+ * $Id: gopher.cc,v 1.90 1997/07/15 23:23:23 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
* stuff. Do it anyway even though request is not HTML type.
*/
gopherMimeCreate(gopherState);
- switch (gopherState->type_id) {
- case GOPHER_DIRECTORY:
- /* we got to convert it first */
- BIT_SET(entry->flag, DELAY_SENDING);
- gopherState->conversion = HTML_DIR;
- gopherState->HTML_header_added = 0;
- break;
- case GOPHER_INDEX:
- /* we got to convert it first */
- BIT_SET(entry->flag, DELAY_SENDING);
- gopherState->conversion = HTML_INDEX_RESULT;
- gopherState->HTML_header_added = 0;
- break;
- case GOPHER_CSO:
- /* we got to convert it first */
- BIT_SET(entry->flag, DELAY_SENDING);
- gopherState->conversion = HTML_CSO_RESULT;
- gopherState->cso_recno = 0;
- gopherState->HTML_header_added = 0;
- break;
- default:
- gopherState->conversion = NORMAL;
+ switch (gopherState->type_id) {
+ case GOPHER_DIRECTORY:
+ /* we got to convert it first */
+ BIT_SET(entry->flag, DELAY_SENDING);
+ gopherState->conversion = HTML_DIR;
+ gopherState->HTML_header_added = 0;
+ break;
+ case GOPHER_INDEX:
+ /* we got to convert it first */
+ BIT_SET(entry->flag, DELAY_SENDING);
+ gopherState->conversion = HTML_INDEX_RESULT;
+ gopherState->HTML_header_added = 0;
+ break;
+ case GOPHER_CSO:
+ /* we got to convert it first */
+ BIT_SET(entry->flag, DELAY_SENDING);
+ gopherState->conversion = HTML_CSO_RESULT;
+ gopherState->cso_recno = 0;
+ gopherState->HTML_header_added = 0;
+ break;
+ default:
+ gopherState->conversion = NORMAL;
}
/* Schedule read reply. */
commSetSelect(fd, COMM_SELECT_READ, gopherReadReply, gopherState, 0);
+
/*
- * $Id: ident.cc,v 1.31 1997/07/14 23:45:01 wessels Exp $
+ * $Id: ident.cc,v 1.32 1997/07/15 23:23:27 wessels Exp $
*
* DEBUG: section 30 Ident (RFC 931)
* AUTHOR: Duane Wessels
+
/*
- * $Id: main.cc,v 1.162 1997/07/15 05:34:11 wessels Exp $
+ * $Id: main.cc,v 1.163 1997/07/15 23:23:28 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
int x;
int fd;
wordlist *s;
- for (u = Config.Port.http; u; u=u->next) {
+ for (u = Config.Port.http; u; u = u->next) {
enter_suid();
fd = comm_open(SOCK_STREAM,
0,
/*
- * $Id: neighbors.cc,v 1.150 1997/07/15 23:15:36 wessels Exp $
+ * $Id: neighbors.cc,v 1.151 1997/07/15 23:23:30 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
ushortlist *u;
const char *me = getMyHostname();
if (!strcmp(host, me)) {
- for (u=Config.Port.http; u; u=u->next) {
+ for (u = Config.Port.http; u; u = u->next) {
if (http_port != u->i)
continue;
debug(15, 0) ("neighborAdd: skipping cache_host %s %s/%d/%d\n",
- type, host, http_port, icp_port);
+ type, host, http_port, icp_port);
return;
}
}
/*
- * $Id: refresh.cc,v 1.14 1997/07/07 05:29:52 wessels Exp $
+ * $Id: refresh.cc,v 1.15 1997/07/15 23:23:31 wessels Exp $
*
* DEBUG: section 22 Refresh Calculation
* AUTHOR: Harvest Derived
time_t check_time = squid_curtime + delta;
debug(22, 3) ("refreshCheck: '%s'\n", entry->url);
if (BIT_TEST(entry->flag, ENTRY_REVALIDATE)) {
- debug(22, 3)("refreshCheck: YES: Required Authorization\n");
+ debug(22, 3) ("refreshCheck: YES: Required Authorization\n");
return 1;
}
for (R = Config.Refresh; R; R = R->next) {
/*
- * $Id: stmem.cc,v 1.46 1997/07/14 03:33:40 wessels Exp $
+ * $Id: stmem.cc,v 1.47 1997/07/15 23:23:33 wessels Exp $
*
* DEBUG: section 19 Memory Primitives
* AUTHOR: Harvest Derived
safe_free(p);
}
}
- memset(mem, '\0', sizeof(mem_hdr *)); /* nuke in case ref'ed again */
+ memset(mem, '\0', sizeof(mem_hdr *)); /* nuke in case ref'ed again */
safe_free(mem);
}
mem_hdr *
memInit(void)
{
- mem_hdr * new = xcalloc(1, sizeof(mem_hdr));
+ mem_hdr *new = xcalloc(1, sizeof(mem_hdr));
new->tail = new->head = NULL;
return new;
}
/*
- * $Id: store.cc,v 1.272 1997/07/15 15:46:27 wessels Exp $
+ * $Id: store.cc,v 1.273 1997/07/15 23:23:34 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
int clashcount; /* # swapfile clashes avoided */
int dupcount; /* # duplicates purged */
int invalid; /* # bad lines */
+ int badflags; /* # bad e->flags */
int need_to_validate;
time_t start;
time_t stop;
storeAddDiskRestore(const char *url, int file_number, int size, time_t expires, time_t timestamp, time_t lastmod, u_num32 refcount, u_num32 flags, int clean)
{
StoreEntry *e = NULL;
-
- debug(20, 5) ("StoreAddDiskRestore: '%s': size %d: expires %d: fileno=%08X\n",
- url, size, expires, file_number);
-
+ debug(20, 5) ("StoreAddDiskRestore: %s, fileno=%08X\n", url, file_number);
/* if you call this you'd better be sure file_number is not
* already in use! */
-
meta_data.url_strings += strlen(url);
-
e = new_StoreEntry(WITHOUT_MEMOBJ);
e->url = xstrdup(url);
e->method = METHOD_GET;
struct _store_client *sc;
ssize_t size;
assert(mem->clients != NULL || mem->nclients == 0);
- debug(20,3)("InvokeHandlers: %s\n", e->key);
+ debug(20, 3) ("InvokeHandlers: %s\n", e->key);
/* walk the entire list looking for valid callbacks */
for (i = 0; i < mem->nclients; i++) {
- debug(20,3)("InvokeHandlers: checking client #%d\n", i);
+ debug(20, 3) ("InvokeHandlers: checking client #%d\n", i);
sc = &mem->clients[i];
if (sc->callback_data == NULL)
continue;
sc->copy_offset,
sc->copy_buf,
sc->copy_size);
- debug(20,3)("InvokeHandlers: calling handler: %p\n", callback);
+ debug(20, 3) ("InvokeHandlers: calling handler: %p\n", callback);
callback(sc->callback_data, sc->copy_buf, size);
}
}
RB->invalid++;
continue;
}
+ if (BIT_TEST(scan6, KEY_PRIVATE)) {
+ RB->badflags++;
+ continue;
+ }
sfileno = storeDirProperFileno(d->dirn, sfileno);
timestamp = (time_t) scan1;
expires = (time_t) scan2;
debug(20, 1) ("Finished rebuilding storage from disk image.\n");
debug(20, 1) (" %7d Lines read from previous logfile.\n", data->linecount);
debug(20, 1) (" %7d Invalid lines.\n", data->invalid);
+ debug(20, 1) (" %7d With invalid flags.\n", data->badflags);
debug(20, 1) (" %7d Objects loaded.\n", data->objcount);
debug(20, 1) (" %7d Objects expired.\n", data->expcount);
debug(20, 1) (" %7d Duplicate URLs purged.\n", data->dupcount);
assert(seen_offset <= mem->e_current_len);
assert(copy_offset >= mem->e_lowest_offset);
assert(recurse_detect < 3); /* could == 1 for IMS not modified's */
- debug(20,3)("storeClientCopy: %s, seen %d want %d, size %d, cb %p, cbdata %p\n",
+ debug(20, 3) ("storeClientCopy: %s, seen %d want %d, size %d, cb %p, cbdata %p\n",
e->key,
(int) seen_offset,
(int) copy_offset,
store_maintain_buckets == 1 ? null_string : "s",
store_maintain_rate,
store_maintain_rate == 1 ? null_string : "s");
- debug(20,1)("Max Mem size: %d KB\n", Config.Mem.maxSize>>10);
- debug(20,1)("Max Swap size: %d KB\n", Config.Swap.maxSize);
+ debug(20, 1) ("Max Mem size: %d KB\n", Config.Mem.maxSize >> 10);
+ debug(20, 1) ("Max Swap size: %d KB\n", Config.Swap.maxSize);
}
void
} Ftp;
refresh_t *Refresh;
struct _cacheSwap {
- SwapDir *swapDirs;
- int n_allocated;
- int n_configured;
+ SwapDir *swapDirs;
+ int n_allocated;
+ int n_configured;
} cacheSwap;
};
/*
- * $Id: tools.cc,v 1.115 1997/07/15 05:34:13 wessels Exp $
+ * $Id: tools.cc,v 1.116 1997/07/15 23:23:37 wessels Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
#endif
fprintf(debug_log, "FATAL: %s\n", message);
if (opt_debug_stderr && debug_log != stderr)
- fprintf(stderr, "FATAL: %s\n", message);
+ fprintf(stderr, "FATAL: %s\n", message);
fprintf(debug_log, "Squid Cache (Version %s): Terminated abnormally.\n",
version_string);
fflush(debug_log);
typedef unsigned int swap_status_t;
/*
- grep '^struct' structs.h \
- | perl -ne '($a,$b)=split;$c=$b;$c=~s/^_//; print "typedef struct $b $c;\n";'
-*/
+ * grep '^struct' structs.h \
+ * | perl -ne '($a,$b)=split;$c=$b;$c=~s/^_//; print "typedef struct $b $c;\n";'
+ */
typedef struct _acl_ip_data acl_ip_data;
typedef struct _acl_time_data acl_time_data;