]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent
authorwessels <>
Thu, 5 Mar 1998 07:42:42 +0000 (07:42 +0000)
committerwessels <>
Thu, 5 Mar 1998 07:42:42 +0000 (07:42 +0000)
22 files changed:
src/HttpHeader.cc
src/HttpReply.cc
src/HttpStatusLine.cc
src/StatHist.cc
src/cachemgr.cc
src/client.cc
src/defines.h
src/enums.h
src/fqdncache.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/ipcache.cc
src/main.cc
src/mem.cc
src/protos.h
src/snmp_agent.cc
src/stat.cc
src/structs.h
src/tools.cc
src/typedefs.h
src/wais.cc

index 90b3545cc2b01624a3bcda702cf753c8439a1215..fab05d38b73567ceabeebd0d8fd266792b4fd2b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: HttpHeader.cc,v 1.14 1998/03/05 00:01:07 rousskov Exp $
+ * $Id: HttpHeader.cc,v 1.15 1998/03/05 00:42:42 wessels Exp $
  *
  * DEBUG: section 55    HTTP Header
  * AUTHOR: Alex Rousskov
@@ -263,9 +263,27 @@ static const char *getStringPrefix(const char *str);
  * some compilers do not want to convert a type into a union which that type
  * belongs to
  */
-field_store intField(int n) { field_store f; f.v_int = n; return f; }
-field_store timeField(time_t t) { field_store f; f.v_time = t; return f; }
-field_store ptrField(void *p) { field_store f; f.v_pchar = (char*)p; return f; }
+field_store 
+intField(int n)
+{
+    field_store f;
+    f.v_int = n;
+    return f;
+}
+field_store 
+timeField(time_t t)
+{
+    field_store f;
+    f.v_time = t;
+    return f;
+}
+field_store 
+ptrField(void *p)
+{
+    field_store f;
+    f.v_pchar = (char *) p;
+    return f;
+}
 
 /*
  * Module initialization routines
@@ -467,7 +485,7 @@ httpHeaderGetEntry(const HttpHeader * hdr, HttpHeaderPos * pos)
 {
     assert(hdr && pos);
     assert(*pos >= HttpHeaderInitPos && *pos < hdr->capacity);
-    debug(55,8) ("searching next e in hdr %p from %d\n", hdr, *pos);
+    debug(55, 8) ("searching next e in hdr %p from %d\n", hdr, *pos);
     for ((*pos)++; *pos < hdr->ucount; (*pos)++) {
        HttpHeaderEntry *e = hdr->entries + *pos;
        if (httpHeaderEntryIsValid(e)) {
@@ -764,7 +782,7 @@ int
 httpHeaderGetInt(const HttpHeader * hdr, http_hdr_type id)
 {
     assert_eid(id);
-    assert(Headers[id].type == ftInt);    /* must be of an apropriate type */
+    assert(Headers[id].type == ftInt); /* must be of an apropriate type */
     return httpHeaderGet(hdr, id).v_int;
 }
 
@@ -772,7 +790,7 @@ const char *
 httpHeaderGetStr(const HttpHeader * hdr, http_hdr_type id)
 {
     assert_eid(id);
-    assert(Headers[id].type == ftPChar);  /* must be of an apropriate type */
+    assert(Headers[id].type == ftPChar);       /* must be of an apropriate type */
     return httpHeaderGet(hdr, id).v_pchar;
 }
 
@@ -1185,7 +1203,7 @@ httpHeaderFieldBadValue(field_type type)
     return ptrField(NULL);     /* not reached */
 }
 
