]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent
authorwessels <>
Tue, 3 Feb 1998 04:16:08 +0000 (04:16 +0000)
committerwessels <>
Tue, 3 Feb 1998 04:16:08 +0000 (04:16 +0000)
30 files changed:
include/snmp.h
include/snmp_api.h
lib/GNUregex.c
lib/md5.c
lib/rfc1123.c
lib/rfc1738.c
lib/safe_inet_addr.c
lib/stub_memaccount.c
lib/util.c
src/asn.cc
src/client.cc
src/client_side.cc
src/comm.cc
src/disk.cc
src/dns.cc
src/dnsserver.cc
src/fd.cc
src/ftp.cc
src/ipc.cc
src/protos.h
src/recv-announce.cc
src/redirect.cc
src/squid.h
src/stat.cc
src/stmem.cc
src/store.cc
src/structs.h
src/tools.cc
src/typedefs.h
src/unlinkd.cc

index dc4838dd3b1988f69ea6703508989424d6ab46fe..2c2155ac4807e85601481d4fb25f053aaf18bb6c 100644 (file)
@@ -138,4 +138,3 @@ extern int snmp_synch_response(struct snmp_session *ss,
  */
 extern void md5Digest(u_char * msg, int length, u_char * key, u_char * digest);
 extern int parse_app_community_string(struct snmp_session *session);
-
index 3715bee588b529404812b7514ec0f612fda56fbe..186cfcc73aa4750d23ee3920872503b855bea96c 100644 (file)
@@ -1,3 +1,4 @@
+
 /***********************************************************
        Copyright 1989 by Carnegie Mellon University
 
index 54b846c2aa012e767f0f1bde140a7f9df6afb273..ee5ff3197f59f01685309bfe4ebc96752c109a4e 100644 (file)
@@ -2483,7 +2483,7 @@ re_compile_fastmap(bufp)
     assert(fastmap != NULL && p != NULL);
 
     INIT_FAIL_STACK();
-    memset(fastmap, 0,  1 << BYTEWIDTH);       /* Assume nothing's valid.  */
+    memset(fastmap, 0, 1 << BYTEWIDTH);                /* Assume nothing's valid.  */
     bufp->fastmap_accurate = 1;        /* It will be when we're done.  */
     bufp->can_be_null = 0;
 
index 60b9cc4e09b715784a5fac05c0592423df30548e..216e13d4ddb326d2225d730fe4d0d5fee672931b 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -1,5 +1,7 @@
 
 
+
+
 /* taken from RFC-1321/Appendix A.3 */
 
 /*
index cc207895cce9e4b83a3926a52b8214d7c3f3031b..61122cadb03995f3af500765f93bbdda44ed44e2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: rfc1123.c,v 1.13 1998/01/07 22:45:23 wessels Exp $
+ * $Id: rfc1123.c,v 1.14 1998/02/02 21:16:13 wessels Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -313,7 +313,7 @@ mkhttpdlogtime(const time_t * t)
        day_offset = 1;
 
     len = strftime(buf, 127 - 5, "%d/%b/%Y:%H:%M:%S ", lt);
-    snprintf(buf + len, 128-len, "%+03d%02d",
+    snprintf(buf + len, 128 - len, "%+03d%02d",
        (min_offset / 60) % 24,
        min_offset % 60);
 #else /* USE_GMT */
index b0497d525eb4b3422b2c87f0facfe5b96b1cfd33..f166438248cf0bdd7345c9eda6d5cad729c7e9e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rfc1738.c,v 1.14 1998/01/05 00:57:54 wessels Exp $
+ * $Id: rfc1738.c,v 1.15 1998/02/02 21:16:13 wessels Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -182,7 +182,7 @@ rfc1738_escape(const char *url)
        }
        /* Do the triplet encoding, or just copy the char */
        /* note: we do not need snprintf here as q is appropriately
-           allocated - KA */
+        * allocated - KA */
 
        if (do_escape == 1) {
            (void) sprintf(q, "%%%02x", (unsigned char) *p);
index b58d54f080a24b7a9a63ec076167a12e9fccd16a..f882e6eafe7673f9d331f23ed05c513e5286cc74 100644 (file)
@@ -40,7 +40,7 @@ safe_inet_addr(const char *buf, struct in_addr *addr)
        return 0;
     if (a4 < 0 || a4 > 255)
        return 0;
-    snprintf(addrbuf,32, "%d.%d.%d.%d", a1, a2, a3, a4);
+    snprintf(addrbuf, 32, "%d.%d.%d.%d", a1, a2, a3, a4);
     A.s_addr = inet_addr(addrbuf);
     if (addr)
        addr->s_addr = A.s_addr;
index a012c07b2c762affbac1d5bdce77facd9dd135ac..ff186c029e4b2de60fafa5e62a34d342cead4bb3 100644 (file)
@@ -1,6 +1,7 @@
 /* Stub function for programs not implementing statMemoryAccounted */
 #include <config.h>
-int statMemoryAccounted(void)
+int 
+statMemoryAccounted(void)
 {
-  return -1;
+    return -1;
 }
index 0fb3fc849b655fb6247dfffa956c971f5050ad75..655315ad99153b41e315922231422d8a2b1cb404 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: util.c,v 1.39 1998/01/06 00:27:53 wessels Exp $
+ * $Id: util.c,v 1.40 1998/02/02 21:16:15 wessels Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -260,9 +260,9 @@ static void
 xmalloc_count(void *p, int sign)
 {
     int statMemoryAccounted();
-    static size_t last_total=0,last_accounted=0,last_mallinfo=0;
-    struct mallinfo mp=mallinfo();
-    size_t accounted=statMemoryAccounted();
+    static size_t last_total = 0, last_accounted = 0, last_mallinfo = 0;
+    struct mallinfo mp = mallinfo();
+    size_t accounted = statMemoryAccounted();
     size_t mi = mp.uordblks + mp.usmblks + mp.hblkhd;
     size_t sz;
     static size_t total = 0;
@@ -272,9 +272,9 @@ xmalloc_count(void *p, int sign)
        (int) total - last_total, (int) total,
        (int) accounted - last_accounted, (int) accounted,
        (int) mi - last_mallinfo, (int) mi);
-    last_total=total;
-    last_accounted=accounted;
-    last_mallinfo=mi;
+    last_total = total;
+    last_accounted = accounted;
+    last_mallinfo = mi;
 }
 
 #endif /* XMALLOC_COUNT */
index 27f7ab78d1b950e5e23bc078af85f3e9aa1d4428..4461d06ec13520436dbaba82e453f9ad13810fe3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: asn.cc,v 1.15 1998/02/02 21:14:55 wessels Exp $
+ * $Id: asn.cc,v 1.16 1998/02/02 21:16:17 wessels Exp $
  *
  * DEBUG: section 53    AS Number handling
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -215,7 +215,7 @@ asHandleReply(void *data, char *buf, ssize_t size)
        memFree(MEM_4K_BUF, buf);
        return;
     } else if (size < 0) {
-       debug(50, 1) ("asHandleReply: Called with size=%d.\n", size);
+       debug(50, 1) ("asHandleReply: Called with size=%d.\n", size);
        memFree(MEM_4K_BUF, buf);
        return;
     }
