]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent
authorwessels <>
Fri, 27 Jun 1997 04:35:35 +0000 (04:35 +0000)
committerwessels <>
Fri, 27 Jun 1997 04:35:35 +0000 (04:35 +0000)
16 files changed:
src/access_log.cc
src/acl.cc
src/cbdata.cc
src/client.cc
src/client_db.cc
src/comm.cc
src/disk.cc
src/fd.cc
src/fqdncache.cc
src/http.cc
src/ipcache.cc
src/multicast.cc
src/net_db.cc
src/peer_select.cc
src/stat.cc
src/store.cc

index eb0b05ae66101aa9f4b009b1b0858fac819030b7..92900f4d8de68cdf67078bd6715d4e01fce4a816 100644 (file)
@@ -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)
index 8c35c634ab7569de011e713ffa5896d51945307c..38529b9f735608618f737268c05f93d58c01d063 100644 (file)
@@ -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;
index 4dc6513f28f20f36dd7f4bbf61ea0f3d1edafc33..4838cda3b29fcb9a966f5bb48d5795334a923776 100644 (file)
@@ -1,3 +1,4 @@
+
 /* DEBUG: 45 */
 
 #include "squid.h"
index aac5315116ba85599c8d148ea06b1623a961f3a5..3b8832f6047f6ced5556f185f68b68e23ddcc58f 100644 (file)
@@ -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
index 6e7629fd6b6abdcc059d1730825ecbb3fec93c24..25d859bd05b40ad712b2ac37e79592dc6300fb66 100644 (file)
@@ -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 *
index ed5f9c97bd12c769e8e750ac0a223ec53fa34f90..951c63c86f796680339b561122f2cefe06f9d222 100644 (file)
@@ -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;
index 526e8b34c085ddb365ca6afa146af67676756a69..0aa3b2fe27f979ae0ffd717e4b3047551bac8f83 100644 (file)
@@ -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
index ab7363e1f46caca9b61b2744c70d0dfc05fc1500..523d054cae96a77caafa031ecfec1724c778ae19 100644 (file)
--- 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
index 18db605ee043adbce524460d898be0f05df476a2..0a3e8698eddac0129cdc462ef7fbf67c0d83fe14 100644 (file)
@@ -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;
 
index 19c52e8ac947eae2b538a77c49f9d6a257770ff6..f21b77f545482b53eb27e7b48603ba5efd7947ff 100644 (file)
@@ -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);
index d378dd724ed424385c6e21863103d8f336856027..6ee9d7710fa40d9bc08fac9ae6ffd2c1dca0ae1d 100644 (file)
@@ -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;
 }
index a3d8438a91543c47cace6e8e5e62157e82f0be0e..93769467731dc5d190ddc50caffe2c08bd38d4b6 100644 (file)
@@ -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
 }
index d1cd7c6afca5c2f4d61b991670da1e81f3689134..4dee0cb5a35e4cd3af07348a8121a4cddac13a63 100644 (file)
@@ -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));
index d3c5959a2004f8500d6fde83638d95cd4b4738b3..0d9842ac2c7c8e4be2d1c58e3040adf75d377b2d 100644 (file)
@@ -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);
 }
index 2d07d059b6d0a7a7bfd44c452e3b63505750c093..033de6dcff14aa5029fb9f677581beaec7f33a73 100644 (file)
@@ -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;
index e0fdcc0d0af032fbfc0119620e85a82295db3493..7aa262fcca69a0bc0a61f1f1571b057af523eec0 100644 (file)
@@ -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;
 }