-#if 0 /* moved to HttpHdrCC.c */
+#if 0                          /* moved to HttpHdrCC.c */
 
 /*
  * HttpScc (server cache control)
@@ -1437,7 +1455,7 @@ static void
 shortStringStatDump(StoreEntry * e)
 {
     storeAppendPrintf(e, "<h3>Short String Stats</h3>\n<p>");
-       memPoolReport(shortStrings, e);
+    memPoolReport(shortStrings, e);
     storeAppendPrintf(e, "\n</p>\n");
     storeAppendPrintf(e, "<br><h3>Long String Stats</h3>\n");
     storeAppendPrintf(e, "alive: %3d (%5.1f KB) high-water:  %3d (%5.1f KB)\n",
index 5a0d9b87e735820181ee1644072fd513f4097074..8aa23ce586c6257482e06618e70fa5907f6b7129 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpReply.cc,v 1.10 1998/03/05 00:01:08 rousskov Exp $
+ * $Id: HttpReply.cc,v 1.11 1998/03/05 00:42:43 wessels Exp $
  *
  * DEBUG: section 58    HTTP Reply (Response)
  * AUTHOR: Alex Rousskov
@@ -49,7 +49,7 @@ HttpReply *
 httpReplyCreate()
 {
     HttpReply *rep = memAllocate(MEM_HTTPREPLY);
-    debug(58,7) ("creating rep: %p\n", rep);
+    debug(58, 7) ("creating rep: %p\n", rep);
     httpReplyInit(rep);
     return rep;
 }
@@ -78,7 +78,7 @@ void
 httpReplyDestroy(HttpReply * rep)
 {
     assert(rep);
-    debug(58,7) ("destroying rep: %p\n", rep);
+    debug(58, 7) ("destroying rep: %p\n", rep);
     httpReplyClean(rep);
     httpReplyDoDestroy(rep);
 }
index a290230363e3053d19c6e52d24fb0b1794842971..41719b51a2976bff2fad44a6deb4d51a18dc0786 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: HttpStatusLine.cc,v 1.6 1998/03/03 22:17:51 rousskov Exp $
+ * $Id: HttpStatusLine.cc,v 1.7 1998/03/05 00:42:44 wessels Exp $
  *
  * DEBUG: section 57    HTTP Status-line
  * AUTHOR: Alex Rousskov
@@ -67,8 +67,8 @@ void
 httpStatusLinePackInto(const HttpStatusLine * sline, Packer * p)
 {
     assert(sline && p);
-    debug(57,9) ("packing sline %p using %p:\n", sline, p);
-    debug(57,9) (HttpStatusLineFormat, sline->version, sline->status,
+    debug(57, 9) ("packing sline %p using %p:\n", sline, p);
+    debug(57, 9) (HttpStatusLineFormat, sline->version, sline->status,
        sline->reason ? sline->reason : httpStatusString(sline->status));
     packerPrintf(p, HttpStatusLineFormat,
        sline->version, sline->status,
index da99cff2bce4e6cd6cbb364e7cedb0d554e2020a..8a3e8fb30543cc0331e90cbb4ea50535f47175d7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: StatHist.cc,v 1.4 1998/03/04 06:23:28 rousskov Exp $
+ * $Id: StatHist.cc,v 1.5 1998/03/05 00:42:45 wessels Exp $
  *
  * DEBUG: section 62    Generic Histogram
  * AUTHOR: Duane Wessels
@@ -73,7 +73,7 @@ statHistInit(StatHist * H, int capacity, hbase_f val_in, hbase_f val_out, double
     /* a max value should go into the last bin */
     assert(statHistBin(H, max) == H->capacity - 1);
     /* it is hard to test val_out, here is a crude test */
-    assert(((int)(0.99+statHistVal(H, 0)-min)) == 0);
+    assert(((int) (0.99 + statHistVal(H, 0) - min)) == 0);
 }
 
 void
index c6f767093bae80351253e29ab04ca7af35abd8d4..dbca39741e955418e240db7d693307a19fa2e4a2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cachemgr.cc,v 1.74 1998/03/03 21:58:49 rousskov Exp $
+ * $Id: cachemgr.cc,v 1.75 1998/03/05 00:42:47 wessels Exp $
  *
  * DEBUG: section 0     CGI Cache Manager
  * AUTHOR: Duane Wessels
@@ -301,7 +301,7 @@ munge_menu_line(const char *buf, cachemgr_request * req)
     const char *p;
     char *a_url;
     char *buf_copy;
-    static char html[2*1024];
+    static char html[2 * 1024];
     if (strlen(buf) < 1)
        return buf;
     if (*buf != ' ')