index 10115aecddfcd9c67418a369cd70be55b78cd74d..eed7a46a6195074080374512255e600efb5e925f 100644 (file)
@@ -1,6 +1,7 @@
 
+
 /*
- * $Id: client.cc,v 1.49 1998/01/12 04:30:36 wessels Exp $
+ * $Id: client.cc,v 1.50 1998/02/02 21:16:18 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
index c0f929b7d92762e174c24106ad7d483ad9089386..7d576d1cf157c2cfadda3d5953451ec67eec55d6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.201 1998/02/02 21:14:57 wessels Exp $
+ * $Id: client_side.cc,v 1.202 1998/02/02 21:16:19 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -283,7 +283,7 @@ clientProcessExpired(void *data)
     http->out.offset = 0;
     protoDispatch(http->conn->fd, http->entry, http->request);
     /* Register with storage manager to receive updates when data comes in. */
-    if(entry->store_status == STORE_ABORTED)
+    if (entry->store_status == STORE_ABORTED)
        debug(33, 0) ("clientProcessExpired: entry->swap_status == STORE_ABORTED\n");
     storeClientCopy(entry,
        http->out.offset,
@@ -344,7 +344,7 @@ clientHandleIMSReply(void *data, char *buf, ssize_t size)
        entry->refcount++;
     } else if (mem->reply->code == 0) {
        debug(33, 3) ("clientHandleIMSReply: Incomplete headers for '%s'\n", url);
-        if(entry->store_status == STORE_ABORTED)
+       if (entry->store_status == STORE_ABORTED)
            debug(33, 0) ("clientHandleIMSReply: entry->swap_status == STORE_ABORTED\n");
        storeClientCopy(entry,
            http->out.offset + size,
@@ -393,7 +393,7 @@ clientHandleIMSReply(void *data, char *buf, ssize_t size)
     /* use clientCacheHit() here as the callback because we might
      * be swapping in from disk, and the file might not really be
      * there */
-    if(entry->store_status == STORE_ABORTED) {
+    if (entry->store_status == STORE_ABORTED) {
        debug(33, 0) ("clientHandleIMSReply: IMS swapin failed on aborted object\n");
        http->log_type = LOG_TCP_SWAPFAIL_MISS;
        clientProcessMiss(http);
@@ -513,17 +513,17 @@ checkNegativeHit(StoreEntry * e)
 }
 
 void
-clientUpdateCounters(clientHttpRequest *http)
+clientUpdateCounters(clientHttpRequest * http)
 {
-       Counter.client_http.requests++;
-       kb_incr(&Counter.client_http.kbytes_in, http->req_sz);
-       kb_incr(&Counter.client_http.kbytes_out, http->out.size);
-        if (isTcpHit(http->log_type)) {
-           Counter.client_http.hits++;
-           kb_incr(&Counter.client_http.hit_kbytes_out, http->out.size);
-       }
-       if (http->request->err_type != ERR_NONE)
-           Counter.client_http.errors++;
+    Counter.client_http.requests++;
+    kb_incr(&Counter.client_http.kbytes_in, http->req_sz);
+    kb_incr(&Counter.client_http.kbytes_out, http->out.size);
+    if (isTcpHit(http->log_type)) {
+       Counter.client_http.hits++;
+       kb_incr(&Counter.client_http.hit_kbytes_out, http->out.size);
+    }
+    if (http->request->err_type != ERR_NONE)
+       Counter.client_http.errors++;
 }
 
 static void
@@ -946,7 +946,7 @@ clientSendMoreData(void *data, char *buf, ssize_t size)
            debug(12, 3) ("clientSendMoreData: Appending %d bytes after headers\n",
                (int) (size - hdrlen));
            if (((size - hdrlen) + l) > 8192) {
-               debug(0,0) ("Size, hdrlen, l %d, %d, %d\n", size, hdrlen, l);
+               debug(0, 0) ("Size, hdrlen, l %d, %d, %d\n", size, hdrlen, l);
                return;
            }
            xmemcpy(newbuf + l, buf + hdrlen, size - hdrlen);
@@ -1023,7 +1023,7 @@ clientWriteComplete(int fd, char *bufnotused, size_t size, int errflag, void *da
            if ((http = conn->chr) != NULL) {
                debug(12, 1) ("clientWriteComplete: FD %d Sending next request\n", fd);
                if (!storeClientCopyPending(http->entry, http)) {
-                   if(entry->store_status == STORE_ABORTED)
+                   if (entry->store_status == STORE_ABORTED)
                        debug(33, 0) ("clientWriteComplete: entry->swap_status == STORE_ABORTED\n");
                    storeClientCopy(http->entry,
                        http->out.offset,
@@ -1051,7 +1051,7 @@ clientWriteComplete(int fd, char *bufnotused, size_t size, int errflag, void *da
     } else {
        /* More data will be coming from primary server; register with 
         * storage manager. */
-       if(entry->store_status == STORE_ABORTED)
+       if (entry->store_status == STORE_ABORTED)
            debug(33, 0) ("clientWriteComplete 2: entry->swap_status == STORE_ABORTED\n");
        storeClientCopy(entry,
            http->out.offset,
@@ -1085,7 +1085,7 @@ clientGetHeadersForIMS(void *data, char *buf, ssize_t size)
            return;
        }
        /* All headers are not yet available, wait for more data */
-       if(entry->store_status == STORE_ABORTED)
+       if (entry->store_status == STORE_ABORTED)
            debug(33, 0) ("clientGetHeadersForIMS: entry->swap_status == STORE_ABORTED\n");
        storeClientCopy(entry,
            http->out.offset + size,
@@ -1121,7 +1121,7 @@ clientGetHeadersForIMS(void *data, char *buf, ssize_t size)
     http->log_type = LOG_TCP_IMS_HIT;
     entry->refcount++;
     if (modifiedSince(entry, http->request)) {
-       if(entry->store_status == STORE_ABORTED)
+       if (entry->store_status == STORE_ABORTED)
            debug(33, 0) ("clientGetHeadersForIMS 2: entry->swap_status == STORE_ABORTED\n");
        storeClientCopy(entry,
            http->out.offset,
@@ -1273,7 +1273,7 @@ clientProcessRequest(clientHttpRequest * http)
     case LOG_TCP_NEGATIVE_HIT:
     case LOG_TCP_MEM_HIT:
        entry->refcount++;      /* HIT CASE */
-       if(entry->store_status == STORE_ABORTED)
+       if (entry->store_status == STORE_ABORTED)
            debug(33, 0) ("clientProcessRequest: entry->swap_status == STORE_ABORTED\n");
        storeClientCopy(entry,
            http->out.offset,
@@ -1284,7 +1284,7 @@ clientProcessRequest(clientHttpRequest * http)
            http);
        break;
     case LOG_TCP_IMS_MISS:
-       if(entry->store_status == STORE_ABORTED)
+       if (entry->store_status == STORE_ABORTED)
            debug(33, 0) ("clientProcessRequest 2: entry->swap_status == STORE_ABORTED\n");
        storeClientCopy(entry,
            http->out.offset,
index 31c700489d736075905e129b3c54b1d02da22377..3d4c9127049fd8d72a9f43e886bd0caffd51ac69 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.223 1998/02/02 21:14:58 wessels Exp $
+ * $Id: comm.cc,v 1.224 1998/02/02 21:16:20 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -330,7 +330,7 @@ commConnectDnsHandle(const ipcache_addrs * ia, void *data)
        debug(5, 3) ("commConnectDnsHandle: Unknown host: %s\n", cs->host);
        if (!dns_error_message) {
            dns_error_message = "Unknown DNS error";
-           debug(5,1) ("commConnectDnsHandle: Bad dns_error_message\n");
+           debug(5, 1) ("commConnectDnsHandle: Bad dns_error_message\n");
        }
        assert(dns_error_message != NULL);
        commConnectCallback(cs, COMM_ERR_DNS);
@@ -625,7 +625,7 @@ comm_close(int fd)
     F = &fd_table[fd];
     if (EBIT_TEST(F->flags, FD_CLOSING))
        return;
-    if(shutdown_pending && (!F->open || F->type == FD_FILE))
+    if (shutdown_pending && (!F->open || F->type == FD_FILE))
        return;
     assert(F->open);
     assert(F->type != FD_FILE);
@@ -739,18 +739,18 @@ comm_poll_incoming(void)
        if (((revents = pfds[i].revents) == 0) || ((fd = pfds[i].fd) == -1))
            continue;
        if (revents & (POLLRDNORM | POLLIN | POLLHUP | POLLERR)) {
-           if(hdl = fd_table[fd].read_handler) {
+           if (hdl = fd_table[fd].read_handler) {
                fd_table[fd].read_handler = NULL;
                hdl(fd, fd_table[fd].read_data);
            } else
-               debug(5,1) ("comm_poll_incoming: NULL read handler\n");
+               debug(5, 1) ("comm_poll_incoming: NULL read handler\n");
        }
        if (revents & (POLLWRNORM | POLLOUT | POLLHUP | POLLERR)) {
-           if(hdl = fd_table[fd].write_handler) {
+           if (hdl = fd_table[fd].write_handler) {
                fd_table[fd].write_handler = NULL;
                hdl(fd, fd_table[fd].write_data);
            } else
-               debug(5,1) ("comm_poll_incoming: NULL write handler\n");
+               debug(5, 1) ("comm_poll_incoming: NULL write handler\n");
        }
     }
     /* TO FIX: repoll ICP connection here */
@@ -811,19 +811,19 @@ comm_select_incoming(void)
     for (i = 0; i < N; i++) {
        fd = fds[i];
        if (FD_ISSET(fd, &read_mask)) {
-           if((hdl = fd_table[fd].read_handler) != NULL) {
+           if ((hdl = fd_table[fd].read_handler) != NULL) {
                fd_table[fd].read_handler = NULL;
                hdl(fd, fd_table[fd].read_data);
            } else {
-               debug(5,1) ("comm_select_incoming: NULL read handler\n");
+               debug(5, 1) ("comm_select_incoming: NULL read handler\n");
            }
        }
        if (FD_ISSET(fd, &write_mask)) {
-           if((hdl = fd_table[fd].write_handler) != NULL) {
+           if ((hdl = fd_table[fd].write_handler) != NULL) {
                fd_table[fd].write_handler = NULL;
                hdl(fd, fd_table[fd].write_data);
            } else {
-               debug(5,1) ("comm_select_incoming: NULL write handler\n");
+               debug(5, 1) ("comm_select_incoming: NULL write handler\n");
            }
        }
     }
@@ -979,7 +979,7 @@ comm_poll(time_t sec)
                F->timeout_handler = NULL;
                F->read_handler = NULL;
                F->write_handler = NULL;
-               if(F->open != 0)
+               if (F->open != 0)
                    fd_close(fd);
            }
            lastinc = polledinc;
@@ -1417,9 +1417,9 @@ comm_write(int fd, char *buf, int size, CWCB * handler, void *handler_data, FREE
     debug(5, 5) ("comm_write: FD %d: sz %d: hndl %p: data %p.\n",
        fd, size, handler, handler_data);
     if (fd_table[fd].rwstate) {
-       debug(5,1) ("comm_write: fd_table[%d].rwstate != NULL", fd);
+       debug(5, 1) ("comm_write: fd_table[%d].rwstate != NULL", fd);
        state = fd_table[fd].rwstate;
-       debug(5,1) ("comm_write: %d'%s',(%d,%d)'%s'\n", size, buf, state->size,
+       debug(5, 1) ("comm_write: %d'%s',(%d,%d)'%s'\n", size, buf, state->size,
            state->offset, state->buf);
        safe_free(fd_table[fd].rwstate);
        fd_table[fd].rwstate = NULL;
index b6d415ccbba3ccbf8b23a74ef2294524816e3fd1..aa84df18ccd481825117ab7175be2c3e3dd19045 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: disk.cc,v 1.97 1998/02/02 21:14:59 wessels Exp $
+ * $Id: disk.cc,v 1.98 1998/02/02 21:16:21 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -169,7 +169,7 @@ file_open_complete(void *data, int fd, int errcode)
 {
     open_ctrl_t *ctrlp = (open_ctrl_t *) data;
 
-    if(fd == -2 && errcode == -2) {    /* Cancelled - clean up */
+    if (fd == -2 && errcode == -2) {   /* Cancelled - clean up */
        if (ctrlp->callback)
            (ctrlp->callback) (ctrlp->callback_data, fd, errcode);
        xfree(ctrlp->path);
@@ -200,7 +200,7 @@ void
 file_close(int fd)
 {
     fde *F = &fd_table[fd];
-    if(fd < 0) {
+    if (fd < 0) {
        debug(6, 0) ("file_close: FD less than zero: %d\n", fd);
        return;
     }
@@ -293,7 +293,7 @@ diskHandleWriteComplete(void *data, int len, int errcode)
     if (q == NULL)             /* Someone aborted then write completed */
        return;
 
-    if(len == -2 && errcode == -2) {   /* Write cancelled - cleanup */
+    if (len == -2 && errcode == -2) {  /* Write cancelled - cleanup */
        do {
            fdd->write_q = q->next;
            if (q->free)
@@ -302,7 +302,6 @@ diskHandleWriteComplete(void *data, int len, int errcode)
        } while ((q = fdd->write_q));
        return;
     }
-
     fd_bytes(fd, len, FD_WRITE);
     if (len < 0) {
        if (!ignoreErrno(errno)) {
@@ -443,12 +442,11 @@ diskHandleReadComplete(void *data, int len, int errcode)
 
     xfree(data);
 
-    if(len == -2 && errcode == -2) {   /* Read cancelled - cleanup */
+    if (len == -2 && errcode == -2) {  /* Read cancelled - cleanup */
        cbdataUnlock(ctrl_dat->client_data);
        safe_free(ctrl_dat);
        return;
     }
-
     fd_bytes(fd, len, FD_READ);
     if (len < 0) {
        if (ignoreErrno(errno)) {
index 133b2b1650fc42ff7a73d1182e2d677b78177768..c2c761858f203bb936aa08146698eb312a2e92f2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dns.cc,v 1.52 1998/01/31 05:31:55 wessels Exp $
+ * $Id: dns.cc,v 1.53 1998/02/02 21:16:22 wessels Exp $
  *
  * DEBUG: section 34    Dnsserver interface
  * AUTHOR: Harvest Derived
@@ -169,12 +169,12 @@ dnsOpenServers(void)
     for (k = 0; k < N; k++) {
        dns_child_table[k] = xcalloc(1, sizeof(dnsserver_t));
        cbdataAdd(dns_child_table[k], MEM_NONE);
-        x = ipcCreate(IPC_TCP_SOCKET,
-               prg,
-               args,
-               "dnsserver",
-               &rfd,
-               &wfd);
+       x = ipcCreate(IPC_TCP_SOCKET,
+           prg,
+           args,
+           "dnsserver",
+           &rfd,
+           &wfd);
        if (x < 0) {
            debug(34, 1) ("dnsOpenServers: WARNING: Failed to start 'dnsserver' #%d.\n", k + 1);
            EBIT_CLR(dns_child_table[k]->flags, HELPER_ALIVE);
@@ -199,7 +199,7 @@ dnsOpenServers(void)
            snprintf(fd_note_buf, FD_DESC_SZ, "%s #%d", s, dns_child_table[k]->id);
            fd_note(dns_child_table[k]->inpipe, fd_note_buf);
            commSetNonBlocking(dns_child_table[k]->inpipe);
-           debug(34, 3) ("dnsOpenServers: 'dns_server' %d started\n", k+1);
+           debug(34, 3) ("dnsOpenServers: 'dns_server' %d started\n", k + 1);
            NDnsServersAlloc++;
        }
     }
index 6bafcb9c88e4d633fdf0624a4c5f8dd7427275e9..04b96efd81eebe91fe07bc97b80aa41017a1dca0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dnsserver.cc,v 1.40 1998/01/31 05:31:56 wessels Exp $
+ * $Id: dnsserver.cc,v 1.41 1998/02/02 21:16:23 wessels Exp $
  *
  * DEBUG: section 0     DNS Resolver
  * AUTHOR: Harvest Derived
@@ -313,9 +313,9 @@ main(int argc, char *argv[])
 
        /* read from ipcache */
        if (fgets(request, REQ_SZ, stdin) == NULL) {
-fprintf(stderr, "dnsserver %d got EOF\n", (int) getpid());
+           fprintf(stderr, "dnsserver %d got EOF\n", (int) getpid());
            exit(1);
-        }
+       }
        t = strrchr(request, '\n');
        if (t == NULL)          /* Ignore if no newline */
            continue;
index 8a451e324953966ef10f6ce4c0fb733bf81403f9..7f2c5287ee1b282f44c45227ecac20d5cbb148d9 100644 (file)
--- a/src/fd.cc
+++ b/src/fd.cc
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fd.cc,v 1.18 1998/02/02 21:15:01 wessels Exp $
+ * $Id: fd.cc,v 1.19 1998/02/02 21:16:24 wessels Exp $
  *
  * DEBUG: section 51    Filedescriptor Functions
  * AUTHOR: Duane Wessels
@@ -41,13 +41,13 @@ fdUpdateBiggest(int fd, unsigned int status)
     assert(fd < Squid_MaxFD);
     if (fd > Biggest_FD) {
        if (status != FD_OPEN)
-           debug(51,1) ("fdUpdateBiggest: status != FD_OPEN\n");
+           debug(51, 1) ("fdUpdateBiggest: status != FD_OPEN\n");
        Biggest_FD = fd;
        return;
     }
     /* if we are here, then fd == Biggest_FD */
     if (status != FD_CLOSE)
-       debug(51,1) ("fdUpdateBiggest: status != FD_CLOSE\n");
+       debug(51, 1) ("fdUpdateBiggest: status != FD_CLOSE\n");
     while (fd_table[Biggest_FD].open != FD_OPEN)
        Biggest_FD--;
 }
@@ -71,7 +71,7 @@ fd_open(int fd, unsigned int type, const char *desc)
 {
     fde *F = &fd_table[fd];
     assert(fd >= 0);
-    if(F->open != 0) {
+    if (F->open != 0) {
        debug(51, 1) ("WARNING: Closing open FD %4d\n", fd);
        fd_close(fd);
     }
index 61fc64c3bfd064b2ddb215822421337311c1d5fe..fb91659a613b04172b20265e5b21268e9e41020a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.188 1998/02/02 19:50:10 wessels Exp $
+ * $Id: ftp.cc,v 1.189 1998/02/02 21:16:25 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -346,7 +346,7 @@ ftpListingFinish(FtpStateData * ftpState)
     storeAppendPrintf(e, "</PRE>\n");
     if (EBIT_TEST(ftpState->flags, FTP_LISTFORMAT_UNKNOWN) && !EBIT_TEST(ftpState->flags, FTP_TRIED_NLST)) {
        storeAppendPrintf(e, "<A HREF=\"./;type=d\">[As plain directory]</A>\n");
-    } else if (ftpState->typecode=='D') {
+    } else if (ftpState->typecode == 'D') {
        storeAppendPrintf(e, "<A HREF=\"./\">[As extended directory]</A>\n");
     }
     storeAppendPrintf(e, "<HR>\n");
@@ -416,8 +416,8 @@ ftpListParseParts(const char *buf, int flags)
     xbuf = xstrdup(buf);
     if (EBIT_TEST(flags, FTP_TRIED_NLST)) {
        /* Machine readable format, one name per line */
-       p->name=xbuf;
-       p->type='\0'; 
+       p->name = xbuf;
+       p->type = '\0';
        return p;
     }
     for (t = strtok(xbuf, w_space); t && n_tokens < MAX_TOKENS; t = strtok(NULL, w_space))
@@ -553,9 +553,9 @@ ftpHtmlifyListEntry(char *line, FtpStateData * ftpState)
        return html;
     }
     if ((parts = ftpListParseParts(line, flags)) == NULL) {
-        char *p;
+       char *p;
        snprintf(html, 8192, "%s\n", line);
-       for(p=line;*p && isspace(*p);p++);
+       for (p = line; *p && isspace(*p); p++);
        if (*p && !isspace(*p))
            EBIT_SET(ftpState->flags, FTP_LISTFORMAT_UNKNOWN);
        return html;
index 3c8af7d52b31523ce9e9ea6319ea8610340909d7..171065017c64bf5c9ab597a6281930b478211c8b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipc.cc,v 1.1 1998/01/31 05:34:57 wessels Exp $
+ * $Id: ipc.cc,v 1.2 1998/02/02 21:16:26 wessels Exp $
  *
  * DEBUG: section 54    Interprocess Communication
  * AUTHOR: Duane Wessels
@@ -148,12 +148,11 @@ ipcCreate(int type, const char *prog, char *const args[], const char *name, int
     }
     if (type == IPC_TCP_SOCKET) {
        if (listen(crfd, 1) < 0) {
-           debug(50,1)("ipcCreate: listen FD %d: %s\n", crfd, xstrerror());
+           debug(50, 1) ("ipcCreate: listen FD %d: %s\n", crfd, xstrerror());
            return ipcCloseAllFD(prfd, pwfd, crfd, cwfd);
        }
        debug(54, 3) ("ipcCreate: FD %d listening...\n", crfd);
     }
-
     /* flush or else we get dup data if unbuffered_logs is set */
     logsFlush();
     if ((pid = fork()) < 0) {
@@ -211,10 +210,9 @@ ipcCreate(int type, const char *prog, char *const args[], const char *name, int
        close(crfd);
        cwfd = crfd = fd;
     } else if (type == IPC_UDP_SOCKET) {
-           if (comm_connect_addr(crfd, &PS) == COMM_ERROR)
-               return ipcCloseAllFD(prfd, pwfd, crfd, cwfd);
+       if (comm_connect_addr(crfd, &PS) == COMM_ERROR)
+           return ipcCloseAllFD(prfd, pwfd, crfd, cwfd);
     }
-
     if (type == IPC_UDP_SOCKET) {
        x = send(cwfd, hello_string, strlen(hello_string), 0);
        if (x < 0) {
index 6c5f9046e3991406962d070d48cfc926d4a5e639..a544be2c8e92783d8fb9a8f941029c6b12adf3e6 100644 (file)
@@ -564,7 +564,7 @@ extern void asnInit(void);
 extern void asnFreeMemory(void);
 extern void dlinkAdd(void *data, dlink_node *, dlink_list *);
 extern void dlinkDelete(dlink_node * m, dlink_list * list);
-extern void kb_incr (kb_t *, size_t);
+extern void kb_incr(kb_t *, size_t);
 
 /*
  * prototypes for system functions missing from system includes
@@ -577,11 +577,10 @@ int gethostname(char *, int);
 #endif
 
 extern int ipcCreate(int type,
-       const char *prog,
-       char *const args[],
-       const char *name,
-       int *rfd,
-       int *wfd);
-
-extern int handleConnectionHeader(int, char * , char * );
+    const char *prog,
+    char *const args[],
+    const char *name,
+    int *rfd,
+    int *wfd);
 
+extern int handleConnectionHeader(int, char *, char *);
index 238c2794d780b27e86dcc674d9200dd1fec7e076..b37733ac82b55bf35858c32254ea07b1b202fc55 100644 (file)
@@ -1,6 +1,7 @@
 
+
 /*
- * $Id: recv-announce.cc,v 1.15 1997/12/02 00:17:39 wessels Exp $
+ * $Id: recv-announce.cc,v 1.16 1998/02/02 21:16:28 wessels Exp $
  *
  * DEBUG: section 0     Announcement Server
  * AUTHOR: Harvest Derived
index 57cda8e1bdbb6182a1f10bca2be64f5bf866e383..ad9b68fc7206dcad0024bbc4251607cd09418c98 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: redirect.cc,v 1.53 1998/01/31 05:32:04 wessels Exp $
+ * $Id: redirect.cc,v 1.54 1998/02/02 21:16:29 wessels Exp $
  *
  * DEBUG: section 29    Redirector
  * AUTHOR: Duane Wessels
@@ -314,14 +314,14 @@ redirectOpenServers(void)
        NRedirectors, prg);
     for (k = 0; k < NRedirectors; k++) {
        redirect_child_table[k] = xcalloc(1, sizeof(redirector_t));
-        args[0] = "(redirector)";
-        args[1] = NULL;
-        x = ipcCreate(IPC_TCP_SOCKET,
-               prg,
-               args,
-               "redirector",
-               &redirectsocket,
-               &redirectsocket);
+       args[0] = "(redirector)";
+       args[1] = NULL;
+       x = ipcCreate(IPC_TCP_SOCKET,
+           prg,
+           args,
+           "redirector",
+           &redirectsocket,
+           &redirectsocket);
        if (x < 0) {
            debug(29, 1) ("WARNING: Cannot run '%s' process.\n", prg);
            EBIT_CLR(redirect_child_table[k]->flags, HELPER_ALIVE);
index 0c7984fd3802ad99f770e572bbe71b457f9405aa..2a978d7e81a74858019b0f8c39f89702e2cc114f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.152 1998/01/06 00:28:01 wessels Exp $
+ * $Id: squid.h,v 1.153 1998/02/02 21:16:31 wessels Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -234,6 +234,7 @@ struct rusage {
     int ru_maxrss;
     int ru_majflt;
 };
+
 #endif
 
 #if !defined(HAVE_GETPAGESIZE) && defined(_SQUID_HPUX_)
index 6446f1ec7a79610e8cb3a7679d6eb75c6025bcc6..b7a2141b06cedc7ca6086766034ec9c83a1a358b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.187 1998/02/02 19:50:12 wessels Exp $
+ * $Id: stat.cc,v 1.188 1998/02/02 21:16:32 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -133,7 +133,7 @@ static int NCountHist = 0;
 void
 stat_utilization_get(StoreEntry * e)
 {
-       /* MAKE SOMETHING UP */
+    /* MAKE SOMETHING UP */
 }
 
 void
@@ -686,7 +686,7 @@ statCountersDump(StoreEntry * sentry)
     storeAppendPrintf(sentry, "cpu_time = %f\n",
        f->cputime);
     storeAppendPrintf(sentry, "wall_time = %f\n",
-        tvSubDsec(f->timestamp, current_time));
+       tvSubDsec(f->timestamp, current_time));
 }
 
 #define XAVG(X) (dt ? (double) (f->X - l->X) / dt : 0.0)
@@ -700,8 +700,8 @@ statAvgDump(StoreEntry * sentry, int minutes)
     assert(N_COUNT_HIST > 1);
     assert(minutes > 0);
     f = &CountHist[0];
-    if (minutes > N_COUNT_HIST-1)
-       minutes = N_COUNT_HIST-1;
+    if (minutes > N_COUNT_HIST - 1)
+       minutes = N_COUNT_HIST - 1;
     l = &CountHist[minutes];
     dt = tvSubDsec(l->timestamp, f->timestamp);
     ct = f->cputime - l->cputime;
@@ -731,7 +731,7 @@ statAvgDump(StoreEntry * sentry, int minutes)
        XAVG(select_loops));
     storeAppendPrintf(sentry, "cpu_time = %f seconds\n", ct);
     storeAppendPrintf(sentry, "wall_time = %f seconds\n", dt);
-    storeAppendPrintf(sentry, "cpu_usage = %f%%\n",dpercent(ct,dt));
+    storeAppendPrintf(sentry, "cpu_usage = %f%%\n", dpercent(ct, dt));
 }
 
 void
@@ -744,7 +744,7 @@ statInit(void)
        server_pconn_hist[i] = 0;
     }
     memset(CountHist, '\0', N_COUNT_HIST * sizeof(StatCounters));
-    for (i=0; i<N_COUNT_HIST; i++)
+    for (i = 0; i < N_COUNT_HIST; i++)
        CountHist[i].timestamp = current_time;
     Counter.timestamp = current_time;
     eventAdd("statAvgTick", statAvgTick, NULL, 60);
@@ -811,21 +811,21 @@ statAvgTick(void *notused)
 }
 
 void
-statAvg5min(StoreEntry *e)
+statAvg5min(StoreEntry * e)
 {
 #if NOT_YET
-       statCountersDump(e);
-       storeAppendPrintf(e, "\n");
+    statCountersDump(e);
+    storeAppendPrintf(e, "\n");
 #endif
-       statAvgDump(e, 5);
+    statAvgDump(e, 5);
 }
 
 void
-statAvg60min(StoreEntry *e)
+statAvg60min(StoreEntry * e)
 {
 #if NOT_YET
-       statCountersDump(e);
-       storeAppendPrintf(e, "\n");
+    statCountersDump(e);
+    storeAppendPrintf(e, "\n");
 #endif
-       statAvgDump(e, 60);
+    statAvgDump(e, 60);
 }
index de48ace659dab37d2590a003df6989a7796d1dbe..813968b4b4a300dac56a4362ffb291330db550cc 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stmem.cc,v 1.56 1998/02/02 21:15:06 wessels Exp $
+ * $Id: stmem.cc,v 1.57 1998/02/02 21:16:33 wessels Exp $
  *
  * DEBUG: section 19    Memory Primitives
  * AUTHOR: Harvest Derived
@@ -220,8 +220,8 @@ stmemCopy(const mem_hdr * mem, off_t offset, char *buf, size_t size)
     /* Seek our way into store */
     while ((t_off + p->len) < offset) {
        t_off += p->len;
-       if(!p->next) {
-           debug(19,1) ("memCopy: p->next == NULL\n");
+       if (!p->next) {
+           debug(19, 1) ("memCopy: p->next == NULL\n");
            return 0;
        }
        assert(p->next);
index dba64f526ee5da0c79ad0d0e520f99b358be28ad..4da81544fed30509b436173f0863b5e4756d10d8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.369 1998/02/02 21:15:08 wessels Exp $
+ * $Id: store.cc,v 1.370 1998/02/02 21:16:34 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -271,7 +271,7 @@ static void storeValidate(StoreEntry *, VCB *, void *, void *);
 static AIOCB storeValidateComplete;
 static void storeRebuiltFromDisk(struct storeRebuildState *data);
 static unsigned int getKeyCounter(void);
-static void storePutUnusedFileno(StoreEntry *e);
+static void storePutUnusedFileno(StoreEntry * e);
 static int storeGetUnusedFileno(void);
 static void storeCheckSwapOut(StoreEntry * e);
 static void storeSwapoutFileOpened(void *data, int fd, int errcode);
@@ -355,7 +355,7 @@ new_StoreEntry(int mem_obj_flag, const char *url, const char *log_url)
 }
 
 static void
-destroy_MemObject(StoreEntry *e)
+destroy_MemObject(StoreEntry * e)
 {
     MemObject *mem = e->mem_obj;
     debug(20, 3) ("destroy_MemObject: destroying %p\n", mem);
@@ -363,7 +363,7 @@ destroy_MemObject(StoreEntry *e)
     destroy_MemObjectData(mem);
     meta_data.misc -= strlen(mem->log_url);
 #if USE_ASYNC_IO
-    while(mem->clients != NULL)
+    while (mem->clients != NULL)
        storeUnregister(e, mem->clients->callback_data);
 #endif
     assert(mem->clients == NULL);
@@ -768,7 +768,7 @@ storeSwapoutFileOpened(void *data, int fd, int errcode)
     MemObject *mem;
 
     xfree(ctrlp);
-    if(fd == -2 && errcode == -2) {    /* Cancelled - Clean up */
+    if (fd == -2 && errcode == -2) {   /* Cancelled - Clean up */
        xfree(swapfilename);
        return;
     }
@@ -828,9 +828,9 @@ storeSwapOutHandle(int fdnotused, int flag, size_t len, void *data)
        if (e->swap_file_number > -1) {
 #if MONOTONIC_STORE
 #if USE_ASYNC_IO
-       safeunlink(storeSwapFullPath(e->swap_file_number, NULL), 1);
+           safeunlink(storeSwapFullPath(e->swap_file_number, NULL), 1);
 #else
-       unlinkdUnlink(storeSwapFullPath(e->swap_file_number, NULL));
+           unlinkdUnlink(storeSwapFullPath(e->swap_file_number, NULL));
 #endif
 #else
            storePutUnusedFileno(e);
@@ -847,7 +847,7 @@ storeSwapOutHandle(int fdnotused, int flag, size_t len, void *data)
        return;
     }
 #if USE_ASYNC_IO
-    if(mem == NULL) {
+    if (mem == NULL) {
        debug(20, 1) ("storeSwapOutHandle: mem == NULL : Cancelling swapout\n");
        return;
     }
@@ -905,7 +905,7 @@ storeCheckSwapOut(StoreEntry * e)
     debug(20, 3) ("storeCheckSwapOut: swapout.done_offset = %d\n",
        (int) mem->swapout.done_offset);
 #if USE_ASYNC_IO
-    if(mem->inmem_hi < mem->swapout.queue_offset) {
+    if (mem->inmem_hi < mem->swapout.queue_offset) {
        storeAbort(e, 0);
        assert(EBIT_TEST(e->flag, RELEASE_REQUEST));
        storeSwapOutFileClose(e);
@@ -922,7 +922,7 @@ storeCheckSwapOut(StoreEntry * e)
 
     new_mem_lo = lowest_offset;
     if (!EBIT_TEST(e->flag, ENTRY_CACHABLE)) {
-       if(!EBIT_TEST(e->flag, KEY_PRIVATE))
+       if (!EBIT_TEST(e->flag, KEY_PRIVATE))
            debug(20, 0) ("storeCheckSwapOut: Attempt to swap out a non-cacheable non-private object!\n");
        stmemFreeDataUpto(mem->data, new_mem_lo);
        mem->inmem_lo = new_mem_lo;
@@ -1075,7 +1075,7 @@ storeSwapInValidateComplete(void *data, int retcode, int errcode)
     swapin_ctrl_t *ctrlp = (swapin_ctrl_t *) data;
     StoreEntry *e;
 
-    if(retcode == -2 && errcode == -2) {
+    if (retcode == -2 && errcode == -2) {
        xfree(ctrlp);
        return;
     }
@@ -1100,18 +1100,17 @@ storeSwapInFileOpened(void *data, int fd, int errcode)
     MemObject *mem = e->mem_obj;
     struct stat sb;
 
-    if(fd == -2 && errcode == -2) {
+    if (fd == -2 && errcode == -2) {
        xfree(ctrlp->path);
        xfree(ctrlp);
        return;
     }
-
     assert(mem != NULL);
     assert(e->mem_status == NOT_IN_MEMORY);
     assert(e->swap_status == SWAPOUT_WRITING || e->swap_status == SWAPOUT_DONE);
-    if (e->swap_status == SWAPOUT_DONE && (fd>=0) && fstat(fd, &sb) == 0)
-       if(sb.st_size == 0 || sb.st_size != e->object_len) {
-           debug(20,0) ("storeSwapInFileOpened: %s: Size mismatch: %d(fstat) != %d(object)\n", ctrlp->path, sb.st_size, e->object_len);
+    if (e->swap_status == SWAPOUT_DONE && (fd >= 0) && fstat(fd, &sb) == 0)
+       if (sb.st_size == 0 || sb.st_size != e->object_len) {
+           debug(20, 0) ("storeSwapInFileOpened: %s: Size mismatch: %d(fstat) != %d(object)\n", ctrlp->path, sb.st_size, e->object_len);
            file_close(fd);
            fd = -1;
        }
@@ -1124,7 +1123,6 @@ storeSwapInFileOpened(void *data, int fd, int errcode)
        xfree(ctrlp);
        return;
     }
-
     debug(20, 5) ("storeSwapInStart: initialized swap file '%s' for '%s'\n",
        ctrlp->path, mem->url);
     (ctrlp->callback) (fd, ctrlp->callback_data);
@@ -1223,11 +1221,11 @@ storeDoConvertFromLog(void *data)
        size = (off_t) scan5;
 
        if (size < 0) {
-           if((key = storeKeyScan(keytext)) == NULL)
+           if ((key = storeKeyScan(keytext)) == NULL)
                continue;
-           if((e = storeGet(key)) == NULL)
+           if ((e = storeGet(key)) == NULL)
                continue;
-           if(e->lastref > lastref)
+           if (e->lastref > lastref)
                continue;
            debug(20, 3) ("storeRebuildFromDisk: Cancelling: '%s'\n", keytext);
            storeRelease(e);
@@ -1235,7 +1233,6 @@ storeDoConvertFromLog(void *data)
            RB->cancelcount++;
            continue;
        }
-
        storeSwapFullPath(sfileno, swapfile);
        if (EBIT_TEST(scan7, KEY_PRIVATE)) {
            RB->badflags++;
@@ -1360,7 +1357,7 @@ storeCleanupComplete(void *data, int retcode, int errcode)
     StoreEntry *e = data;
     storeUnlockObject(e);
     outvalid--;
-    if(retcode == -2 && errcode == -2)
+    if (retcode == -2 && errcode == -2)
        return;
     if (!EBIT_TEST(e->flag, ENTRY_VALIDATED))
        storeRelease(e);
@@ -1409,7 +1406,7 @@ storeValidateComplete(void *data, int retcode, int errcode)
     StoreEntry *e = ctrlp->e;
     char *path;
 
-    if(retcode == -2 && errcode == -2) {
+    if (retcode == -2 && errcode == -2) {
        xfree(sb);
        xfree(ctrlp);
        ctrlp->callback(ctrlp->callback_data, retcode, errcode);
@@ -1560,7 +1557,7 @@ storeAbort(StoreEntry * e, int cbflag)
        return;
 #if USE_ASYNC_IO
     /* Need to cancel any pending ASYNC writes right now */
-    if(mem->swapout.fd >= 0)
+    if (mem->swapout.fd >= 0)
        aioCancel(mem->swapout.fd, NULL);
 #endif
     /* but dont close if a disk write is queued, the handler will close up */
@@ -1682,8 +1679,8 @@ storeMaintainSwapSpace(void *datanotused)
        if (++scanned > max_scan)
            break;
     }
-    if(bigclean)
-       level = 1;
+    if (bigclean)
+       level = 1;
     debug(20, level) ("storeMaintainSwapSpace stats:\n");
     debug(20, level) ("  %6d objects\n", memInUse(MEM_STOREENTRY));
     debug(20, level) ("  %6d were scanned\n", scanned);
@@ -1714,7 +1711,7 @@ storeRelease(StoreEntry * e)
        return 0;
     }
 #if USE_ASYNC_IO
-    aioCancel(-1, e);  /* Make sure all forgotten async ops are cancelled */
+    aioCancel(-1, e);          /* Make sure all forgotten async ops are cancelled */
 #else
     if (store_rebuilding) {
        debug(20, 2) ("storeRelease: Delaying release until store is rebuilt: '%s'\n",
@@ -1865,8 +1862,8 @@ storeClientCopy2(StoreEntry * e, store_client * sc)
     assert(callback != NULL);
     if (e->store_status == STORE_ABORTED) {
 #if USE_ASYNC_IO
-       if(sc->disk_op_in_progress == 1) {
-           if(sc->swapin_fd >= 0)
+       if (sc->disk_op_in_progress == 1) {
+           if (sc->swapin_fd >= 0)
                aioCancel(sc->swapin_fd, NULL);
            else
                aioCancel(-1, sc);
@@ -1878,8 +1875,8 @@ storeClientCopy2(StoreEntry * e, store_client * sc)
     } else if (e->store_status == STORE_OK && sc->copy_offset == e->object_len) {
        /* There is no more to send! */
 #if USE_ASYNC_IO
-       if(sc->disk_op_in_progress == 1) {
-           if(sc->swapin_fd >= 0)
+       if (sc->disk_op_in_progress == 1) {
+           if (sc->swapin_fd >= 0)
                aioCancel(sc->swapin_fd, NULL);
            else
                aioCancel(-1, sc);
@@ -1896,8 +1893,8 @@ storeClientCopy2(StoreEntry * e, store_client * sc)
        debug(20, 3) ("storeClientCopy2: Copying from memory\n");
        sz = stmemCopy(mem->data, sc->copy_offset, sc->copy_buf, sc->copy_size);
 #if USE_ASYNC_IO
-       if(sc->disk_op_in_progress == 1) {
-           if(sc->swapin_fd >= 0)
+       if (sc->disk_op_in_progress == 1) {
+           if (sc->swapin_fd >= 0)
                aioCancel(sc->swapin_fd, NULL);
            else
                aioCancel(-1, sc);
@@ -1911,7 +1908,7 @@ storeClientCopy2(StoreEntry * e, store_client * sc)
        assert(sc->type == STORE_DISK_CLIENT);
        /* gotta open the swapin file */
        /* assert(sc->copy_offset == 0); */
-       if(sc->disk_op_in_progress == 0) {
+       if (sc->disk_op_in_progress == 0) {
            sc->disk_op_in_progress = 1;
            storeSwapInStart(e, storeClientCopyFileOpened, sc);
        } else {
@@ -1921,7 +1918,7 @@ storeClientCopy2(StoreEntry * e, store_client * sc)
        debug(20, 3) ("storeClientCopy: reading from disk FD %d\n",
            sc->swapin_fd);
        assert(sc->type == STORE_DISK_CLIENT);
-       if(sc->disk_op_in_progress == 0) {
+       if (sc->disk_op_in_progress == 0) {
            sc->disk_op_in_progress = 1;
            storeClientCopyFileRead(sc);
        } else {
@@ -2487,7 +2484,7 @@ storeGetUnusedFileno(void)
 }
 
 static void
-storePutUnusedFileno(StoreEntry *e)
+storePutUnusedFileno(StoreEntry * e)
 {
     assert(storeDirMapBitTest(e->swap_file_number));
     storeDirMapBitReset(e->swap_file_number);
@@ -2498,8 +2495,8 @@ storePutUnusedFileno(StoreEntry *e)
     /* event to avoid serving up the wrong data.  This will leave us with */
     /* a URL pointing to no file at all, but that's okay since it'll fail */
     /* and get removed later anyway. */
-    if(store_rebuilding) {
-       if(EBIT_TEST(e->flag, ENTRY_VALIDATED))
+    if (store_rebuilding) {
+       if (EBIT_TEST(e->flag, ENTRY_VALIDATED))
            safeunlink(storeSwapFullPath(e->swap_file_number, NULL), 1);
        return;
     }
@@ -2771,8 +2768,8 @@ storeDoRebuildFromSwapFiles(void *data)
        fd = storeGetNextFile(&sfileno, &size);
        if (fd == -2) {
            debug(20, 1) ("StoreRebuildFromSwapFiles: done!\n");
-            store_rebuilding = 0;
-            return;
+           store_rebuilding = 0;
+           return;
        } else if (fd == 0) {
            continue;
        }
@@ -2824,8 +2821,6 @@ storeDoRebuildFromSwapFiles(void *data)
            safeunlink(storeSwapFullPath(sfileno, NULL), 1);
            continue;
        }
-       
-
        /* get the standard meta data for the StoreEntry */
 
        memset(&tmpe, '\0', sizeof(StoreEntry));
@@ -2941,7 +2936,7 @@ getSwapHdr(int *type, int *len, void *dst, char *write_buf, int hdr_len)
        cur = 0;
        return -1;
     }
-    tmp_buf = &write_buf[cur];         /* position ourselves */
+    tmp_buf = &write_buf[cur]; /* position ourselves */
 
     xmemcpy(len, SwapMetaSize(tmp_buf), sizeof(int));  /* length */
     *type = SwapMetaType(tmp_buf);     /* type */
index 57f1e9c9bf3c1344abe54c278ef29c6fab833775..ad21d2a765e2d49b5f9845897b51a6af2eaebfa9 100644 (file)
@@ -2,6 +2,7 @@
 
 
 
+
 struct _acl_ip_data {
     struct in_addr addr1;      /* if addr2 non-zero then its a range */
     struct in_addr addr2;
@@ -806,8 +807,8 @@ struct _MemObject {
        off_t queue_offset;
        off_t done_offset;
        int fd;
-        int meta_len;
-        char *meta_buf;
+       int meta_len;
+       char *meta_buf;
     } swapout;
     struct _http_reply *reply;
     request_t *request;
index a63dbc8e2ef522178dc5f5bb3789bb0f54662b52..8865ed64437f0756d96f9c3074eb09537873399c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.143 1998/02/02 21:15:10 wessels Exp $
+ * $Id: tools.cc,v 1.144 1998/02/02 21:16:36 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -841,9 +841,10 @@ dlinkDelete(dlink_node * m, dlink_list * list)
        list->tail = m->prev;
 }
 
-void kb_incr(kb_t *k, size_t v)
+void 
+kb_incr(kb_t * k, size_t v)
 {
-       k->bytes += v;
-       k->kb += (k->bytes >> 10);
-       k->bytes &= 0x3FF;
+    k->bytes += v;
+    k->kb += (k->bytes >> 10);
+    k->bytes &= 0x3FF;
 }
index ed02794c05ede93813528d646c8e90338330ac9d..398c4491328dd696d5acc1cadc5f8024925315aa 100644 (file)
@@ -5,8 +5,8 @@ typedef unsigned int ping_status_t;
 typedef unsigned int swap_status_t;
 
 typedef struct {
-       size_t bytes;
-       size_t kb;
+    size_t bytes;
+    size_t kb;
 } kb_t;
 
 /*
index 897eb9c9c2cdb0eb37b8e5a456281c6af9a3dd25..5d064939cb781f6355849cf515e67cb322d6e529 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unlinkd.cc,v 1.15 1998/02/02 21:15:12 wessels Exp $
+ * $Id: unlinkd.cc,v 1.16 1998/02/02 21:16:38 wessels Exp $
  *
  * DEBUG: section 43    Unlink Daemon
  * AUTHOR: Duane Wessels
@@ -83,30 +83,30 @@ static int unlinkdCreate(void);
 static int
 unlinkdCreate(void)
 {
-       int x;
-       int rfd;
-       int wfd;
-       char *args[2];
-       struct timeval slp;
-       args[0] = "(unlinkd)";
-       args[1] = NULL;
-       x = ipcCreate(IPC_FIFO,
-               Config.Program.unlinkd,
-               args,
-               "unlinkd",
-               &rfd,
-               &wfd);
-       if (x < 0)
-               return -1;
-       slp.tv_sec = 0;
-       slp.tv_usec = 250000;
-       select(0, NULL, NULL, NULL, &slp);
-       fd_note(wfd, "squid -> unlinkd");
-       fd_note(rfd, "unlinkd -> squid");
-       commSetTimeout(rfd, -1, NULL, NULL);
-       commSetTimeout(wfd, -1, NULL, NULL);
-       commSetNonBlocking(wfd);
-       return wfd;
+    int x;
+    int rfd;
+    int wfd;
+    char *args[2];
+    struct timeval slp;
+    args[0] = "(unlinkd)";
+    args[1] = NULL;
+    x = ipcCreate(IPC_FIFO,
+       Config.Program.unlinkd,
+       args,
+       "unlinkd",
+       &rfd,
+       &wfd);
+    if (x < 0)
+       return -1;
+    slp.tv_sec = 0;
+    slp.tv_usec = 250000;
+    select(0, NULL, NULL, NULL, &slp);
+    fd_note(wfd, "squid -> unlinkd");
+    fd_note(rfd, "unlinkd -> squid");
+    commSetTimeout(rfd, -1, NULL, NULL);
+    commSetTimeout(wfd, -1, NULL, NULL);
+    commSetNonBlocking(wfd);
+    return wfd;
 }
 
 void