From: wessels <> Date: Fri, 27 Jun 1997 04:35:35 +0000 (+0000) Subject: gindent X-Git-Tag: SQUID_3_0_PRE1~4913 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=365e5b3440022c371f19e4bd3ba143e305a472d5;p=thirdparty%2Fsquid.git gindent --- diff --git a/src/access_log.cc b/src/access_log.cc index eb0b05ae66..92900f4d8d 100644 --- a/src/access_log.cc +++ b/src/access_log.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -245,18 +245,18 @@ accessLogClose(void) 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) diff --git a/src/acl.cc b/src/acl.cc index 8c35c634ab..38529b9f73 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -1216,7 +1216,7 @@ aclChecklistFree(aclCheck_t * checklist) 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); @@ -1227,7 +1227,7 @@ aclCheckCallback(aclCheck_t * checklist, int answer) { 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; diff --git a/src/cbdata.cc b/src/cbdata.cc index 4dc6513f28..4838cda3b2 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -1,3 +1,4 @@ + /* DEBUG: 45 */ #include "squid.h" diff --git a/src/client.cc b/src/client.cc index aac5315116..3b8832f604 100644 --- a/src/client.cc +++ b/src/client.cc @@ -1,6 +1,7 @@ + /* - * $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 diff --git a/src/client_db.cc b/src/client_db.cc index 6e7629fd6b..25d859bd05 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -43,7 +43,7 @@ typedef struct _client_info { 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 * diff --git a/src/comm.cc b/src/comm.cc index ed5f9c97bd..951c63c86f 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -278,7 +278,7 @@ comm_open(int sock_type, 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)) @@ -365,7 +365,7 @@ commConnectCallback(ConnectStateData * cs, int status) comm_remove_close_handler(fd, commConnectFree, cs); commConnectFree(fd, cs); if (cbdataValid(data)) - callback(fd, status, data); + callback(fd, status, data); cbdataUnlock(data); } @@ -374,7 +374,7 @@ commConnectFree(int fdunused, void *data) { ConnectStateData *cs = data; if (cs->locks) - ipcacheUnregister(cs->host, cs); + ipcacheUnregister(cs->host, cs); safe_free(cs->host); cbdataFree(cs); } @@ -475,7 +475,7 @@ comm_connect_addr(int sock, const struct sockaddr_in *address) 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 @@ -1079,7 +1079,7 @@ commSetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t 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; diff --git a/src/disk.cc b/src/disk.cc index 526e8b34c0..0aa3b2fe27 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -192,7 +192,7 @@ file_open_complete(void *data, int fd, int errcode) 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]; @@ -218,7 +218,7 @@ file_close(int 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 diff --git a/src/fd.cc b/src/fd.cc index ab7363e1f4..523d054cae 100644 --- a/src/fd.cc +++ b/src/fd.cc @@ -56,7 +56,7 @@ fd_bytes(int fd, int len, unsigned int type) 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 diff --git a/src/fqdncache.cc b/src/fqdncache.cc index 18db605ee0..0a3e8698ed 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -158,7 +158,7 @@ static void fqdncacheChangeKey _PARAMS((fqdncache_entry * i)); 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; diff --git a/src/http.cc b/src/http.cc index 19c52e8ac9..f21b77f545 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -750,9 +750,9 @@ httpBuildRequestHeader(request_t * request, 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); diff --git a/src/ipcache.cc b/src/ipcache.cc index d378dd724e..6ee9d7710f 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -158,7 +158,7 @@ static void ipcacheNudgeQueue _PARAMS((void)); 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; @@ -242,7 +242,7 @@ ipcache_release(ipcache_entry * i) 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); @@ -450,20 +450,20 @@ ipcache_call_pending(ipcache_entry * 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); } @@ -788,17 +788,17 @@ ipcacheUnregister(const char *name, void *data) 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; } diff --git a/src/multicast.cc b/src/multicast.cc index a3d8438a91..9376946773 100644 --- a/src/multicast.cc +++ b/src/multicast.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -106,6 +106,6 @@ mcastJoinVizSock(void) 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 } diff --git a/src/net_db.cc b/src/net_db.cc index d1cd7c6afc..4dee0cb5a3 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -33,8 +33,8 @@ #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)); diff --git a/src/peer_select.cc b/src/peer_select.cc index d3c5959a20..0d9842ac2c 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -181,7 +181,7 @@ peerSelectCallback(ps_state * psstate, peer * p) entry->ping_status = PING_DONE; } if (cbdataValid(data)) - psstate->callback(p, data); + psstate->callback(p, data); cbdataUnlock(data); peerSelectStateFree(psstate); } @@ -197,7 +197,7 @@ peerSelectCallbackFail(ps_state * 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); } diff --git a/src/stat.cc b/src/stat.cc index 2d07d059b6..033de6dcff 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -880,7 +880,7 @@ stat_init(cacheinfo ** object, const char *logfilename) 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; diff --git a/src/store.cc b/src/store.cc index e0fdcc0d0a..7aa262fcca 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -1395,8 +1395,8 @@ storeDoRebuildFromDisk(void *data) * 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; @@ -1470,7 +1470,7 @@ storeCleanup(void *data) 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); @@ -1670,7 +1670,7 @@ storeAbort(StoreEntry * e, log_type abort_code, const char *msg, int cbflag) 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); @@ -2757,6 +2757,7 @@ void 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; @@ -2767,6 +2768,7 @@ void storeUnregisterAbort(StoreEntry * e) { MemObject *mem = e->mem_obj; + debug(0, 0) ("storeUnregisterAbort: %s\n", e->url); assert(mem); mem->abort.callback = NULL; }