]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent
authorwessels <>
Fri, 7 Feb 1997 11:57:10 +0000 (11:57 +0000)
committerwessels <>
Fri, 7 Feb 1997 11:57:10 +0000 (11:57 +0000)
src/client_side.cc
src/comm.cc
src/disk.cc
src/dns.cc
src/fqdncache.cc
src/main.cc
src/neighbors.cc
src/stat.cc
src/store.cc

index fb476207a1e80779f2f3412a6d08b6808c552fd2..8b20b7164beef453e02a42677b0db619881c76a3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.87 1997/02/04 19:10:15 wessels Exp $
+ * $Id: client_side.cc,v 1.88 1997/02/07 04:57:10 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -617,7 +617,7 @@ clientPurgeRequest(icpStateData * icpState)
     LOCAL_ARRAY(char, msg, 8192);
     LOCAL_ARRAY(char, line, 256);
     StoreEntry *entry;
-debug(0,0,"Config.Options.enable_purge = %d\n", Config.Options.enable_purge);
+    debug(0, 0, "Config.Options.enable_purge = %d\n", Config.Options.enable_purge);
     if (!Config.Options.enable_purge) {
        buf = access_denied_msg(icpState->http_code = 401,
            icpState->method,
index 024075aecc373b12175685751196f1cfccb31393..32d52df85066c8971918a7fa40f4446d17f5a930 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.134 1997/02/07 04:55:56 wessels Exp $
+ * $Id: comm.cc,v 1.135 1997/02/07 04:57:12 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -1139,7 +1139,7 @@ comm_set_mcast_ttl(int fd, int mcast_ttl)
 #ifdef IP_MULTICAST_TTL
     char ttl = (char) mcast_ttl;
     if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, 1) < 0)
