From 0e473d707d13e0eb72d135b5d131df7e3015435f Mon Sep 17 00:00:00 2001 From: wessels <> Date: Tue, 3 Feb 1998 04:16:08 +0000 Subject: [PATCH] gindent --- include/snmp.h | 1 - include/snmp_api.h | 1 + lib/GNUregex.c | 2 +- lib/md5.c | 2 ++ lib/rfc1123.c | 4 +-- lib/rfc1738.c | 4 +-- lib/safe_inet_addr.c | 2 +- lib/stub_memaccount.c | 5 +-- lib/util.c | 14 ++++---- src/asn.cc | 4 +-- src/client.cc | 3 +- src/client_side.cc | 42 +++++++++++----------- src/comm.cc | 28 +++++++-------- src/disk.cc | 12 +++---- src/dns.cc | 16 ++++----- src/dnsserver.cc | 6 ++-- src/fd.cc | 8 ++--- src/ftp.cc | 12 +++---- src/ipc.cc | 10 +++--- src/protos.h | 15 ++++---- src/recv-announce.cc | 3 +- src/redirect.cc | 18 +++++----- src/squid.h | 3 +- src/stat.cc | 30 ++++++++-------- src/stmem.cc | 6 ++-- src/store.cc | 81 ++++++++++++++++++++----------------------- src/structs.h | 5 +-- src/tools.cc | 11 +++--- src/typedefs.h | 4 +-- src/unlinkd.cc | 50 +++++++++++++------------- 30 files changed, 200 insertions(+), 202 deletions(-) diff --git a/include/snmp.h b/include/snmp.h index dc4838dd3b..2c2155ac48 100644 --- a/include/snmp.h +++ b/include/snmp.h @@ -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); - diff --git a/include/snmp_api.h b/include/snmp_api.h index 3715bee588..186cfcc73a 100644 --- a/include/snmp_api.h +++ b/include/snmp_api.h @@ -1,3 +1,4 @@ + /*********************************************************** Copyright 1989 by Carnegie Mellon University diff --git a/lib/GNUregex.c b/lib/GNUregex.c index 54b846c2aa..ee5ff3197f 100644 --- a/lib/GNUregex.c +++ b/lib/GNUregex.c @@ -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; diff --git a/lib/md5.c b/lib/md5.c index 60b9cc4e09..216e13d4dd 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -1,5 +1,7 @@ + + /* taken from RFC-1321/Appendix A.3 */ /* diff --git a/lib/rfc1123.c b/lib/rfc1123.c index cc207895cc..61122cadb0 100644 --- a/lib/rfc1123.c +++ b/lib/rfc1123.c @@ -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 */ diff --git a/lib/rfc1738.c b/lib/rfc1738.c index b0497d525e..f166438248 100644 --- a/lib/rfc1738.c +++ b/lib/rfc1738.c @@ -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); diff --git a/lib/safe_inet_addr.c b/lib/safe_inet_addr.c index b58d54f080..f882e6eafe 100644 --- a/lib/safe_inet_addr.c +++ b/lib/safe_inet_addr.c @@ -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; diff --git a/lib/stub_memaccount.c b/lib/stub_memaccount.c index a012c07b2c..ff186c029e 100644 --- a/lib/stub_memaccount.c +++ b/lib/stub_memaccount.c @@ -1,6 +1,7 @@ /* Stub function for programs not implementing statMemoryAccounted */ #include -int statMemoryAccounted(void) +int +statMemoryAccounted(void) { - return -1; + return -1; } diff --git a/lib/util.c b/lib/util.c index 0fb3fc849b..655315ad99 100644 --- a/lib/util.c +++ b/lib/util.c @@ -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 */ diff --git a/src/asn.cc b/src/asn.cc index 27f7ab78d1..4461d06ec1 100644 --- a/src/asn.cc +++ b/src/asn.cc @@ -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; } diff --git a/src/client.cc b/src/client.cc index 10115aecdd..eed7a46a61 100644 --- a/src/client.cc +++ b/src/client.cc @@ -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 diff --git a/src/client_side.cc b/src/client_side.cc index c0f929b7d9..7d576d1cf1 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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, diff --git a/src/comm.cc b/src/comm.cc index 31c700489d..3d4c912704 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -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; diff --git a/src/disk.cc b/src/disk.cc index b6d415ccbb..aa84df18cc 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -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)) { diff --git a/src/dns.cc b/src/dns.cc index 133b2b1650..c2c761858f 100644 --- a/src/dns.cc +++ b/src/dns.cc @@ -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++; } } diff --git a/src/dnsserver.cc b/src/dnsserver.cc index 6bafcb9c88..04b96efd81 100644 --- a/src/dnsserver.cc +++ b/src/dnsserver.cc @@ -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; diff --git a/src/fd.cc b/src/fd.cc index 8a451e3249..7f2c5287ee 100644 --- 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); } diff --git a/src/ftp.cc b/src/ftp.cc index 61fc64c3bf..fb91659a61 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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, "\n"); if (EBIT_TEST(ftpState->flags, FTP_LISTFORMAT_UNKNOWN) && !EBIT_TEST(ftpState->flags, FTP_TRIED_NLST)) { storeAppendPrintf(e, "[As plain directory]\n"); - } else if (ftpState->typecode=='D') { + } else if (ftpState->typecode == 'D') { storeAppendPrintf(e, "[As extended directory]\n"); } storeAppendPrintf(e, "
\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; diff --git a/src/ipc.cc b/src/ipc.cc index 3c8af7d52b..171065017c 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -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) { diff --git a/src/protos.h b/src/protos.h index 6c5f9046e3..a544be2c8e 100644 --- a/src/protos.h +++ b/src/protos.h @@ -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 *); diff --git a/src/recv-announce.cc b/src/recv-announce.cc index 238c2794d7..b37733ac82 100644 --- a/src/recv-announce.cc +++ b/src/recv-announce.cc @@ -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 diff --git a/src/redirect.cc b/src/redirect.cc index 57cda8e1bd..ad9b68fc72 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -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); diff --git a/src/squid.h b/src/squid.h index 0c7984fd38..2a978d7e81 100644 --- a/src/squid.h +++ b/src/squid.h @@ -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_) diff --git a/src/stat.cc b/src/stat.cc index 6446f1ec7a..b7a2141b06 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -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; ilen) < 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); diff --git a/src/store.cc b/src/store.cc index dba64f526e..4da81544fe 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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 */ diff --git a/src/structs.h b/src/structs.h index 57f1e9c9bf..ad21d2a765 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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; diff --git a/src/tools.cc b/src/tools.cc index a63dbc8e2e..8865ed6443 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -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; } diff --git a/src/typedefs.h b/src/typedefs.h index ed02794c05..398c449132 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -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; /* diff --git a/src/unlinkd.cc b/src/unlinkd.cc index 897eb9c9c2..5d064939cb 100644 --- a/src/unlinkd.cc +++ b/src/unlinkd.cc @@ -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 -- 2.47.2