@@ -339,7 +339,8 @@ munge_menu_line(const char *buf, cachemgr_request * req)
 static const char *
 munge_other_line(const char *buf, cachemgr_request * req)
 {
-    static const char* ttags[] = { "td", "th" };
+    static const char *ttags[] =
+    {"td", "th"};
     static char html[4096];
     static table_line_num = 0;
     static next_is_header = 0;
@@ -358,29 +359,33 @@ munge_other_line(const char *buf, cachemgr_request * req)
     }
     /* start html table */
     if (!table_line_num) {
-       l += snprintf(html+l, sizeof(html)-l, "</pre><table border=1 cellpadding=2 cellspacing=1>\n");
+       l += snprintf(html + l, sizeof(html) - l, "</pre><table border=1 cellpadding=2 cellspacing=1>\n");
        next_is_header = 0;
     }
     /* remove '\n' */
     is_header = (!table_line_num || next_is_header) && !strchr(buf, ':') && !is_number(buf);
     ttag = ttags[is_header];
     /* record starts */
-    l += snprintf(html+l, sizeof(html)-l, "<tr>");
+    l += snprintf(html + l, sizeof(html) - l, "<tr>");
     /* substitute '\t' */
     buf_copy = x = xstrdup(buf);
-    if ((p = strchr(x, '\n'))) *p = '\0';
+    if ((p = strchr(x, '\n')))
+       *p = '\0';
     while (x && strlen(x)) {
        int column_span = 1;
        const char *cell = xstrtok(&x, '\t');
-       while (x && *x == '\t') { column_span++; x++; }
-       l += snprintf(html+l, sizeof(html)-l, "<%s colspan=%d align=\"%s\">%s</%s>",
+       while (x && *x == '\t') {
+           column_span++;
+           x++;
+       }
+       l += snprintf(html + l, sizeof(html) - l, "<%s colspan=%d align=\"%s\">%s</%s>",
            ttag, column_span,
            is_header ? "center" : is_number(cell) ? "right" : "left",
            cell, ttag);
     }
     xfree(buf_copy);
     /* record ends */
-    l += snprintf(html+l, sizeof(html)-l, "</tr>\n");
+    l += snprintf(html + l, sizeof(html) - l, "</tr>\n");
     next_is_header = is_header && strstr(buf, "\t\t");
     table_line_num++;
     return html;
index 7aa52fa83610b999decad5b09cead97a809ac2bd..87fdec90943215bbe91226afd66dc4e050902782 100644 (file)
@@ -1,8 +1,9 @@
 
 
 
+
 /*
- * $Id: client.cc,v 1.57 1998/02/26 18:00:39 wessels Exp $
+ * $Id: client.cc,v 1.58 1998/03/05 00:42:48 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
index 9595fe3f6955f264f1c1676a1291ed1da7e6daa1..5cfbddcca32544c85965389b3eb931e083a8a076 100644 (file)
 #define N_COUNT_HIST (3600 / COUNT_INTERVAL) + 1
 /*
  * keep 3 days' (72 hours) worth of hourly readings
-*/
+ */
 #define N_COUNT_HOUR_HIST (86400 * 3) / (60 * COUNT_INTERVAL)
 
 /* were to look for errors if config path fails */
index e94974b4e3440d5cfb18ce1864512f94f7bb0fa1..e27d379d3bb8f727d8e502ef299a7e00948d12e8 100644 (file)
@@ -207,7 +207,7 @@ typedef enum {
 
 /* possible types for http header fields */
 typedef enum {
-    ftInvalid = HDR_ENUM_END,   /* to catch nasty errors with hdr_id<->fld_type clashes */
+    ftInvalid = HDR_ENUM_END,  /* to catch nasty errors with hdr_id<->fld_type clashes */
     ftInt,
     ftPChar,
     ftDate_1123,
index c739b68e5fc24fb716e142aaa061de0d734a5793..31a8ce94d5d1615bc821cd99acc274f15cfdbab6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.89 1998/03/03 22:17:52 rousskov Exp $
+ * $Id: fqdncache.cc,v 1.90 1998/03/05 00:42:51 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -943,7 +943,7 @@ snmp_fqdncacheFn(variable_list * Var, long *ErrP)
     case NET_FQDN_NAME:
        Answer->type = SMI_STRING;
        Answer->val_len = strlen(fq->names[0]);
-       Answer->val.string = (u_char *)xstrdup(fq->names[0]);
+       Answer->val.string = (u_char *) xstrdup(fq->names[0]);
        break;
     case NET_FQDN_IP:
        Answer->type = SMI_IPADDRESS;
index c67fee94c24184cf1f8c537d7d02914bb32925d0..5327d1bbd25723261e1b3fa557fd83ba0feda72d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.200 1998/03/04 23:52:39 wessels Exp $
+ * $Id: ftp.cc,v 1.201 1998/03/05 00:42:52 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -1032,7 +1032,7 @@ ftpWriteCommandCallback(int fd, char *bufnotused, size_t size, int errflag, void
     if (size > 0) {
        fd_bytes(fd, size, FD_WRITE);
        kb_incr(&Counter.server.all.kbytes_out, size);
-        kb_incr(&Counter.server.ftp.kbytes_out, size);
+       kb_incr(&Counter.server.ftp.kbytes_out, size);
     }
     if (errflag == COMM_ERR_CLOSING)
        return;
@@ -1105,7 +1105,7 @@ ftpReadControlReply(int fd, void *data)
     if (len > 0) {
        fd_bytes(fd, len, FD_READ);
        kb_incr(&Counter.server.all.kbytes_in, len);
-        kb_incr(&Counter.server.ftp.kbytes_in,len);
+       kb_incr(&Counter.server.ftp.kbytes_in, len);
     }
     debug(9, 5) ("ftpReadControlReply: FD %d, Read %d bytes\n", fd, len);
     if (len < 0) {
index 881be4b12e8fdddb37db5d663eba261410f98dd7..f8dffc78667b61d9441025bfefbe24dc6fa9c917 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: gopher.cc,v 1.121 1998/03/04 23:52:41 wessels Exp $
+ * $Id: gopher.cc,v 1.122 1998/03/05 00:42:53 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -755,7 +755,7 @@ gopherSendComplete(int fd, char *buf, size_t size, int errflag, void *data)
     if (size > 0) {
        fd_bytes(fd, size, FD_WRITE);
        kb_incr(&Counter.server.all.kbytes_out, size);
-        kb_incr(&Counter.server.other.kbytes_out, size);
+       kb_incr(&Counter.server.other.kbytes_out, size);
     }
     if (errflag) {
        ErrorState *err;
index cb2f07655a4ba37ae5b3b0a98da9c9de8ce8da74..b0b444e63e03c89cb833f152ffbd51d6203b3d40 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.245 1998/03/05 00:01:11 rousskov Exp $
+ * $Id: http.cc,v 1.246 1998/03/05 00:42:55 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -742,7 +742,7 @@ httpSendComplete(int fd, char *bufnotused, size_t size, int errflag, void *data)
     if (size > 0) {
        fd_bytes(fd, size, FD_WRITE);
        kb_incr(&Counter.server.all.kbytes_out, size);
-        kb_incr(&Counter.server.http.kbytes_out, size);
+       kb_incr(&Counter.server.http.kbytes_out, size);
     }
     if (errflag == COMM_ERR_CLOSING)
        return;
index fb75632dbd820c343c17e32812f1b5a8b8184dfb..266fdb6ee30624e8acbe9c14e98b0f183234b015 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipcache.cc,v 1.164 1998/03/03 22:17:53 rousskov Exp $
+ * $Id: ipcache.cc,v 1.165 1998/03/05 00:42:57 wessels Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -1099,7 +1099,7 @@ snmp_ipcacheFn(variable_list * Var, long *ErrP)
        xfree(Answer->val.integer);
        Answer->type = SMI_STRING;
        Answer->val_len = strlen(IPc->name);
-       Answer->val.string = (u_char *)xstrdup(IPc->name);
+       Answer->val.string = (u_char *) xstrdup(IPc->name);
        break;
     case NET_IPC_IP:
        Answer->type = SMI_IPADDRESS;
index afd7b995eb5f4be0b118dab5588e42ff3fd71818..5fa959536dec62f6202aa7cd4f4397b7020d174c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.231 1998/03/03 00:31:08 rousskov Exp $
+ * $Id: main.cc,v 1.232 1998/03/05 00:42:58 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -519,7 +519,7 @@ main(int argc, char **argv)
     debug_log = stderr;
     if (FD_SETSIZE < Squid_MaxFD)
        Squid_MaxFD = FD_SETSIZE;
-       
+
     /* call mallopt() before anything else */
 #if HAVE_MALLOPT
 #ifdef M_GRAIN
@@ -764,7 +764,7 @@ normal_shutdown(void)
     }
 #endif
 #if MEM_GEN_TRACE
-       log_trace_done();
+    log_trace_done();
 #endif
 
     debug(1, 0) ("Squid Cache (Version %s): Exiting normally.\n",
index 4c7fee3866397138bb2043547f0cecaca288bced..d985df89eb8fa301afdbabcc34750dd1e69bb19f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: mem.cc,v 1.10 1998/03/05 00:01:11 rousskov Exp $
+ * $Id: mem.cc,v 1.11 1998/03/05 00:42:59 wessels Exp $
  *
  * DEBUG: section 13    High Level Memory Pool Management
  * AUTHOR: Harvest Derived
@@ -193,7 +193,7 @@ memClean()
     if (dirty_count)
        debug(13, 2) ("memClean: %d pools are left dirty\n", dirty_count);
     else
-       memCleanModule(); /* will free chunks and stuff */
+       memCleanModule();       /* will free chunks and stuff */
 }
 
 
index 19fb42a2627f43be1e61f61b4743beb243af32f7..5c5ead0476f8d6761db7147bb339e4566a561040 100644 (file)
@@ -530,7 +530,7 @@ extern void memClean();
 extern void memInitModule();
 extern void memCleanModule();
 extern void memConfigure();
-#if 0 /* not used */
+#if 0                          /* not used */
 extern void memFreeMemory(void);
 #endif
 extern void *memAllocate(mem_type);
@@ -541,20 +541,20 @@ extern void memFreeDISK(void *);
 extern int memInUse(mem_type);
 
 extern DynPool *dynPoolCreate();
-extern void dynPoolDestroy(DynPool *pool);
-extern void *dynPoolAlloc(DynPool *pool, size_t size);
-extern void dynPoolFree(DynPool *pool, void *obj, size_t size);
+extern void dynPoolDestroy(DynPool * pool);
+extern void *dynPoolAlloc(DynPool * pool, size_t size);
+extern void dynPoolFree(DynPool * pool, void *obj, size_t size);
 extern MemPool *memPoolCreate(const char *label, size_t obj_size);
-extern void memPoolDestroy(MemPool *pool);
-extern void *memPoolAlloc(MemPool *pool);
-extern void memPoolFree(MemPool *pool, void *obj);
-extern int memPoolWasUsed(const MemPool *pool);
-extern int memPoolInUseCount(const MemPool *pool);
-extern size_t memPoolInUseSize(const MemPool *pool);
-extern int memPoolUsedCount(const MemPool *pool);
-extern void memPoolDescribe(const MemPool *pool);
-extern void memPoolReport(const MemPool *pool, StoreEntry *e);
-extern void memReport(StoreEntry *e);
+extern void memPoolDestroy(MemPool * pool);
+extern void *memPoolAlloc(MemPool * pool);
+extern void memPoolFree(MemPool * pool, void *obj);
+extern int memPoolWasUsed(const MemPool * pool);
+extern int memPoolInUseCount(const MemPool * pool);
+extern size_t memPoolInUseSize(const MemPool * pool);
+extern int memPoolUsedCount(const MemPool * pool);
+extern void memPoolDescribe(const MemPool * pool);
+extern void memPoolReport(const MemPool * pool, StoreEntry * e);
+extern void memReport(StoreEntry * e);
 
 extern int stmemFreeDataUpto(mem_hdr *, int);
 extern void stmemAppend(mem_hdr *, const char *, int);
@@ -808,7 +808,7 @@ extern void dlinkDelete(dlink_node * m, dlink_list * list);
 extern void kb_incr(kb_t *, size_t);
 extern double gb_to_double(const gb_t *);
 extern const char *gb_to_str(const gb_t *);
-extern void gb_flush(gb_t *); /* internal, do not use this */
+extern void gb_flush(gb_t *);  /* internal, do not use this */
 
 /*
  * prototypes for system functions missing from system includes
index 62135ba836444986efb90036360a2eaf2882f245..f28e549b8581311b34e7657d262ea1cf2d8a8c9e 100644 (file)
@@ -45,12 +45,12 @@ snmp_agent_parse(snmp_request_t * rq)
     cbdataAdd(rq, MEM_NONE);
     PDU = snmp_pdu_create(0);
     Community = snmp_parse(Session, PDU, buf, len);
-    
-    if (!snmp_coexist_V2toV1(PDU)) { /* incompatibility */
-        debug(49, 3) ("snmp_agent_parse: Incompatible V2 packet.\n");
-        snmp_free_pdu(PDU);
-        snmp_agent_parse_done(0, rq);
-        return;
+
+    if (!snmp_coexist_V2toV1(PDU)) {   /* incompatibility */
+       debug(49, 3) ("snmp_agent_parse: Incompatible V2 packet.\n");
+       snmp_free_pdu(PDU);
+       snmp_agent_parse_done(0, rq);
+       return;
     }
     rq->community = Community;
     rq->PDU = PDU;
index 132c7092362a28166fb72ad9f030034bf987cc64..1818fc076c62fb709f8710193dd7b8534b261d55 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.213 1998/03/05 00:40:54 wessels Exp $
+ * $Id: stat.cc,v 1.214 1998/03/05 00:43:06 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -634,19 +634,19 @@ statAvgDump(StoreEntry * sentry, int minutes, int hours)
            hours = N_COUNT_HOUR_HIST - 1;
        l = &CountHourHist[hours];
     } else {
-       debug(18,1)("statAvgDump: Invalid args, minutes=%d, hours=%d\n",
-               minutes, hours);
+       debug(18, 1) ("statAvgDump: Invalid args, minutes=%d, hours=%d\n",
+           minutes, hours);
        return;
     }
     dt = tvSubDsec(l->timestamp, f->timestamp);
     ct = f->cputime - l->cputime;
 
-     storeAppendPrintf(sentry, "sample_start_time = %d.%d (%s)\n",
-        f->timestamp.tv_sec,
+    storeAppendPrintf(sentry, "sample_start_time = %d.%d (%s)\n",
+       f->timestamp.tv_sec,
        f->timestamp.tv_usec,
        mkrfc1123(f->timestamp.tv_sec));
-     storeAppendPrintf(sentry, "sample_end_time = %d.%d (%s)\n",
-        l->timestamp.tv_sec,
+    storeAppendPrintf(sentry, "sample_end_time = %d.%d (%s)\n",
+       l->timestamp.tv_sec,
        l->timestamp.tv_usec,
        mkrfc1123(l->timestamp.tv_sec));
 
@@ -886,7 +886,7 @@ statCountersDump(StoreEntry * sentry)
     f->cputime = rusage_cputime(&rusage);
 
     storeAppendPrintf(sentry, "sample_time = %d.%d (%s)\n",
-        f->timestamp.tv_sec,
+       f->timestamp.tv_sec,
        f->timestamp.tv_usec,
        mkrfc1123(f->timestamp.tv_sec));
     storeAppendPrintf(sentry, "client_http.requests = %d\n",
index 23cfc73755b1668dd6eba19ad1ba4ffc4ac09f54..f4b2b55f7ec6e24af24fb05bdb1693f528000fb6 100644 (file)
@@ -1,4 +1,5 @@
 
+
 struct _acl_ip_data {
     struct in_addr addr1;      /* if addr2 non-zero then its a range */
     struct in_addr addr2;
@@ -465,7 +466,7 @@ struct _HttpBody {
 };
 
 
-/* http cache control header field*/
+/* http cache control header field */
 struct _HttpHdrCc {
     int mask;
     time_t max_age;
@@ -484,10 +485,10 @@ union _field_store {
 
 /* per field statistics */
 struct _HttpHeaderFieldStat {
-    int aliveCount;       /* created but not destroyed (count) */
-    int parsCount;        /* #parsing attempts */
-    int errCount;         /* #pasring errors */
-    int repCount;         /* #repetitons */
+    int aliveCount;            /* created but not destroyed (count) */
+    int parsCount;             /* #parsing attempts */
+    int errCount;              /* #pasring errors */
+    int repCount;              /* #repetitons */
 };
 
 
@@ -1068,7 +1069,7 @@ struct _StatCounters {
            int errors;
            kb_t kbytes_in;
            kb_t kbytes_out;
-       } all,http,ftp,other;
+       } all , http, ftp, other;
     } server;
     struct {
        int pkts_sent;
index 6cdadd1cc4f9127328423031522520dc1d69d4ae..aaf7af1a63f5d07bbd9e28f8c1979dcd9025d341 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.150 1998/03/04 23:48:14 rousskov Exp $
+ * $Id: tools.cc,v 1.151 1998/03/05 00:43:09 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -123,9 +123,9 @@ static void shutdownTimeoutHandler(int fd, void *data);
 static void safeunlinkComplete(void *data, int retcode, int errcode);
 #endif
 #if MEM_GEN_TRACE
-extern void log_trace_done(); 
+extern void log_trace_done();
 extern void log_trace_init(char *);
-#endif 
+#endif
 
 void
 releaseServerSockets(void)
@@ -822,25 +822,25 @@ kb_incr(kb_t * k, size_t v)
 }
 
 void
-gb_flush(gb_t *g)
+gb_flush(gb_t * g)
 {
     g->gb += (g->bytes >> 30);
-    g->bytes &= (1<<30)-1;
+    g->bytes &= (1 << 30) - 1;
 }
 
 double
-gb_to_double(const gb_t *g)
+gb_to_double(const gb_t * g)
 {
-    return ((double)g->gb)*((double)(1<<30)) + ((double)g->bytes);
+    return ((double) g->gb) * ((double) (1 << 30)) + ((double) g->bytes);
 }
 
 const char *
-gb_to_str(const gb_t *g)
+gb_to_str(const gb_t * g)
 {
     /*
      * it is often convenient to call gb_to_str several times for _one_ printf
      */
-    #define max_cc_calls 5
+#define max_cc_calls 5
     typedef char GbBuf[32];
     static GbBuf bufs[max_cc_calls];
     static int call_id = 0;
@@ -848,11 +848,10 @@ gb_to_str(const gb_t *g)
     char *buf = bufs[call_id++];
     /* select format */
     if (value < 1e9)
-       snprintf(buf, sizeof(GbBuf), "%.2f MB", value/1e6);
-    else
-    if (value < 1e12)
-       snprintf(buf, sizeof(GbBuf), "%.2f GB", value/1e9);
+       snprintf(buf, sizeof(GbBuf), "%.2f MB", value / 1e6);
+    else if (value < 1e12)
+       snprintf(buf, sizeof(GbBuf), "%.2f GB", value / 1e9);
     else
-       snprintf(buf, sizeof(GbBuf), "%.2f TB", value/1e12);
+       snprintf(buf, sizeof(GbBuf), "%.2f TB", value / 1e12);
     return buf;
 }
index e4db68fb8895335b17987309702e539f51e78e49..7be1c8e1ccce606a134baf7b6b7df89431dc849a 100644 (file)
@@ -56,7 +56,7 @@ typedef struct _HttpHdrCc HttpHdrCc;
 typedef struct _HttpHeaderExtField HttpHeaderExtField;
 typedef struct _HttpHeaderEntry HttpHeaderEntry;
 typedef struct _HttpHeaderFieldStat HttpHeaderFieldStat;
-typedef union  _field_store field_store;
+typedef union _field_store field_store;
 typedef struct _HttpBody HttpBody;
 typedef struct _HttpReply HttpReply;
 typedef struct _HttpStateData HttpStateData;
index 7218b81aa8ce4a6516904fd70596beb931e8be8e..33638d7ed10ad91a32e84def0cbb80bd46741ece 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.102 1998/03/04 23:52:41 wessels Exp $
+ * $Id: wais.cc,v 1.103 1998/03/05 00:43:11 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -236,7 +236,7 @@ waisSendComplete(int fd, char *bufnotused, size_t size, int errflag, void *data)
     if (size > 0) {
        fd_bytes(fd, size, FD_WRITE);
        kb_incr(&Counter.server.all.kbytes_out, size);
-        kb_incr(&Counter.server.other.kbytes_out, size);
+       kb_incr(&Counter.server.other.kbytes_out, size);
     }
     if (errflag == COMM_ERR_CLOSING)
        return;