/*
- * $Id: access_log.cc,v 1.1 1997/06/21 02:36:47 wessels Exp $
+ * $Id: access_log.cc,v 1.2 1997/06/26 22:35:35 wessels Exp $
*
* DEBUG: section 46 Access Log
* AUTHOR: Duane Wessels
void
accessLogOpen(const char *fname)
{
- assert(fname);
- xstrncpy(LogfileName, fname, SQUID_MAXPATHLEN);
- LogfileFD = file_open(LogfileName, O_WRONLY | O_CREAT, NULL, NULL);
- if (LogfileFD == DISK_ERROR) {
- debug(50, 0) ("%s: %s\n", LogfileName, xstrerror());
- fatal("Cannot open logfile.");
- }
- LogfileStatus = LOG_ENABLE;
+ assert(fname);
+ xstrncpy(LogfileName, fname, SQUID_MAXPATHLEN);
+ LogfileFD = file_open(LogfileName, O_WRONLY | O_CREAT, NULL, NULL);
+ if (LogfileFD == DISK_ERROR) {
+ debug(50, 0) ("%s: %s\n", LogfileName, xstrerror());
+ fatal("Cannot open logfile.");
+ }
+ LogfileStatus = LOG_ENABLE;
}
void
-hierarchyNote(HierarchyLogEntry *hl,
+hierarchyNote(HierarchyLogEntry * hl,
hier_code code,
icp_ping_data * icpdata,
const char *cache_host)
/*
- * $Id: acl.cc,v 1.99 1997/06/18 00:19:51 wessels Exp $
+ * $Id: acl.cc,v 1.100 1997/06/26 22:35:37 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
if (checklist->state[ACL_DST_DOMAIN] == ACL_LOOKUP_PENDING)
fqdncacheUnregister(checklist->dst_addr, checklist);
if (checklist->state[ACL_DST_IP] == ACL_LOOKUP_PENDING)
- ipcacheUnregister(checklist->request->host, checklist);
+ ipcacheUnregister(checklist->request->host, checklist);
requestUnlink(checklist->request);
checklist->request = NULL;
cbdataFree(checklist);
{
debug(28, 3) ("aclCheckCallback: answer=%d\n", answer);
if (cbdataValid(checklist->callback_data))
- checklist->callback(answer, checklist->callback_data);
+ checklist->callback(answer, checklist->callback_data);
cbdataUnlock(checklist->callback_data);
checklist->callback = NULL;
checklist->callback_data = NULL;
+
/* DEBUG: 45 */
#include "squid.h"
+
/*
- * $Id: client.cc,v 1.17 1997/05/22 17:29:08 wessels Exp $
+ * $Id: client.cc,v 1.18 1997/06/26 22:35:40 wessels Exp $
*
* DEBUG: section 0 WWW Client
* AUTHOR: Harvest Derived
/*
- * $Id: client_db.cc,v 1.12 1997/06/17 04:54:08 wessels Exp $
+ * $Id: client_db.cc,v 1.13 1997/06/26 22:35:41 wessels Exp $
*
* DEBUG: section 0 Client Database
* AUTHOR: Duane Wessels
int client_info_sz;
-static hash_table * client_table = NULL;
+static hash_table *client_table = NULL;
static ClientInfo *clientdbAdd _PARAMS((struct in_addr addr));
static ClientInfo *
/*
- * $Id: comm.cc,v 1.170 1997/06/20 05:26:08 wessels Exp $
+ * $Id: comm.cc,v 1.171 1997/06/26 22:35:43 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
return (COMM_ERROR);
}
/* update fdstat */
- debug(5,5)("comm_open: FD %d is a new socket\n", new_socket);
+ debug(5, 5) ("comm_open: FD %d is a new socket\n", new_socket);
fd_open(new_socket, FD_SOCKET, note);
fde = &fd_table[new_socket];
if (!BIT_TEST(flags, COMM_NOCLOEXEC))
comm_remove_close_handler(fd, commConnectFree, cs);
commConnectFree(fd, cs);
if (cbdataValid(data))
- callback(fd, status, data);
+ callback(fd, status, data);
cbdataUnlock(data);
}
{
ConnectStateData *cs = data;
if (cs->locks)
- ipcacheUnregister(cs->host, cs);
+ ipcacheUnregister(cs->host, cs);
safe_free(cs->host);
cbdataFree(cs);
}
assert(ntohs(address->sin_port) != 0);
/* Establish connection. */
if (connect(sock, (struct sockaddr *) address, sizeof(struct sockaddr_in)) < 0) {
- debug(5,9)("connect FD %d: %s\n", sock, xstrerror());
+ debug(5, 9) ("connect FD %d: %s\n", sock, xstrerror());
switch (errno) {
case EALREADY:
#if EAGAIN != EWOULDBLOCK
FD_ENTRY *fde;
assert(fd >= 0);
fde = &fd_table[fd];
- debug(5,5)("commSetSelect: FD %d, handler=%p, data=%p\n", fd, handler, client_data);
+ debug(5, 5) ("commSetSelect: FD %d, handler=%p, data=%p\n", fd, handler, client_data);
if (type & COMM_SELECT_READ) {
fde->read_handler = handler;
fde->read_data = client_data;
/*
- * $Id: disk.cc,v 1.74 1997/06/18 03:06:49 wessels Exp $
+ * $Id: disk.cc,v 1.75 1997/06/26 22:35:44 wessels Exp $
*
* DEBUG: section 6 Disk I/O Routines
* AUTHOR: Harvest Derived
xfree(ctrlp);
return;
}
- debug(6,5)("file_open: FD %d\n", fd);
+ debug(6, 5) ("file_open: FD %d\n", fd);
commSetCloseOnExec(fd);
fd_open(fd, FD_FILE, ctrlp->path);
fde = &fd_table[fd];
return;
}
fd_close(fd);
- debug(6,5)("file_close: FD %d\n", fd);
+ debug(6, 5) ("file_close: FD %d\n", fd);
#if USE_ASYNC_IO
aioClose(fd);
#else
FD_ENTRY *fde = &fd_table[fd];
if (len < 0)
return;
- assert (type == FD_READ || type == FD_WRITE);
+ assert(type == FD_READ || type == FD_WRITE);
if (type == FD_READ)
fde->bytes_read += len;
else
/*
- * $Id: fqdncache.cc,v 1.56 1997/06/17 04:54:09 wessels Exp $
+ * $Id: fqdncache.cc,v 1.57 1997/06/26 22:35:46 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
static void fqdncacheLockEntry _PARAMS((fqdncache_entry * f));
static void fqdncacheUnlockEntry _PARAMS((fqdncache_entry * f));
-static hash_table * fqdn_table = NULL;
+static hash_table *fqdn_table = NULL;
static struct fqdncacheQueueData *fqdncacheQueueHead = NULL;
static struct fqdncacheQueueData **fqdncacheQueueTailP = &fqdncacheQueueHead;
/*
- * $Id: http.cc,v 1.174 1997/06/19 22:51:51 wessels Exp $
+ * $Id: http.cc,v 1.175 1997/06/26 22:35:49 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
url = entry ? entry->url : urlCanonical(orig_request, NULL);
sprintf(ybuf, "Cache-control: Max-age=%d", (int) getMaxAge(url));
httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz);
-if (request->urlpath) {
- assert(strstr(url, request->urlpath));
-}
+ if (request->urlpath) {
+ assert(strstr(url, request->urlpath));
+ }
}
httpAppendRequestHeader(hdr_out, null_string, &len, out_sz);
put_free_4k_page(xbuf);
/*
- * $Id: ipcache.cc,v 1.124 1997/06/18 00:19:56 wessels Exp $
+ * $Id: ipcache.cc,v 1.125 1997/06/26 22:35:53 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
static void ipcacheChangeKey _PARAMS((ipcache_entry * i));
static ipcache_addrs static_addrs;
-static hash_table * ip_table = NULL;
+static hash_table *ip_table = NULL;
static struct ipcacheQueueData *ipcacheQueueHead = NULL;
static struct ipcacheQueueData **ipcacheQueueTailP = &ipcacheQueueHead;
static int queue_length = 0;
debug(14, 0) ("ipcache_release: Could not find key '%s'\n", i->name);
return;
}
- assert (i == (ipcache_entry *) table_entry);
+ assert(i == (ipcache_entry *) table_entry);
if (i->locks) {
i->expires = squid_curtime;
ipcacheChangeKey(i);
i->lastref = squid_curtime;
ipcacheLockEntry(i);
while (i->pending_head != NULL) {
- p = i->pending_head;
- i->pending_head = p->next;
- if (p->handler) {
- nhandler++;
- dns_error_message = i->error_message;
- if (cbdataValid(p->handlerData)) {
- p->handler(i->status == IP_CACHED ? &i->addrs : NULL,
- p->handlerData);
+ p = i->pending_head;
+ i->pending_head = p->next;
+ if (p->handler) {
+ nhandler++;
+ dns_error_message = i->error_message;
+ if (cbdataValid(p->handlerData)) {
+ p->handler(i->status == IP_CACHED ? &i->addrs : NULL,
+ p->handlerData);
}
- cbdataUnlock(p->handlerData);
- }
- safe_free(p);
+ cbdataUnlock(p->handlerData);
+ }
+ safe_free(p);
}
- i->pending_head = NULL; /* nuke list */
+ i->pending_head = NULL; /* nuke list */
debug(14, 10) ("ipcache_call_pending: Called %d handlers.\n", nhandler);
ipcacheUnlockEntry(i);
}
int n = 0;
debug(14, 3) ("ipcacheUnregister: FD %d, name '%s'\n", name);
if ((i = ipcache_get(name)) == NULL)
- return 0;
+ return 0;
if (i->status == IP_PENDING || i->status == IP_DISPATCHED) {
- for (p = i->pending_head; p; p = p->next) {
- if (p->handlerData != data)
- continue;
- p->handler = NULL;
- n++;
- }
+ for (p = i->pending_head; p; p = p->next) {
+ if (p->handlerData != data)
+ continue;
+ p->handler = NULL;
+ n++;
+ }
}
if (n == 0)
- debug_trap("ipcacheUnregister: callback data not found");
+ debug_trap("ipcacheUnregister: callback data not found");
debug(14, 3) ("ipcacheUnregister: unregistered %d handlers\n", n);
return n;
}
/*
- * $Id: multicast.cc,v 1.1 1997/06/16 22:02:04 wessels Exp $
+ * $Id: multicast.cc,v 1.2 1997/06/26 22:35:54 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Martin Hamilton
debug(1, 0) ("vizSock on FD %d, ttl=%d\n", vizSock, (int) ttl);
}
#else
- debug(1, 0) ("vizSock: Could not join multicast group\n");
+ debug(1, 0) ("vizSock: Could not join multicast group\n");
#endif
}
/*
- * $Id: net_db.cc,v 1.43 1997/06/24 20:24:20 wessels Exp $
+ * $Id: net_db.cc,v 1.44 1997/06/26 22:35:55 wessels Exp $
*
* DEBUG: section 37 Network Measurement Database
* AUTHOR: Duane Wessels
#if USE_ICMP
-static hash_table * addr_table = NULL;
-static hash_table * host_table = NULL;
+static hash_table *addr_table = NULL;
+static hash_table *host_table = NULL;
static struct in_addr networkFromInaddr _PARAMS((struct in_addr a));
static void netdbRelease _PARAMS((netdbEntry * n));
/*
- * $Id: peer_select.cc,v 1.15 1997/06/21 02:38:13 wessels Exp $
+ * $Id: peer_select.cc,v 1.16 1997/06/26 22:35:56 wessels Exp $
*
* DEBUG: section 44 Peer Selection Algorithm
* AUTHOR: Duane Wessels
entry->ping_status = PING_DONE;
}
if (cbdataValid(data))
- psstate->callback(p, data);
+ psstate->callback(p, data);
cbdataUnlock(data);
peerSelectStateFree(psstate);
}
debug(44, 1) (" never_direct = %d\n", psstate->never_direct);
debug(44, 1) (" timeout = %d\n", psstate->icp.timeout);
if (cbdataValid(data))
- psstate->fail_callback(NULL, data);
+ psstate->fail_callback(NULL, data);
cbdataUnlock(data);
peerSelectStateFree(psstate);
}
/*
- * $Id: stat.cc,v 1.145 1997/06/21 02:38:16 wessels Exp $
+ * $Id: stat.cc,v 1.146 1997/06/26 22:35:57 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
debug(18, 5) ("stat_init: Initializing...\n");
obj = xcalloc(1, sizeof(cacheinfo));
if (logfilename)
- accessLogOpen(logfilename);
+ accessLogOpen(logfilename);
obj->proto_id = urlParseProtocol;
obj->proto_newobject = proto_newobject;
obj->proto_purgeobject = proto_purgeobject;
/*
- * $Id: store.cc,v 1.262 1997/06/21 04:55:58 wessels Exp $
+ * $Id: store.cc,v 1.263 1997/06/26 22:36:00 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
* swapfiles back to StoreEntrys, we don't know the state
* of the entry using that file. */
/* We'll assume the existing entry is valid, probably because
- were in a slow rebuild and the the swap file number got taken
- and the validation procedure hasn't run. */
+ * were in a slow rebuild and the the swap file number got taken
+ * and the validation procedure hasn't run. */
assert(RB->need_to_validate);
RB->clashcount++;
continue;
list = list->next;
e = (StoreEntry *) hash_lookup(store_table, curr->key);
if (e && !BIT_TEST(e->flag, ENTRY_VALIDATED)) {
- storeLockObject(e);
+ storeLockObject(e);
storeValidate(e, storeCleanupComplete, e);
if ((++validnum & 0xFFF) == 0)
debug(20, 1) (" %7d Entries Validated so far.\n", validnum);
assert(mem != NULL);
safe_free(mem->e_abort_msg);
if (msg)
- mem->e_abort_msg = xstrdup(msg);
+ mem->e_abort_msg = xstrdup(msg);
debug(20, 6) ("storeAbort: %s %s\n", log_tags[abort_code], e->key);
storeNegativeCache(e);
storeReleaseRequest(e);
storeRegisterAbort(StoreEntry * e, STABH * cb, void *data)
{
MemObject *mem = e->mem_obj;
+ debug(0, 0) ("storeRegisterAbort: %s\n", e->url);
assert(mem);
assert(mem->abort.callback == NULL);
mem->abort.callback = cb;
storeUnregisterAbort(StoreEntry * e)
{
MemObject *mem = e->mem_obj;
+ debug(0, 0) ("storeUnregisterAbort: %s\n", e->url);
assert(mem);
mem->abort.callback = NULL;
}