-            debug(50, 1, "comm_set_mcast_ttl: FD %d, TTL: %d: %s\n",
+       debug(50, 1, "comm_set_mcast_ttl: FD %d, TTL: %d: %s\n",
            fd, mcast_ttl, xstrerror());
 #endif
     return 0;
index 776ead115c114c0bef63042941d2ba4e8f444bef..338fc4f193540381ba26955531964cd2aa53c096 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: disk.cc,v 1.53 1997/02/05 04:54:44 wessels Exp $
+ * $Id: disk.cc,v 1.54 1997/02/07 04:57:12 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -245,41 +245,41 @@ diskHandleWrite(int fd, FileEntry * entry)
        if (len < 0) {
            if (errno == EAGAIN || errno == EWOULDBLOCK)
                break;
-               /* disk i/o failure--flushing all outstanding writes  */
-               debug(50, 1, "diskHandleWrite: FD %d: disk write error: %s\n",
-                   fd, xstrerror());
-               entry->write_daemon = NOT_PRESENT;
-               entry->write_pending = NO_WRT_PENDING;
-               /* call finish handler */
-               do {
+           /* disk i/o failure--flushing all outstanding writes  */
+           debug(50, 1, "diskHandleWrite: FD %d: disk write error: %s\n",
+               fd, xstrerror());
+           entry->write_daemon = NOT_PRESENT;
+           entry->write_pending = NO_WRT_PENDING;
+           /* call finish handler */
+           do {
                entry->write_q = r->next;
                if (r->free)
                    (r->free) (r->buf);
                safe_free(r);
-               } while (entry->write_q);
-               if (entry->wrt_handle) {
-                   entry->wrt_handle(fd,
-                       errno == ENOSPC ? DISK_NO_SPACE_LEFT : DISK_ERROR,
+           } while (entry->write_q);
+           if (entry->wrt_handle) {
+               entry->wrt_handle(fd,
+                   errno == ENOSPC ? DISK_NO_SPACE_LEFT : DISK_ERROR,
                    rlen,
-                       entry->wrt_handle_data);
-               }
-               return DISK_ERROR;
+                   entry->wrt_handle_data);
            }
+           return DISK_ERROR;
+       }
        rlen += len;
        r->cur_offset += len;
        if (r->cur_offset < r->len)
            continue;           /* partial write? */
-           /* complete write */
+       /* complete write */
        entry->write_q = r->next;
        if (r->free)
            (r->free) (r->buf);
        safe_free(r);
     }
     if (entry->write_q == NULL) {
-    /* no more data */
+       /* no more data */
        entry->write_q_tail = NULL;
-    entry->write_pending = NO_WRT_PENDING;
-    entry->write_daemon = NOT_PRESENT;
+       entry->write_pending = NO_WRT_PENDING;
+       entry->write_daemon = NOT_PRESENT;
     } else {
        commSetSelect(fd,
            COMM_SELECT_WRITE,
@@ -414,7 +414,7 @@ file_read(int fd, char *buf, int req_len, int offset, FILE_READ_HD handler, void
 {
     dread_ctrl *ctrl_dat;
     if (fd < 0)
-       fatal_dump("file_read: bad FD");
+       fatal_dump("file_read: bad FD");
     ctrl_dat = xcalloc(1, sizeof(dread_ctrl));
     ctrl_dat->fd = fd;
     ctrl_dat->offset = offset;
index 4f7bdfbe012ba2798f016c884fa550cd66a9bc5c..99184be85aa216d541d89b222a9f51270dd8d428 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dns.cc,v 1.29 1997/02/06 18:02:10 wessels Exp $
+ * $Id: dns.cc,v 1.30 1997/02/07 04:57:13 wessels Exp $
  *
  * DEBUG: section 34    Dnsserver interface
  * AUTHOR: Harvest Derived
@@ -200,9 +200,9 @@ dnsOpenServer(const char *command)
     close(fd);
     close(cfd);
     if (Config.Options.res_defnames)
-       execlp(command, "(dnsserver)", "-D", NULL);
+       execlp(command, "(dnsserver)", "-D", NULL);
     else
-       execlp(command, "(dnsserver)", NULL);
+       execlp(command, "(dnsserver)", NULL);
     debug(50, 0, "dnsOpenServer: %s: %s\n", command, xstrerror());
     _exit(1);
     return 0;
index 02d52131a45e3afe8132da9e16b3f61733600ba2..15cc785dd241c0e764f12491e73b37b37cf0541d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.44 1997/02/04 23:18:16 wessels Exp $
+ * $Id: fqdncache.cc,v 1.45 1997/02/07 04:57:13 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -658,7 +658,7 @@ fqdncache_dnsDispatch(dnsserver_t * dns, fqdncache_entry * f)
 {
     char *buf = NULL;
     if (!BIT_TEST(dns->flags, DNS_FLAG_ALIVE))
-        debug_trap("Dispatching a dead DNS server");
+       debug_trap("Dispatching a dead DNS server");
     if (!fqdncacheHasPending(f)) {
        debug(35, 0, "fqdncache_dnsDispatch: skipping '%s' because no handler.\n",
            f->name);
index d3520fc8d132f25f9c3b7f6b7f72a6c05e732d4a..715e2864cba01b395434dd3feaa858acbeb3e021 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.cc,v 1.134 1997/02/06 19:01:46 wessels Exp $
+ * $Id: main.cc,v 1.135 1997/02/07 04:57:14 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -528,13 +528,12 @@ mainInitialize(void)
 
     leave_suid();              /* Run as non privilegied user */
     if (geteuid() == 0) {
-       debug(0,0,"Squid is not safe to run as root!  If you must\n");
-       debug(0,0,"start Squid as root, then you must configure\n");
-       debug(0,0,"it to run as a non-priveledged user with the\n");
-       debug(0,0,"'cache_effective_user' option in the config file.\n");
+       debug(0, 0, "Squid is not safe to run as root!  If you must\n");
+       debug(0, 0, "start Squid as root, then you must configure\n");
+       debug(0, 0, "it to run as a non-priveledged user with the\n");
+       debug(0, 0, "'cache_effective_user' option in the config file.\n");
        fatal("Don't run Squid as root, set 'cache_effective_user'!");
     }
-
     if (httpPortNumOverride != 1)
        Config.Port.http = (u_short) httpPortNumOverride;
     if (icpPortNumOverride != 1)
@@ -603,6 +602,7 @@ mainInitialize(void)
        if (Config.Announce.on)
            eventAdd("send_announce", send_announce, NULL, 3600);
        eventAdd("ipcache_purgelru", (EVH) ipcache_purgelru, NULL, 10);
+       eventAdd("peerUpdateFudge", peerUpdateFudge, NULL, 10);
     }
     first_time = 0;
 }
index 6478d4fe222c92f4f4e6c0258edfc36937467934..c1ef1436e8793f667b434813f17ba11e9dd64a7a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: neighbors.cc,v 1.112 1997/02/07 04:56:17 wessels Exp $
+ * $Id: neighbors.cc,v 1.113 1997/02/07 04:57:15 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -508,7 +508,7 @@ neighborsUdpPing(protodispatch_data * proto)
 
        debug(15, 4, "neighborsUdpPing: pinging peer %s for '%s'\n",
            e->host, url);
-        if (e->type == PEER_MULTICAST)
+       if (e->type == PEER_MULTICAST)
            comm_set_mcast_ttl(theOutIcpConnection, e->mcast_ttl);
        reqnum = storeReqnum(entry, request->method);
        debug(15, 3, "neighborsUdpPing: key = '%s'\n", entry->key);
@@ -545,11 +545,11 @@ neighborsUdpPing(protodispatch_data * proto)
        debug(15, 3, "neighborsUdpPing: %s: ack_deficit = %d\n",
            e->host, e->stats.ack_deficit);
        if (e->type == PEER_MULTICAST) {
-               e->stats.ack_deficit = 0;
-               ICP_mcasts_sent++;
+           e->stats.ack_deficit = 0;
+           ICP_mcasts_sent++;
        } else if (neighborUp(e)) {
            /* its alive, expect a reply from it */
-               mem->e_pings_n_pings++;
+           mem->e_pings_n_pings++;
        } else {
            /* Neighbor is dead; ping it anyway, but don't expect a reply */
            /* log it once at the threshold */
@@ -583,7 +583,7 @@ neighborsUdpPing(protodispatch_data * proto)
                    query,
                    LOG_TAG_NONE,
                    PROTO_NONE);
-           ICP_queries_sent++;
+               ICP_queries_sent++;
            }
        } else {
            debug(15, 6, "neighborsUdpPing: Source Ping: unknown host: %s\n",
@@ -985,4 +985,3 @@ peerUpdateFudge(void *unused)
     eventAdd("peerUpdateFudge", peerUpdateFudge, NULL, 10);
     debug(15, 3, "peerUpdateFudge: Factor = %d\n", MulticastFudgeFactor);
 }
-
index a95124bb231bb47ff6ff6bae32ae84c10dd48e94..dfb8d116175ed87bdf4f139ed62233ed7f54c280 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.124 1997/02/05 04:53:31 wessels Exp $
+ * $Id: stat.cc,v 1.125 1997/02/07 04:57:16 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -563,7 +563,7 @@ server_list(const cacheinfo * obj, StoreEntry * sentry)
        if (e->host == NULL)
            fatal_dump("Found an peer without a hostname!");
        storeAppendPrintf(sentry, "\n{%-11.11s: %s/%d/%d}\n",
-           e->type == PEER_PARENT ? "Parent" : "Sibling",
+           neighborTypeStr(e),
            e->host,
            e->http_port,
            e->icp_port);
@@ -575,6 +575,9 @@ server_list(const cacheinfo * obj, StoreEntry * sentry)
        storeAppendPrintf(sentry, "{PINGS ACKED: %8d %3d%%}\n",
            e->stats.pings_acked,
            percent(e->stats.pings_acked, e->stats.pings_sent));
+       storeAppendPrintf(sentry, "{FETCHES    : %8d %3d%%}\n",
+           e->stats.fetches,
+           percent(e->stats.fetches, e->stats.pings_acked));
        storeAppendPrintf(sentry, "{IGNORED    : %8d %3d%%}\n",
            e->stats.ignored_replies,
            percent(e->stats.ignored_replies, e->stats.pings_acked));
@@ -582,15 +585,11 @@ server_list(const cacheinfo * obj, StoreEntry * sentry)
        for (op = ICP_OP_INVALID; op < ICP_OP_END; op++) {
            if (e->stats.counts[op] == 0)
                continue;
-           storeAppendPrintf(sentry, "{%-10.10s : %8d %3d%%}\n",
+           storeAppendPrintf(sentry, "{    %12.12s : %8d %3d%%}\n",
                IcpOpcodeStr[op],
                e->stats.counts[op],
                percent(e->stats.counts[op], e->stats.pings_acked));
        }
-       storeAppendPrintf(sentry, "{FETCHES    : %8d %3d%%}\n",
-           e->stats.fetches,
-           percent(e->stats.fetches, e->stats.pings_acked));
-
        if (e->last_fail_time) {
            storeAppendPrintf(sentry, "{Last failed connect() at: %s}\n",
                mkhttpdlogtime(&(e->last_fail_time)));
@@ -1160,7 +1159,6 @@ log_enable(cacheinfo * obj, StoreEntry * sentry)
            debug(18, 0, "Cannot open logfile: %s\n", obj->logfilename);
            obj->logfile_status = LOG_DISABLE;
        }
-
     }
     /* at the moment, store one char to make a storage manager happy */
     storeAppendPrintf(sentry, " ");
index 5cd986902849c72d3fc9048c91024334495a12b6..b04fb442bdc1d52f8f97f6140ca7dcf051b597e0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.208 1997/02/07 04:56:40 wessels Exp $
+ * $Id: store.cc,v 1.209 1997/02/07 04:57:17 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -197,8 +197,8 @@ struct storeRebuild_data {
 };
 
 struct _bucketOrder {
-       unsigned int bucket;
-       int index;
+    unsigned int bucket;
+    int index;
 };
 
 /* initializtion flag */
@@ -2396,7 +2396,7 @@ storeRandomizeBuckets(void)
     qsort((char *) MaintBucketsOrder,
        store_buckets,
        sizeof(struct _bucketOrder),
-       (QS) compareBucketOrder);
+                    (QS) compareBucketOrder);
 }
 
 static void
@@ -2666,7 +2666,6 @@ storeWriteCleanLog(void)
        sprintf(tmp_error_buf, "Cannot open swap logfile: %s", swaplog_file);
        fatal(tmp_error_buf);
     }
-
     stop = getCurrentTime();
     r = stop - start;
     debug(20, 1, "  Finished.  Wrote %d lines.\n", n);