]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent
authorwessels <>
Tue, 31 Mar 1998 12:35:35 +0000 (12:35 +0000)
committerwessels <>
Tue, 31 Mar 1998 12:35:35 +0000 (12:35 +0000)
30 files changed:
src/CacheDigest.cc
src/HttpBody.cc
src/access_log.cc
src/cache_cf.cc
src/cache_diff.cc
src/cachemgr.cc
src/cbdata.cc
src/client.cc
src/client_side.cc
src/comm.cc
src/errorpage.cc
src/ftp.cc
src/globals.h
src/htcp.cc
src/http.cc
src/icp_v2.cc
src/icp_v3.cc
src/ident.cc
src/mime.cc
src/neighbors.cc
src/protos.h
src/ssl.cc
src/stat.cc
src/store_client.cc
src/structs.h
src/test_cache_digest.cc
src/tunnel.cc
src/url.cc
src/urn.cc
src/wais.cc

index 0c1941fb7ccc942f258bd0c2e6ece4d692938410..ebc07056ccfd4827cc20ebd31fbc5a158465574c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: CacheDigest.cc,v 1.1 1998/03/30 21:03:33 rousskov Exp $
+ * $Id: CacheDigest.cc,v 1.2 1998/03/31 05:35:35 wessels Exp $
  *
  * DEBUG: section ??    Cache Digest
  * AUTHOR: Alex Rousskov
@@ -44,16 +44,16 @@ CacheDigest *
 cacheDigestCreate(int capacity)
 {
     CacheDigest *cd = xcalloc(1, sizeof(CacheDigest));
-    assert(MD5_DIGEST_CHARS == 16); /* our hash functions rely on 16 byte keys */
+    assert(MD5_DIGEST_CHARS == 16);    /* our hash functions rely on 16 byte keys */
     assert(capacity > 0);
     cd->capacity = capacity;
-    cd->mask_size = (size_t) (capacity * BitsPerEntry + 7)/ 8;
+    cd->mask_size = (size_t) (capacity * BitsPerEntry + 7) / 8;
     cd->mask = xcalloc(cd->mask_size, 1);
     return cd;
 }
 
 void
-cacheDigestDestroy(CacheDigest *cd)
+cacheDigestDestroy(CacheDigest * cd)
 {
     assert(cd);
     xfree(cd->mask);
@@ -61,7 +61,7 @@ cacheDigestDestroy(CacheDigest *cd)
 }
 
 void
-cacheDigestAdd(CacheDigest *cd, const cache_key *key)
+cacheDigestAdd(CacheDigest * cd, const cache_key * key)
 {
     assert(cd && key);
     /* hash */
@@ -76,13 +76,13 @@ cacheDigestAdd(CacheDigest *cd, const cache_key *key)
 
 /* returns true if the key belongs to the digest */
 int
-cacheDigestTest(const CacheDigest *cd, const cache_key *key)
+cacheDigestTest(const CacheDigest * cd, const cache_key * key)
 {
     assert(cd && key);
     /* hash */
     cacheDigestHashKey(cd->capacity * BitsPerEntry, key);
     /* test corresponding bits */
-    return 
+    return
        CBIT_TEST(cd->mask, hashed_keys[0]) &&
        CBIT_TEST(cd->mask, hashed_keys[1]) &&
        CBIT_TEST(cd->mask, hashed_keys[2]) &&
@@ -90,7 +90,7 @@ cacheDigestTest(const CacheDigest *cd, const cache_key *key)
 }
 
 void
-cacheDigestDel(CacheDigest *cd, const cache_key *key)
+cacheDigestDel(CacheDigest * cd, const cache_key * key)
 {
     assert(cd && key);
     cd->del_count++;
@@ -109,5 +109,3 @@ cacheDigestHashKey(int bit_count, const char *key)
     hashed_keys[2] %= bit_count;
     hashed_keys[3] %= bit_count;
 }
-
-
index 51272abe5c2936191ea2867ed6ffe69c5073bd36..fddc77f04577377e2b7db1f28a3d362fedf17898 100644 (file)
@@ -1,5 +1,7 @@
+
+
 /*
- * $Id: HttpBody.cc,v 1.5 1998/02/26 18:00:30 wessels Exp $
+ * $Id: HttpBody.cc,v 1.6 1998/03/31 05:35:36 wessels Exp $
  *
  * DEBUG: section 56    HTTP Message Body
  * AUTHOR: Alex Rousskov
index 9940a8af1dd40f7d6c3b2fd6ecc9e2c83c8e7ba8..d29068c82bed88d7343c79e5d3a9c6728e20f7fb 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: access_log.cc,v 1.24 1998/03/31 03:57:14 wessels Exp $
+ * $Id: access_log.cc,v 1.25 1998/03/31 05:37:33 wessels Exp $
  *
  * DEBUG: section 46    Access Log
  * AUTHOR: Duane Wessels
@@ -63,15 +63,15 @@ const char *log_tags[] =
 
 #if FORW_VIA_DB
 typedef struct {
-        char *key;
-        void *next;
-        int n;
+    char *key;
+    void *next;
+    int n;
 } fvdb_entry;
 static hash_table *via_table = NULL;
 static hash_table *forw_table = NULL;
 static void fvdbInit(void);
-static void fvdbDumpTable(StoreEntry *e, hash_table *hash);
-static void fvdbCount(hash_table *hash, const char *key);
+static void fvdbDumpTable(StoreEntry * e, hash_table * hash);
+static void fvdbCount(hash_table * hash, const char *key);
 static OBJH fvdbDumpVia;
 static OBJH fvdbDumpForw;
 static FREE fvdbFreeEntry;
@@ -355,7 +355,7 @@ accessLogTime(time_t t)
 
 
 #if FORW_VIA_DB
-    
+
 static void
 fvdbInit(void)
 {
@@ -363,67 +363,68 @@ fvdbInit(void)
     forw_table = hash_create((HASHCMP *) strcmp, 977, hash4);
     cachemgrRegister("via_headers", "Via Request Headers", fvdbDumpVia, 0);
     cachemgrRegister("forw_headers", "X-Forwarded-For Request Headers",
-        fvdbDumpForw, 0);
+       fvdbDumpForw, 0);
 }
 
 static void
-fvdbCount(hash_table *hash, const char *key)
-{   
-        fvdb_entry *fv;
-        if (NULL == hash)
-                return;
-        fv = hash_lookup(hash, key);
-        if (NULL == fv) {
-                fv = xcalloc(1, sizeof(fvdb_entry));
-                fv->key = xstrdup(key);
-                hash_join(hash, (hash_link *) fv);
-        }
-        fv->n++;
+fvdbCount(hash_table * hash, const char *key)
+{
+    fvdb_entry *fv;
+    if (NULL == hash)
+       return;
+    fv = hash_lookup(hash, key);
+    if (NULL == fv) {
+       fv = xcalloc(1, sizeof(fvdb_entry));
+       fv->key = xstrdup(key);
+       hash_join(hash, (hash_link *) fv);
+    }
+    fv->n++;
 }
 
 void
 fvdbCountVia(const char *key)
 {
-       fvdbCount(via_table, key);
+    fvdbCount(via_table, key);
 }
 
 void
 fvdbCountForw(const char *key)
 {
-       fvdbCount(forw_table, key);
+    fvdbCount(forw_table, key);
 }
 
-static void 
-fvdbDumpTable(StoreEntry *e, hash_table *hash)
+static void
+fvdbDumpTable(StoreEntry * e, hash_table * hash)
 {
-        hash_link *h;
-        fvdb_entry *fv;
-        if (hash == NULL)  
-                return;
-        for (h = hash_first(hash); h != NULL; h = hash_next(hash)) {
-                fv = (fvdb_entry *) h;
-                storeAppendPrintf(e, "%9d %s\n", fv->n, fv->key);
-        }
+    hash_link *h;
+    fvdb_entry *fv;
+    if (hash == NULL)
+       return;
+    for (h = hash_first(hash); h != NULL; h = hash_next(hash)) {
+       fv = (fvdb_entry *) h;
+       storeAppendPrintf(e, "%9d %s\n", fv->n, fv->key);
+    }
 }
 
 static void
-fvdbDumpVia(StoreEntry *e)
+fvdbDumpVia(StoreEntry * e)
 {
-        fvdbDumpTable(e, via_table);
+    fvdbDumpTable(e, via_table);
 }
-    
+
 static void
-fvdbDumpForw(StoreEntry *e)
+fvdbDumpForw(StoreEntry * e)
 {
-        fvdbDumpTable(e, forw_table); 
+    fvdbDumpTable(e, forw_table);
 }
 
 static
-void fvdbFreeEntry(void *data)
+void 
+fvdbFreeEntry(void *data)
 {
-       fvdb_entry *fv = data;
-       xfree(fv->key);
-       xfree(fv);
+    fvdb_entry *fv = data;
+    xfree(fv->key);
+    xfree(fv);
 }
 
 static void
@@ -433,4 +434,4 @@ fvdbClear(void)
     hashFreeItems(forw_table, fvdbFreeEntry);
 }
 
-#endif  
+#endif
index 19130b29df722df85a2b090a37120646c7466ee8..88469944ea872fa17ee32107a259eb3643ac6314 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.268 1998/03/31 04:09:48 wessels Exp $
+ * $Id: cache_cf.cc,v 1.269 1998/03/31 05:37:34 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -442,16 +442,15 @@ dump_acl_access(StoreEntry * entry, const char *name, acl_access * head)
 static void
 parse_snmp_access(communityEntry ** head)
 {
-    char *t=NULL;
+    char *t = NULL;
     communityEntry *cp;
 /* This is tricky: we need to define the communities here, assuming that 
  communities and the MIB have already been defined */
-    
* communities and the MIB have already been defined */
+
     if (!snmpInitConfig()) {
-       debug(15,0)("parse_snmp_access: Access lists NOT defined.\n");
+       debug(15, 0) ("parse_snmp_access: Access lists NOT defined.\n");
        return;
     }
-
     t = strtok(NULL, w_space);
     for (cp = *head; cp; cp = cp->next)
        if (!strcmp(t, cp->name)) {
index ffcfbf52b9769f255f29c424fdce533b31cdf912..8238eeb37ac32cc1d0682d230e9530ba9224caae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cache_diff.cc,v 1.6 1998/03/29 21:01:49 rousskov Exp $
+ * $Id: cache_diff.cc,v 1.7 1998/03/31 05:37:35 wessels Exp $
  *
  * AUTHOR: Alex Rousskov
  *
 typedef struct {
     const char *name;
     hash_table *hash;
-    int count;          /* #currently cached entries */
-    int scanned_count;  /* #scanned entries */
-    int bad_add_count;  /* #duplicate adds */
-    int bad_del_count;  /* #dels with no prior add */
+    int count;                 /* #currently cached entries */
+    int scanned_count;         /* #scanned entries */
+    int bad_add_count;         /* #duplicate adds */
+    int bad_del_count;         /* #dels with no prior add */
 } CacheIndex;
 
 
@@ -67,11 +67,11 @@ const char *RequestMethodStr[] =
 };
 
 
-static int cacheIndexScan(CacheIndex *idx, const char *fname, FILE *file);
+static int cacheIndexScan(CacheIndex * idx, const char *fname, FILE * file);
 
 
 static CacheEntry *
-cacheEntryCreate(const storeSwapLogData *s)
+cacheEntryCreate(const storeSwapLogData * s)
 {
     CacheEntry *e = xcalloc(1, sizeof(CacheEntry));
     assert(s);
@@ -82,7 +82,7 @@ cacheEntryCreate(const storeSwapLogData *s)
 }
 
 static void
-cacheEntryDestroy(CacheEntry *e)
+cacheEntryDestroy(CacheEntry * e)
 {
     assert(e);
     xfree(e);
@@ -103,14 +103,14 @@ cacheIndexCreate(const char *name)
 }
 
 static void
-cacheIndexDestroy(CacheIndex *idx)
+cacheIndexDestroy(CacheIndex * idx)
 {
     hash_link *hashr = NULL;
     if (idx) {
        /* destroy hash list contents */
        for (hashr = hash_first(idx->hash); hashr; hashr = hash_next(idx->hash)) {
            hash_remove_link(idx->hash, hashr);
-           cacheEntryDestroy((CacheEntry*)hashr);
+           cacheEntryDestroy((CacheEntry *) hashr);
        }
        /* destroy the hash table itself */
        hashFreeMemory(idx->hash);
@@ -119,7 +119,7 @@ cacheIndexDestroy(CacheIndex *idx)
 }
 
 static int
-cacheIndexAddLog(CacheIndex *idx, const char *fname)
+cacheIndexAddLog(CacheIndex * idx, const char *fname)
 {
     FILE *file;
     int scanned_count = 0;
@@ -131,7 +131,6 @@ cacheIndexAddLog(CacheIndex *idx, const char *fname)
        fprintf(stderr, "cannot open %s: %s\n", fname, strerror(errno));
        return 0;
     }
-
     scanned_count = cacheIndexScan(idx, fname, file);
 
     fclose(file);
@@ -139,19 +138,19 @@ cacheIndexAddLog(CacheIndex *idx, const char *fname)
 }
 
 static void
-cacheIndexInitReport(CacheIndex *idx)
+cacheIndexInitReport(CacheIndex * idx)
 {
     assert(idx);
     fprintf(stderr, "%s: bad swap_add:  %d\n",
        idx->name, idx->bad_add_count);
-    fprintf(stderr, "%s: bad swap_del:  %d\n", 
+    fprintf(stderr, "%s: bad swap_del:  %d\n",
        idx->name, idx->bad_del_count);
-    fprintf(stderr, "%s: scanned lines: %d\n", 
+    fprintf(stderr, "%s: scanned lines: %d\n",
        idx->name, idx->scanned_count);
 }
 
 static int
-cacheIndexScan(CacheIndex *idx, const char *fname, FILE *file)
+cacheIndexScan(CacheIndex * idx, const char *fname, FILE * file)
 {
     int count = 0;
     storeSwapLogData s;
@@ -160,24 +159,23 @@ cacheIndexScan(CacheIndex *idx, const char *fname, FILE *file)
        count++;
        idx->scanned_count++;
        /* if (s.op <= SWAP_LOG_NOP || s.op >= SWAP_LOG_MAX)
-           continue; */
+        * continue; */
        if (s.op == SWAP_LOG_ADD) {
            CacheEntry *olde = (CacheEntry *) hash_lookup(idx->hash, s.key);
            if (olde) {
                idx->bad_add_count++;
            } else {
                CacheEntry *e = cacheEntryCreate(&s);
-               hash_join(idx->hash, (hash_link*) e);
+               hash_join(idx->hash, (hash_link *) e);
                idx->count++;
            }
-       } else
-       if (s.op == SWAP_LOG_DEL) {
+       } else if (s.op == SWAP_LOG_DEL) {
            CacheEntry *olde = (CacheEntry *) hash_lookup(idx->hash, s.key);
            if (!olde)
                idx->bad_del_count++;
            else {
                assert(idx->count);
-               hash_remove_link(idx->hash, (hash_link*) olde);
+               hash_remove_link(idx->hash, (hash_link *) olde);
                cacheEntryDestroy(olde);
                idx->count--;
            }
@@ -186,13 +184,13 @@ cacheIndexScan(CacheIndex *idx, const char *fname, FILE *file)
            exit(-3);
        }
     }
-    fprintf(stderr, "%s:%d: scanned (size: %d bytes)\n", 
-       fname, count, (int)(count*sizeof(CacheEntry)));
+    fprintf(stderr, "%s:%d: scanned (size: %d bytes)\n",
+       fname, count, (int) (count * sizeof(CacheEntry)));
     return count;
 }
 
 static void
-cacheIndexCmpReport(CacheIndex *idx, int shared_count)
+cacheIndexCmpReport(CacheIndex * idx, int shared_count)
 {
     assert(idx && shared_count <= idx->count);
 
@@ -201,12 +199,12 @@ cacheIndexCmpReport(CacheIndex *idx, int shared_count)
        idx->count,
        idx->count - shared_count,
        shared_count,
-       xpercent(idx->count-shared_count, idx->count),
+       xpercent(idx->count - shared_count, idx->count),
        xpercent(shared_count, idx->count));
 }
 
 static void
-cacheIndexCmp(CacheIndex *idx1, CacheIndex *idx2)
+cacheIndexCmp(CacheIndex * idx1, CacheIndex * idx2)
 {
     int shared_count = 0;
     int hashed_count = 0;
@@ -256,12 +254,12 @@ main(int argc, char *argv[])
        const int len = strlen(argv[i]);
        if (!len)
            return usage(argv[0]);
-       if (argv[i][len-1] == ':') {
+       if (argv[i][len - 1] == ':') {
            idxCount++;
            if (len < 2 || idxCount > 2)
                return usage(argv[0]);
            idx = cacheIndexCreate(argv[i]);
-           CacheIdx[idxCount-1] = idx;
+           CacheIdx[idxCount - 1] = idx;
        } else {
            if (!idx)
                return usage(argv[0]);
index 28f34b19a401f45c035aca1c1c6e56fedcb64dec..2b78e489ca070e3e9655e91fae9c90fd28633c1a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cachemgr.cc,v 1.77 1998/03/07 20:17:44 rousskov Exp $
+ * $Id: cachemgr.cc,v 1.78 1998/03/31 05:37:35 wessels Exp $
  *
  * DEBUG: section 0     CGI Cache Manager
  * AUTHOR: Duane Wessels
@@ -662,7 +662,7 @@ make_pub_auth(cachemgr_request * req)
     /* host | time | user | passwd */
     snprintf(buf, sizeof(buf), "%s|%d|%s|%s",
        req->hostname,
-       (int)now,
+       (int) now,
        req->user_name ? req->user_name : "",
        req->passwd);
     debug(3) fprintf(stderr, "cmgr: pre-encoded for pub: %s\n", buf);
index f3083f7b3fca24f38125eea02410d20b5f33f4db..a2906eb8aeffd6bf7208cd3e5e76ce9644114e41 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cbdata.cc,v 1.18 1998/03/30 22:58:51 wessels Exp $
+ * $Id: cbdata.cc,v 1.19 1998/03/31 05:37:36 wessels Exp $
  *
  * DEBUG: section 45    Callback Data Registry
  * AUTHOR: Duane Wessels
@@ -80,7 +80,7 @@ typedef struct _cbdata {
 
 static HASHCMP cbdata_cmp;
 static HASHHASH cbdata_hash;
-static void cbdataReallyFree(cbdata *c);
+static void cbdataReallyFree(cbdata * c);
 
 static int
 cbdata_cmp(const void *p1, const void *p2)
@@ -130,7 +130,7 @@ cbdataAdd(const void *p, mem_type mem_type)
 }
 
 static void
-cbdataReallyFree(cbdata *c)
+cbdataReallyFree(cbdata * c)
 {
     mem_type mem_type = c->mem_type;
     void *p = (void *) c->key;
@@ -139,9 +139,9 @@ cbdataReallyFree(cbdata *c)
     xfree(c);
     debug(45, 3) ("cbdataReallyFree: Freeing %p\n", p);
     if (mem_type == MEM_NONE)
-        xfree(p);
+       xfree(p);
     else
-        memFree(mem_type, p);
+       memFree(mem_type, p);
 }
 
 void
index 582dcc10bbf1364d5d770100d52cf4b38a1fecef..dea83d4fafdff8e3c21d4a207ff6ffa359d63218 100644 (file)
@@ -2,8 +2,9 @@
 
 
 
+
 /*
- * $Id: client.cc,v 1.61 1998/03/28 23:24:42 wessels Exp $
+ * $Id: client.cc,v 1.62 1998/03/31 05:37:36 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
index 2d2a9ecea984980f0737fa468e8b0ce93b7d3b3e..e0f93739b9dff3b8082a59d6cd1b94cb47597787 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.241 1998/03/31 05:35:22 wessels Exp $
+ * $Id: client_side.cc,v 1.242 1998/03/31 05:37:37 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -277,7 +277,7 @@ clientGetsOldEntry(StoreEntry * new_entry, StoreEntry * old_entry, request_t * r
      * need to send the old object */
     if (modifiedSince(old_entry, request)) {
        debug(33, 5) ("clientGetsOldEntry: YES, modified since %d\n",
-               (int) request->ims);
+           (int) request->ims);
        return 1;
     }
     debug(33, 5) ("clientGetsOldEntry: NO, new one is fine\n");
@@ -959,7 +959,7 @@ clientSendMoreData(void *data, char *buf, ssize_t size)
            size_t k;
            if ((k = headersEnd(buf, size))) {
                safe_free(http->al.headers.reply);
-               http->al.headers.reply = xcalloc(k+1, 1);
+               http->al.headers.reply = xcalloc(k + 1, 1);
                xstrncpy(http->al.headers.reply, buf, k);
            }
        }
@@ -1539,7 +1539,7 @@ parseHttpRequest(ConnStateData * conn, method_t * method_p, int *status,
        *status = -1;
        return http;
 #else
-       http_ver = (float) 0.9; /* wild guess */
+       http_ver = (float) 0.9; /* wild guess */
 #endif
     } else
        http_ver = (float) atof(token + 5);
@@ -2194,4 +2194,3 @@ clientHttpConnectionsClose(void)
     }
     NHttpSockets = 0;
 }
-
index 9961d06bebec164fddb6d497963442bd4c67fac1..5cdd1a7f1866067c8ecc251cd93142343c5bf905 100644 (file)
@@ -1,6 +1,7 @@
 
+
 /*
- * $Id: comm.cc,v 1.241 1998/03/31 05:34:46 wessels Exp $
+ * $Id: comm.cc,v 1.242 1998/03/31 05:37:38 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
index 290177da49d3c6e7e202da9d560894a2a0c83c82..f56f686e0bff7dd524630c39dab18c56c063aa7e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.123 1998/03/28 05:24:34 wessels Exp $
+ * $Id: errorpage.cc,v 1.124 1998/03/31 05:37:39 wessels Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -53,9 +53,10 @@ typedef struct {
  * to give you more control on the format
  */
 static const struct {
-    int type; /* and page_id */
+    int type;                  /* and page_id */
     const char *text;
 } error_hard_text[] = {
+
     {
        ERR_SQUID_SIGNATURE,
            "\n<br clear=\"all\">\n"
@@ -95,19 +96,19 @@ errorInitialize(void)
     int i;
     const char *text;
     error_page_count = ERR_MAX + ErrorDynamicPages.count;
-    error_text = xcalloc(error_page_count, sizeof(char*));
+    error_text = xcalloc(error_page_count, sizeof(char *));
     for (i = ERR_NONE + 1; i < error_page_count; i++) {
        safe_free(error_text[i]);
        /* hard-coded ? */
        if ((text = errorFindHardText(i)))
            error_text[i] = xstrdup(text);
        else
-       /* precompiled ? */
+           /* precompiled ? */
        if (i < ERR_MAX)
            error_text[i] = errorLoadText(err_type_str[i]);
        /* dynamic */
        else {
-           ErrorDynamicPageInfo *info = ErrorDynamicPages.items[i-ERR_MAX];
+           ErrorDynamicPageInfo *info = ErrorDynamicPages.items[i - ERR_MAX];
            assert(info && info->id == i && info->page_name);
            error_text[i] = errorLoadText(info->page_name);
        }
@@ -179,7 +180,7 @@ errorDynamicPageInfoCreate(int id, const char *page_name)
 }
 
 static void
-errorDynamicPageInfoDestroy(ErrorDynamicPageInfo *info)
+errorDynamicPageInfoDestroy(ErrorDynamicPageInfo * info)
 {
     assert(info);
     xfree(info->page_name);
@@ -189,8 +190,8 @@ errorDynamicPageInfoDestroy(ErrorDynamicPageInfo *info)
 int
 errorReservePageId(const char *page_name)
 {
-    ErrorDynamicPageInfo *info = 
-       errorDynamicPageInfoCreate(ERR_MAX + ErrorDynamicPages.count, page_name);
+    ErrorDynamicPageInfo *info =
+    errorDynamicPageInfoCreate(ERR_MAX + ErrorDynamicPages.count, page_name);
     stackPush(&ErrorDynamicPages, info);
     return info->id;
 }
@@ -216,7 +217,7 @@ ErrorState *
 errorCon(int type, http_status status)
 {
     ErrorState *err = xcalloc(1, sizeof(ErrorState));
-    err->page_id = type; /* has to be reset manually if needed */
+    err->page_id = type;       /* has to be reset manually if needed */
     err->type = type;
     err->http_status = status;
     return err;
index 60a272e932b89b90d721b8718402f9d87527a239..f10aefbe8025aed9316957ac3456c688c3d645b4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.215 1998/03/28 20:31:51 wessels Exp $
+ * $Id: ftp.cc,v 1.216 1998/03/31 05:37:40 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -1574,7 +1574,7 @@ ftpReadPasv(FtpStateData * ftpState)
     }
     port = ((p1 << 8) + p2);
     if (0 == port) {
-       debug(9,1)("ftpReadPasv: Invalid PASV reply: %s\n", buf);
+       debug(9, 1) ("ftpReadPasv: Invalid PASV reply: %s\n", buf);
        ftpSendPort(ftpState);
        return;
     }
index f8da6e0ab2234a122525cc31f54bf565cbcab30f..ea62e12a55e5de9e13d28c17a52e4f8ad5ac8154 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: globals.h,v 1.46 1998/03/31 05:34:47 wessels Exp $
+ * $Id: globals.h,v 1.47 1998/03/31 05:37:41 wessels Exp $
  */
 
 extern FILE *debug_log;                /* NULL */
@@ -81,7 +81,7 @@ extern struct timeval current_time;
 extern struct timeval squid_start;
 extern time_t squid_curtime;   /* 0 */
 extern int shutting_down;      /* 0 */
-extern int reconfiguring;      /* 0 */
+extern int reconfiguring;      /* 0 */
 extern int store_rebuilding;   /* 1 */
 extern int store_swap_size;    /* 0 */
 extern unsigned long store_mem_size;   /* 0 */
index e8fc3f689029bdabb92c688c5f881cce48839f81..703106d21d23d194ebf01ea13f8a857c3c6223e2 100644 (file)
@@ -84,13 +84,14 @@ enum {
     HTCP_END
 };
 
-static const char *const htcpOpcodeStr[] = {
-       "HTCP_NOP",
-       "HTCP_TST",
-       "HTCP_MON",
-       "HTCP_SET",
-       "HTCP_CLR",
-       "HTCP_END"
+static const char *const htcpOpcodeStr[] =
+{
+    "HTCP_NOP",
+    "HTCP_TST",
+    "HTCP_MON",
+    "HTCP_SET",
+    "HTCP_CLR",
+    "HTCP_END"
 };
 
 /*
@@ -246,7 +247,7 @@ htcpBuildPacket(htcpStuff * stuff, ssize_t * len)
     if (s < 0)
        return NULL;
     off += s;
-    hdr.length = htons((u_short)off);
+    hdr.length = htons((u_short) off);
     hdr.major = 0;
     hdr.minor = 0;
     xmemcpy(buf, &hdr, hdr_sz);
@@ -309,107 +310,107 @@ htcpFreeSpecifier(htcpSpecifier * s)
 int
 htcpUnpackCountstr(char *buf, int sz, char **str)
 {
-       u_short l;
-       debug(31,1)("htcpUnpackCountstr: sz = %d\n", sz);
-       if (sz < 2) {
-           debug(31,1)("htcpUnpackCountstr: sz < 2\n");
-           return -1;
-       }
-       xmemcpy(&l, buf, 2);
-       l = ntohl(l);
-       buf += 2;
-       sz -= 2;
-       debug(31,1)("htcpUnpackCountstr: LENGTH = %d\n", (int) l);
-       if (sz < l) {
-           debug(31,1)("htcpUnpackCountstr: sz(%d) < l(%d)\n", sz, l);
-           return -1;
-       }
-       if (str) {
-               *str = xmalloc(l+1);
-               xstrncpy(*str, buf, l+1);
-               debug(31,1)("htcpUnpackCountstr: TEXT = %s\n", *str);
-       }
-       return (int)l+2;
+    u_short l;
+    debug(31, 1) ("htcpUnpackCountstr: sz = %d\n", sz);
+    if (sz < 2) {
+       debug(31, 1) ("htcpUnpackCountstr: sz < 2\n");
+       return -1;
+    }
+    xmemcpy(&l, buf, 2);
+    l = ntohl(l);
+    buf += 2;
+    sz -= 2;
+    debug(31, 1) ("htcpUnpackCountstr: LENGTH = %d\n", (int) l);
+    if (sz < l) {
+       debug(31, 1) ("htcpUnpackCountstr: sz(%d) < l(%d)\n", sz, l);
+       return -1;
+    }
+    if (str) {
+       *str = xmalloc(l + 1);
+       xstrncpy(*str, buf, l + 1);
+       debug(31, 1) ("htcpUnpackCountstr: TEXT = %s\n", *str);
+    }
+    return (int) l + 2;
 }
 
 
 htcpSpecifier *
 htcpUnpackSpecifier(char *buf, int sz)
 {
-       htcpSpecifier *s = xcalloc(1, sizeof(htcpSpecifier));
-       int o;
-
-       o = htcpUnpackCountstr(buf, sz, &s->method);
-       if (o < 0) {
-               debug(31,1)("htcpUnpackSpecifier: failed to unpack METHOD\n");
-               htcpFreeSpecifier(s);
-               return NULL;
-       }
-       buf += o;
-       sz -= o;
-
-       o = htcpUnpackCountstr(buf, sz, &s->uri);
-       if (o < 0) {
-               debug(31,1)("htcpUnpackSpecifier: failed to unpack URI\n");
-               htcpFreeSpecifier(s);
-               return NULL;
-       }
-       buf += o;
-       sz -= o;
-
-       o = htcpUnpackCountstr(buf, sz, &s->version);
-       if (o < 0) {
-               debug(31,1)("htcpUnpackSpecifier: failed to unpack VERSION\n");
-               htcpFreeSpecifier(s);
-               return NULL;
-       }
-       buf += o;
-       sz -= o;
-
-       o = htcpUnpackCountstr(buf, sz, &s->req_hdrs);
-       if (o < 0) {
-               debug(31,1)("htcpUnpackSpecifier: failed to unpack REQ-HDRS\n");
-               htcpFreeSpecifier(s);
-               return NULL;
-       }
-       buf += o;
-       sz -= o;
+    htcpSpecifier *s = xcalloc(1, sizeof(htcpSpecifier));
+    int o;
 
-       return s;
+    o = htcpUnpackCountstr(buf, sz, &s->method);
+    if (o < 0) {
+       debug(31, 1) ("htcpUnpackSpecifier: failed to unpack METHOD\n");
+       htcpFreeSpecifier(s);
+       return NULL;
+    }
+    buf += o;
+    sz -= o;
+
+    o = htcpUnpackCountstr(buf, sz, &s->uri);
+    if (o < 0) {
+       debug(31, 1) ("htcpUnpackSpecifier: failed to unpack URI\n");
+       htcpFreeSpecifier(s);
+       return NULL;
+    }
+    buf += o;
+    sz -= o;
+
+    o = htcpUnpackCountstr(buf, sz, &s->version);
+    if (o < 0) {
+       debug(31, 1) ("htcpUnpackSpecifier: failed to unpack VERSION\n");
+       htcpFreeSpecifier(s);
+       return NULL;
+    }
+    buf += o;
+    sz -= o;
+
+    o = htcpUnpackCountstr(buf, sz, &s->req_hdrs);
+    if (o < 0) {
+       debug(31, 1) ("htcpUnpackSpecifier: failed to unpack REQ-HDRS\n");
+       htcpFreeSpecifier(s);
+       return NULL;
+    }
+    buf += o;
+    sz -= o;
+
+    return s;
 }
 
 static void
 htcpHandleNop(char *buf, int sz, struct sockaddr_in *from)
 {
-       debug(31,1)("htcpHandleNop: Unimplemented\n");
+    debug(31, 1) ("htcpHandleNop: Unimplemented\n");
 }
 
 static void
 htcpHandleTst(char *buf, int sz, struct sockaddr_in *from)
 {
-       /* buf should be a SPECIFIER */
-       htcpSpecifier *s = htcpUnpackSpecifier(buf, sz);
-       if (NULL == s) {
-               debug(31,1)("htcpHandleTst: htcpUnpackSpecifier failed\n");
-               return;
-       }
-       debug(31,1)("htcpHandleTst: %s %s %s\n",
-               s->method,
-               s->uri,
-               s->version);
-       debug(31,1)("htcpHandleTst: %s\n", s->req_hdrs);
+    /* buf should be a SPECIFIER */
+    htcpSpecifier *s = htcpUnpackSpecifier(buf, sz);
+    if (NULL == s) {
+       debug(31, 1) ("htcpHandleTst: htcpUnpackSpecifier failed\n");
+       return;
+    }
+    debug(31, 1) ("htcpHandleTst: %s %s %s\n",
+       s->method,
+       s->uri,
+       s->version);
+    debug(31, 1) ("htcpHandleTst: %s\n", s->req_hdrs);
 }
 
 static void
 htcpHandleMon(char *buf, int sz, struct sockaddr_in *from)
 {
-       debug(31,1)("htcpHandleMon: Unimplemented\n");
+    debug(31, 1) ("htcpHandleMon: Unimplemented\n");
 }
 
 static void
 htcpHandleSet(char *buf, int sz, struct sockaddr_in *from)
 {
-       debug(31,1)("htcpHandleSet: Unimplemented\n");
+    debug(31, 1) ("htcpHandleSet: Unimplemented\n");
 }
 
 static void
@@ -417,31 +418,31 @@ htcpHandleData(char *buf, int sz, struct sockaddr_in *from)
 {
     htcpDataHeader hdr;
     if (sz < sizeof(htcpDataHeader)) {
-       debug(31,0)("htcpHandleData: msg size less than htcpDataHeader size\n");
+       debug(31, 0) ("htcpHandleData: msg size less than htcpDataHeader size\n");
        return;
     }
     xmemcpy(&hdr, buf, sizeof(htcpDataHeader));
     hdr.length = ntohs(hdr.length);
     hdr.msg_id = ntohs(hdr.msg_id);
-    debug(31,1)("htcpHandleData: length = %d\n", (int) hdr.length);
+    debug(31, 1) ("htcpHandleData: length = %d\n", (int) hdr.length);
     if (hdr.opcode < HTCP_NOP || hdr.opcode > HTCP_END) {
-       debug(31,0)("htcpHandleData: opcode %d out of range\n",
+       debug(31, 0) ("htcpHandleData: opcode %d out of range\n",
            (int) hdr.opcode);
        return;
     }
-    debug(31,1)("htcpHandleData: opcode = %d %s\n",
+    debug(31, 1) ("htcpHandleData: opcode = %d %s\n",
        (int) hdr.opcode, htcpOpcodeStr[hdr.opcode]);
-    debug(31,1)("htcpHandleData: response = %d\n", (int) hdr.response);
-    debug(31,1)("htcpHandleData: F1 = %d\n", (int) hdr.F1);
-    debug(31,1)("htcpHandleData: RR = %d\n", (int) hdr.RR);
-    debug(31,1)("htcpHandleData: msg_id = %#x\n", (int) hdr.msg_id);
+    debug(31, 1) ("htcpHandleData: response = %d\n", (int) hdr.response);
+    debug(31, 1) ("htcpHandleData: F1 = %d\n", (int) hdr.F1);
+    debug(31, 1) ("htcpHandleData: RR = %d\n", (int) hdr.RR);
+    debug(31, 1) ("htcpHandleData: msg_id = %#x\n", (int) hdr.msg_id);
     if (sz < hdr.length) {
-       debug(31,0)("htcpHandle: sz < hdr.length\n");
+       debug(31, 0) ("htcpHandle: sz < hdr.length\n");
        return;
     }
     buf += sizeof(htcpDataHeader);
     sz -= sizeof(htcpDataHeader);
-    switch(hdr.opcode) {
+    switch (hdr.opcode) {
     case HTCP_NOP:
        htcpHandleNop(buf, sz, from);
        break;
@@ -465,16 +466,16 @@ htcpHandle(char *buf, int sz, struct sockaddr_in *from)
 {
     htcpHeader htcpHdr;
     if (sz < sizeof(htcpHeader)) {
-       debug(31,0)("htcpHandle: msg size less than htcpHeader size\n");
+       debug(31, 0) ("htcpHandle: msg size less than htcpHeader size\n");
        return;
     }
     xmemcpy(&htcpHdr, buf, sizeof(htcpHeader));
     htcpHdr.length = ntohs(htcpHdr.length);
-    debug(31,1)("htcpHandle: htcpHdr.length = %d\n", (int) htcpHdr.length);
-    debug(31,1)("htcpHandle: htcpHdr.major = %d\n", (int) htcpHdr.major);
-    debug(31,1)("htcpHandle: htcpHdr.minor = %d\n", (int) htcpHdr.minor);
+    debug(31, 1) ("htcpHandle: htcpHdr.length = %d\n", (int) htcpHdr.length);
+    debug(31, 1) ("htcpHandle: htcpHdr.major = %d\n", (int) htcpHdr.major);
+    debug(31, 1) ("htcpHandle: htcpHdr.minor = %d\n", (int) htcpHdr.minor);
     if (sz != htcpHdr.length) {
-       debug(31,0)("htcpHandle: sz != htcpHdr.length\n");
+       debug(31, 0) ("htcpHandle: sz != htcpHdr.length\n");
        return;
     }
     buf += sizeof(htcpHeader);
@@ -536,39 +537,39 @@ htcpInit(void)
 /*  
  * htcpSocketShutdown only closes the 'in' socket if it is
  * different than the 'out' socket.
- */ 
+ */
 void
 htcpSocketShutdown(void)
-{   
+{
     if (htcpInSocket < 0)
-        return;
-    if (htcpInSocket != htcpOutSocket) { 
-        debug(12, 1) ("FD %d Closing HTCP socket\n", htcpInSocket);
-        comm_close(htcpInSocket);
-    }       
+       return;
+    if (htcpInSocket != htcpOutSocket) {
+       debug(12, 1) ("FD %d Closing HTCP socket\n", htcpInSocket);
+       comm_close(htcpInSocket);
+    }
     /*      
      * Here we set 'htcpInSocket' to -1 even though the HTCP 'in'
      * and 'out' sockets might be just one FD.  This prevents this
      * function from executing repeatedly.  When we are really ready to
      * exit or restart, main will comm_close the 'out' descriptor.
-     */     
+     */
     htcpInSocket = -1;
     /*      
      * Normally we only write to the outgoing HTCP socket, but
      * we also have a read handler there to catch messages sent
      * to that specific interface.  During shutdown, we must
      * disable reading on the outgoing socket.
-     */     
+     */
     assert(htcpOutSocket > -1);
     commSetSelect(htcpOutSocket, COMM_SELECT_READ, NULL, NULL, 0);
 }
 
-void    
+void
 htcpSocketClose(void)
 {
     htcpSocketShutdown();
     if (htcpOutSocket > -1) {
-        debug(12, 1) ("FD %d Closing HTCP socket\n", htcpOutSocket);
-        comm_close(htcpOutSocket);
-    }   
-}   
+       debug(12, 1) ("FD %d Closing HTCP socket\n", htcpOutSocket);
+       comm_close(htcpOutSocket);
+    }
+}
index b2a8833e55f105fa0674dfd1460d2d8b16853d36..aa6cc9663caf1d3a891b00cc5e8917647dd6c9ab 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.260 1998/03/31 05:35:23 wessels Exp $
+ * $Id: http.cc,v 1.261 1998/03/31 05:37:42 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -470,7 +470,7 @@ httpReadReply(int fd, void *data)
            err->xerrno = errno;
            err->request = requestLink(httpState->orig_request);
            errorAppendEntry(entry, err);
-          comm_close(fd);
+           comm_close(fd);
        } else {
            storeAbort(entry, 0);
            comm_close(fd);
@@ -626,7 +626,7 @@ httpBuildRequestHeader(request_t * request,
        if (l > 4096)
            l = 4096;
        if (0 == l)
-          break;
+           break;
        xstrncpy(xbuf, t, l);
        debug(11, 5) ("httpBuildRequestHeader: %s\n", xbuf);
        if (strncasecmp(xbuf, "Proxy-Connection:", 17) == 0)
index 32893865248ee0451bb8e0a7d62d315af61438f5..6a0f72300f36ae56373781da9a1e08693a040e2a 100644 (file)
@@ -47,7 +47,7 @@ icpUdpReply(int fd, void *data)
        } else {
            Counter.icp.pkts_sent++;
            if (queue->logcode == LOG_UDP_HIT)
-               Counter.icp.hits_sent++;
+               Counter.icp.hits_sent++;
            kb_incr(&Counter.icp.kbytes_sent, (size_t) x);
        }
        UdpQueueHead = queue->next;
@@ -202,7 +202,7 @@ icpHandleIcpV2(int fd, struct sockaddr_in from, char *buf, int len)
                 * count this DENIED query in the clientdb, even though
                 * we're not sending an ICP reply...
                 */
-               clientdbUpdate(from.sin_addr, LOG_UDP_DENIED, Config.Port.icp,0);
+               clientdbUpdate(from.sin_addr, LOG_UDP_DENIED, Config.Port.icp, 0);
            } else {
                reply = icpCreateMessage(ICP_DENIED, 0, url, header.reqnum, 0);
                icpUdpSend(fd, &from, reply, LOG_UDP_DENIED, icp_request->protocol);
index 4a8a97089ddd44af0790b4388251e415e345c7ca..905262d1c96c7265f533079fad862b09275de325 100644 (file)
@@ -24,8 +24,8 @@ icpHandleIcpV3(int fd, struct sockaddr_in from, char *buf, int len)
 
     method = header.reqnum >> 24;
     /* Squid-1.1 doesn't use the "method bits" for METHOD_GET */
-    if (METHOD_NONE == method || METHOD_ENUM_END <= method) 
-        method = METHOD_GET;
+    if (METHOD_NONE == method || METHOD_ENUM_END <= method)
+       method = METHOD_GET;
     switch (header.opcode) {
     case ICP_QUERY:
        /* We have a valid packet */
@@ -46,7 +46,7 @@ icpHandleIcpV3(int fd, struct sockaddr_in from, char *buf, int len)
                 * count this DENIED query in the clientdb, even though
                 * we're not sending an ICP reply...
                 */
-               clientdbUpdate(from.sin_addr, LOG_UDP_DENIED, Config.Port.icp,0);
+               clientdbUpdate(from.sin_addr, LOG_UDP_DENIED, Config.Port.icp, 0);
            } else {
                reply = icpCreateMessage(ICP_DENIED, 0, url, header.reqnum, 0);
                icpUdpSend(fd, &from, reply, LOG_UDP_DENIED, icp_request->protocol);
index 860689d9556410d99762c1c6964b08be68f70480..c088c6c7e874ca0ef296dcd5e7cb380e486c6f16 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ident.cc,v 1.39 1998/03/27 22:44:23 wessels Exp $
+ * $Id: ident.cc,v 1.40 1998/03/31 05:37:45 wessels Exp $
  *
  * DEBUG: section 30    Ident (RFC 931)
  * AUTHOR: Duane Wessels
@@ -50,7 +50,7 @@ static void
 identTimeout(int fd, void *data)
 {
     ConnStateData *connState = data;
-    debug(30,3)("identTimeout: FD %d, %s\n", fd,
+    debug(30, 3) ("identTimeout: FD %d, %s\n", fd,
        inet_ntoa(connState->peer.sin_addr));
     comm_close(fd);
 }
index 7bc5be6b6f1cec7a8cba001b26d869abe3d19cc3..739e51e495afeaee29a38f7462498051af22eb0e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: mime.cc,v 1.56 1998/03/31 05:35:24 wessels Exp $
+ * $Id: mime.cc,v 1.57 1998/03/31 05:37:45 wessels Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
@@ -184,6 +184,7 @@ mime_headers_end(const char *mime)
        end += (end == p1 ? 3 : 2);
     return (char *) end;
 }
+
 #endif
 
 size_t
@@ -192,32 +193,32 @@ headersEnd(const char *mime, size_t l)
     size_t e = 0;
     int state = 0;
     while (e < l && state < 3) {
-        switch (state) {
-        case 0:
-            if ('\n' == mime[e]) 
-                state = 1;
-            break;
-        case 1:
-            if ('\r' == mime[e])
-                state = 2;
-            else if ('\n' == mime[e])
-                state = 3;
-            else
-                state = 0;
-            break;
-        case 2:
-            if ('\n' == mime[e])
-                state = 3;
-            else
-                state = 0;
-            break;
-        default:
-                break;
-        }
-        e++;
+       switch (state) {
+       case 0:
+           if ('\n' == mime[e])
+               state = 1;
+           break;
+       case 1:
+           if ('\r' == mime[e])
+               state = 2;
+           else if ('\n' == mime[e])
+               state = 3;
+           else
+               state = 0;
+           break;
+       case 2:
+           if ('\n' == mime[e])
+               state = 3;
+           else
+               state = 0;
+           break;
+       default:
+           break;
+       }
+       e++;
     }
     if (3 == state)
-        return e;
+       return e;
     return 0;
 }
 
index 5f3f9e5ffc3cb2ac83c634bde30dabdce8570ebb..7324ddfe09286ca6bedf496071c30ffdbdfc0bfe 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.186 1998/03/28 18:37:07 wessels Exp $
+ * $Id: neighbors.cc,v 1.187 1998/03/31 05:37:47 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -444,11 +444,11 @@ neighborsUdpPing(request_t * request,
 
 #if USE_HTCP
        if (EBIT_TEST(p->options, NEIGHBOR_HTCP)) {
-           debug(15, 0)("neighborsUdpPing: sending HTCP query\n");
+           debug(15, 0) ("neighborsUdpPing: sending HTCP query\n");
            htcpQuery(entry, request, p);
        } else
 #endif
- if (p->icp_port == echo_port) {
      if (p->icp_port == echo_port) {
            debug(15, 4) ("neighborsUdpPing: Looks like a dumb cache, send DECHO ping\n");
            echo_hdr.reqnum = reqnum;
            query = icpCreateMessage(ICP_DECHO, 0, url, reqnum, 0);
index f036dbba1dd14a2e3338cf8ec92509195b535b51..e977a431529c527b86f28f20755a61c4a1ad2f01 100644 (file)
@@ -891,10 +891,10 @@ extern int ipcCreate(int type,
 
 /* CacheDigest */
 extern CacheDigest *cacheDigestCreate(int capacity);
-extern void cacheDigestDestroy(CacheDigest *cd);
-extern int cacheDigestTest(const CacheDigest *cd, const cache_key *key);
-extern void cacheDigestAdd(CacheDigest *cd, const cache_key *key);
-extern void cacheDigestDel(CacheDigest *cd, const cache_key *key);
+extern void cacheDigestDestroy(CacheDigest * cd);
+extern int cacheDigestTest(const CacheDigest * cd, const cache_key * key);
+extern void cacheDigestAdd(CacheDigest * cd, const cache_key * key);
+extern void cacheDigestDel(CacheDigest * cd, const cache_key * key);
 
 /*
  * prototypes for system functions missing from system includes
index 213763c1c4b651d6462217f2c0a5f3ea4f87fb48..7a863c45e72f01470a565d2400e9e8de76c7e8d2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.cc,v 1.76 1998/03/27 22:44:25 wessels Exp $
+ * $Id: ssl.cc,v 1.77 1998/03/31 05:37:49 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -344,10 +344,10 @@ sslConnectDone(int fdnotused, int status, void *data)
            sslProxyConnected(sslState->server.fd, sslState);
        else
            sslConnected(sslState->server.fd, sslState);
-    commSetTimeout(sslState->server.fd,
-       Config.Timeout.read,
-       sslTimeout,
-       sslState);
+       commSetTimeout(sslState->server.fd,
+           Config.Timeout.read,
+           sslTimeout,
+           sslState);
     }
 }
 
index 24377f41d4bc85b7129809dbb8cc2ebdab4e2d14..3d46afdb3c87dbd957e6e712e0cf4162b4789303 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.220 1998/03/28 23:24:49 wessels Exp $
+ * $Id: stat.cc,v 1.221 1998/03/31 05:37:50 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -1076,4 +1076,5 @@ statGraphDump(StoreEntry * e)
     GENGRAPH(select_loops, "select_loops", "System Select Loop calls/sec");
     GENGRAPH(cputime, "cputime", "CPU utilisation");
 }
+
 #endif /* STAT_GRAPHS */
index fd93faa0df63b79b0cee3b1a958ba595fa9134ad..38d8a5421c6f9f69d84fdc1909b4bfc0a5a84b56 100644 (file)
@@ -425,6 +425,6 @@ storePendingNClients(const StoreEntry * e)
        npend++;
     }
 #endif
-    debug(20,3)("storePendingNClients: returning %d\n", npend);
+    debug(20, 3) ("storePendingNClients: returning %d\n", npend);
     return npend;
 }
index f95c858591ea48fc8409bbf3d2a9cd012685daa7..8d0cb6164839dff618c1aad8240ea221b6c36a17 100644 (file)
@@ -1,5 +1,6 @@
 
 
+
 struct _acl_ip_data {
     struct in_addr addr1;      /* if addr2 non-zero then its a range */
     struct in_addr addr2;
@@ -1202,9 +1203,9 @@ struct _ClientInfo {
 
 struct _CacheDigest {
     /* public, read-only */
-    char *mask;       /* bit mask */
-    size_t mask_size; /* mask size in bytes */
-    int capacity;     /* expected maximum for .count, not a hard limit */
-    int count;        /* number of digested entries */
-    int del_count;    /* number of deletions performed so far */
+    char *mask;                        /* bit mask */
+    size_t mask_size;          /* mask size in bytes */
+    int capacity;              /* expected maximum for .count, not a hard limit */
+    int count;                 /* number of digested entries */
+    int del_count;             /* number of deletions performed so far */
 };
index eddb0bcc813b64ba09969aad46068e29a205079e..59b35d3a2a6b2e1a41c27e231c3414812313e898 100644 (file)
@@ -1,5 +1,6 @@
+
 /*
- * $Id: test_cache_digest.cc,v 1.4 1998/03/31 00:10:10 rousskov Exp $
+ * $Id: test_cache_digest.cc,v 1.5 1998/03/31 05:37:52 wessels Exp $
  *
  * AUTHOR: Alex Rousskov
  *
@@ -37,10 +38,10 @@ typedef struct {
     const char *name;
     hash_table *hash;
     CacheDigest *digest;
-    int count;          /* #currently cached entries */
-    int scanned_count;  /* #scanned entries */
-    int bad_add_count;  /* #duplicate adds */
-    int bad_del_count;  /* #dels with no prior add */
+    int count;                 /* #currently cached entries */
+    int scanned_count;         /* #scanned entries */
+    int bad_add_count;         /* #duplicate adds */
+    int bad_del_count;         /* #dels with no prior add */
 } CacheIndex;
 
 
@@ -68,34 +69,34 @@ const char *RequestMethodStr[] =
 
 static CacheIndex *Peer = NULL;
 
-static int cacheIndexScanCleanPrefix(CacheIndex *idx, const char *fname, FILE *file);
-static int cacheIndexScanAccessLog(CacheIndex *idx, const char *fname, FILE *file);
+static int cacheIndexScanCleanPrefix(CacheIndex * idx, const char *fname, FILE * file);
+static int cacheIndexScanAccessLog(CacheIndex * idx, const char *fname, FILE * file);
 
 /* copied from url.c */
 static method_t
 cacheIndexParseMethod(const char *s)
 {
     if (strcasecmp(s, "GET") == 0) {
-        return METHOD_GET;
+       return METHOD_GET;
     } else if (strcasecmp(s, "POST") == 0) {
-        return METHOD_POST;
+       return METHOD_POST;
     } else if (strcasecmp(s, "PUT") == 0) {
-        return METHOD_PUT;
+       return METHOD_PUT;
     } else if (strcasecmp(s, "HEAD") == 0) {
-        return METHOD_HEAD;
+       return METHOD_HEAD;
     } else if (strcasecmp(s, "CONNECT") == 0) {
-        return METHOD_CONNECT;
+       return METHOD_CONNECT;
     } else if (strcasecmp(s, "TRACE") == 0) {
-        return METHOD_TRACE;
+       return METHOD_TRACE;
     } else if (strcasecmp(s, "PURGE") == 0) {
-        return METHOD_PURGE;
+       return METHOD_PURGE;
     }
     return METHOD_NONE;
 }
 
 
 static CacheEntry *
-cacheEntryCreate(const storeSwapLogData *s)
+cacheEntryCreate(const storeSwapLogData * s)
 {
     CacheEntry *e = xcalloc(1, sizeof(CacheEntry));
     assert(s);
@@ -106,7 +107,7 @@ cacheEntryCreate(const storeSwapLogData *s)
 }
 
 static void
-cacheEntryDestroy(CacheEntry *e)
+cacheEntryDestroy(CacheEntry * e)
 {
     assert(e);
     xfree(e);
@@ -127,14 +128,14 @@ cacheIndexCreate(const char *name)
 }
 
 static void
-cacheIndexDestroy(CacheIndex *idx)
+cacheIndexDestroy(CacheIndex * idx)
 {
     hash_link *hashr = NULL;
     if (idx) {
        /* destroy hash list contents */
        for (hashr = hash_first(idx->hash); hashr; hashr = hash_next(idx->hash)) {
            hash_remove_link(idx->hash, hashr);
-           cacheEntryDestroy((CacheEntry*)hashr);
+           cacheEntryDestroy((CacheEntry *) hashr);
        }
        /* destroy the hash table itself */
        hashFreeMemory(idx->hash);
@@ -146,25 +147,25 @@ cacheIndexDestroy(CacheIndex *idx)
 
 /* makes digest based on currently hashed entries */
 static void
-cacheIndexInitDigest(CacheIndex *idx)
+cacheIndexInitDigest(CacheIndex * idx)
 {
     hash_link *hashr = NULL;
     struct timeval t_start, t_end;
     assert(idx && !idx->digest);
     fprintf(stderr, "%s: init-ing digest with %d entries\n", idx->name, idx->count);
-    idx->digest = cacheDigestCreate(2*idx->count); /* 50% utilization */
+    idx->digest = cacheDigestCreate(2 * idx->count);   /* 50% utilization */
     gettimeofday(&t_start, NULL);
     for (hashr = hash_first(idx->hash); hashr; hashr = hash_next(idx->hash)) {
        cacheDigestAdd(idx->digest, hashr->key);
     }
     gettimeofday(&t_end, NULL);
     assert(idx->digest->count == idx->count);
-    fprintf(stderr, "%s: init-ed  digest with %d entries\n", 
+    fprintf(stderr, "%s: init-ed  digest with %d entries\n",
        idx->name, idx->digest->count);
     fprintf(stderr, "%s: init took: %f sec, %f sec/M\n",
        idx->name,
        tvSubDsec(t_start, t_end),
-       (double)1e6*tvSubDsec(t_start, t_end)/idx->count);
+       (double) 1e6 * tvSubDsec(t_start, t_end) / idx->count);
     /* check how long it takes to traverse the hash */
     gettimeofday(&t_start, NULL);
     for (hashr = hash_first(idx->hash); hashr; hashr = hash_next(idx->hash)) {
@@ -173,11 +174,11 @@ cacheIndexInitDigest(CacheIndex *idx)
     fprintf(stderr, "%s: hash scan took: %f sec, %f sec/M\n",
        idx->name,
        tvSubDsec(t_start, t_end),
-       (double)1e6*tvSubDsec(t_start, t_end)/idx->count);
+       (double) 1e6 * tvSubDsec(t_start, t_end) / idx->count);
 }
 
 static int
-cacheIndexAddLog(CacheIndex *idx, const char *fname)
+cacheIndexAddLog(CacheIndex * idx, const char *fname)
 {
     FILE *file;
     int scanned_count = 0;
@@ -195,20 +196,20 @@ cacheIndexAddLog(CacheIndex *idx, const char *fname)
 }
 
 static void
-cacheIndexInitReport(CacheIndex *idx)
+cacheIndexInitReport(CacheIndex * idx)
 {
     assert(idx);
     fprintf(stderr, "%s: bad swap_add:  %d\n",
        idx->name, idx->bad_add_count);
-    fprintf(stderr, "%s: bad swap_del:  %d\n", 
+    fprintf(stderr, "%s: bad swap_del:  %d\n",
        idx->name, idx->bad_del_count);
-    fprintf(stderr, "%s: scanned lines: %d\n", 
+    fprintf(stderr, "%s: scanned lines: %d\n",
        idx->name, idx->scanned_count);
 }
 
 #if 0
 static int
-cacheIndexGetLogEntry(CacheIndex *idx, storeSwapLogData *s)
+cacheIndexGetLogEntry(CacheIndex * idx, storeSwapLogData * s)
 {
     if (!idx->has_log_entry)
        cacheIndexStepLogEntry();
@@ -220,7 +221,7 @@ cacheIndexGetLogEntry(CacheIndex *idx, storeSwapLogData *s)
 }
 
 static int
-cacheIndexStepLogEntry(CacheIndex *idx)
+cacheIndexStepLogEntry(CacheIndex * idx)
 {
     if (fread(&idx->log_entry_buf, sizeof(idx->log_entry_buf), 1, idx->log) == 1) {
        int op = (int) idx->log_entry_buf.op;
@@ -235,7 +236,7 @@ cacheIndexStepLogEntry(CacheIndex *idx)
 }
 
 static int
-cacheIndexScan(CacheIndex *idx, const char *fname, FILE *file)
+cacheIndexScan(CacheIndex * idx, const char *fname, FILE * file)
 {
     int count = 0;
     int del_count = 0;
@@ -250,17 +251,16 @@ cacheIndexScan(CacheIndex *idx, const char *fname, FILE *file)
                idx->bad_add_count++;
            } else {
                CacheEntry *e = cacheEntryCreate(&s);
-               hash_join(idx->hash, (hash_link*) e);
+               hash_join(idx->hash, (hash_link *) e);
                idx->count++;
            }
-       } else
-       if (s.op == SWAP_LOG_DEL) {
+       } else if (s.op == SWAP_LOG_DEL) {
            CacheEntry *olde = (CacheEntry *) hash_lookup(idx->hash, s.key);
            if (!olde)
                idx->bad_del_count++;
            else {
                assert(idx->count);
-               hash_remove_link(idx->hash, (hash_link*) olde);
+               hash_remove_link(idx->hash, (hash_link *) olde);
                cacheEntryDestroy(olde);
                idx->count--;
            }
@@ -271,14 +271,14 @@ cacheIndexScan(CacheIndex *idx, const char *fname, FILE *file)
        }
     }
     fprintf(stderr, "%s scanned %d entries, alloc: %d bytes\n",
-       fname, count, 
-       (int)(count*sizeof(CacheEntry)));
+       fname, count,
+       (int) (count * sizeof(CacheEntry)));
     return count;
 }
 #endif
 
 static int
-cacheIndexScanCleanPrefix(CacheIndex *idx, const char *fname, FILE *file)
+cacheIndexScanCleanPrefix(CacheIndex * idx, const char *fname, FILE * file)
 {
     int count = 0;
     storeSwapLogData s;
@@ -292,11 +292,10 @@ cacheIndexScanCleanPrefix(CacheIndex *idx, const char *fname, FILE *file)
                idx->bad_add_count++;
            } else {
                CacheEntry *e = cacheEntryCreate(&s);
-               hash_join(idx->hash, (hash_link*) e);
+               hash_join(idx->hash, (hash_link *) e);
                idx->count++;
            }
-       } else
-       if (s.op == SWAP_LOG_DEL) {
+       } else if (s.op == SWAP_LOG_DEL) {
            break;
        } else {
            fprintf(stderr, "%s:%d: unknown swap log action\n", fname, count);
@@ -304,8 +303,8 @@ cacheIndexScanCleanPrefix(CacheIndex *idx, const char *fname, FILE *file)
        }
     }
     fprintf(stderr, "%s scanned %d entries, alloc: %d bytes\n",
-       fname, count, 
-       (int)(count*sizeof(CacheEntry)));
+       fname, count,
+       (int) (count * sizeof(CacheEntry)));
     return count;
 }
 
@@ -318,7 +317,7 @@ static int we_false_hit_count = 0;
 static int we_false_miss_count = 0;
 
 static void
-cacheIndexQueryPeer(CacheIndex *idx, const cache_key *key)
+cacheIndexQueryPeer(CacheIndex * idx, const cache_key * key)
 {
     const int peer_has_it = hash_lookup(Peer->hash, key) != NULL;
     const int we_think_we_have_it = cacheDigestTest(Peer->digest, key);
@@ -329,33 +328,32 @@ cacheIndexQueryPeer(CacheIndex *idx, const cache_key *key)
            we_true_hit_count++;
        else
            we_false_miss_count++;
+    else if (we_think_we_have_it)
+       we_false_hit_count++;
     else
-       if (we_think_we_have_it)
-           we_false_hit_count++;
-       else
-           we_true_miss_count++;
+       we_true_miss_count++;
 }
 
 static void
-cacheIndexIcpReport(CacheIndex *idx)
+cacheIndexIcpReport(CacheIndex * idx)
 {
     fprintf(stdout, "we: icp: %d\n", we_icp_query_count);
     fprintf(stdout, "we: t-hit: %d (%d%%) t-miss: %d (%d%%) t-*: %d (%d%%)\n",
        we_true_hit_count, xpercentInt(we_true_hit_count, we_icp_query_count),
        we_true_miss_count, xpercentInt(we_true_miss_count, we_icp_query_count),
-       we_true_hit_count+we_true_miss_count, 
-           xpercentInt(we_true_hit_count+we_true_miss_count, we_icp_query_count)
-    );
+       we_true_hit_count + we_true_miss_count,
+       xpercentInt(we_true_hit_count + we_true_miss_count, we_icp_query_count)
+       );
     fprintf(stdout, "we: f-hit: %d (%d%%) f-miss: %d (%d%%) f-*: %d (%d%%)\n",
        we_false_hit_count, xpercentInt(we_false_hit_count, we_icp_query_count),
        we_false_miss_count, xpercentInt(we_false_miss_count, we_icp_query_count),
-       we_false_hit_count+we_false_miss_count, 
-           xpercentInt(we_false_hit_count+we_false_miss_count, we_icp_query_count)
-    );
+       we_false_hit_count + we_false_miss_count,
+       xpercentInt(we_false_hit_count + we_false_miss_count, we_icp_query_count)
+       );
 }
 
 static int
-cacheIndexAddAccessLog(CacheIndex *idx, const char *fname)
+cacheIndexAddAccessLog(CacheIndex * idx, const char *fname)
 {
     FILE *file;
     int scanned_count = 0;
@@ -373,7 +371,7 @@ cacheIndexAddAccessLog(CacheIndex *idx, const char *fname)
 }
 
 static int
-cacheIndexScanAccessLog(CacheIndex *idx, const char *fname, FILE *file)
+cacheIndexScanAccessLog(CacheIndex * idx, const char *fname, FILE * file)
 {
     static char buf[4096];
     int count = 0;
@@ -390,11 +388,11 @@ cacheIndexScanAccessLog(CacheIndex *idx, const char *fname, FILE *file)
 
        scanned_count++;
        if (!(scanned_count % 50000))
-           fprintf(stderr, "%s scanned %d K entries (%d bad)\n", 
-               fname, scanned_count/1000, scanned_count-count-1);
+           fprintf(stderr, "%s scanned %d K entries (%d bad)\n",
+               fname, scanned_count / 1000, scanned_count - count - 1);
        if (!url || !hier) {
            /*fprintf(stderr, "%s:%d: strange access log entry '%s'\n", 
-               fname, scanned_count, buf);*/
+            * fname, scanned_count, buf); */
            continue;
        }
        method = url;
@@ -407,16 +405,17 @@ cacheIndexScanAccessLog(CacheIndex *idx, const char *fname, FILE *file)
        method_id = cacheIndexParseMethod(method);
        if (method_id == METHOD_NONE) {
            /*fprintf(stderr, "%s:%d: invalid method %s in '%s'\n", 
-               fname, scanned_count, method, buf);*/
+            * fname, scanned_count, method, buf); */
            continue;
        }
-       while (*url) url--;
+       while (*url)
+           url--;
        url++;
        *hier = '\0';
        hier += 3;
        *strchr(hier, '/') = '\0';
        /*fprintf(stdout, "%s:%d: %s %s %s\n",
-           fname, count, method, url, hier);*/
+        * fname, count, method, url, hier); */
        count++;
        /* no ICP lookup for these status codes */
        if (!strcmp(hier, "NONE") ||
@@ -432,12 +431,12 @@ cacheIndexScanAccessLog(CacheIndex *idx, const char *fname, FILE *file)
            continue;
        key = storeKeyPublic(url, method_id);
        /*fprintf(stdout, "%s:%d: %s %s %s %s\n",
-           fname, count, method, storeKeyText(key), url, hier);*/
+        * fname, count, method, storeKeyText(key), url, hier); */
        cacheIndexQueryPeer(idx, key);
        icp_count++;
     }
     fprintf(stderr, "%s: scanned %d access log entries; bad: %d\n",
-       fname, scanned_count, scanned_count-count);
+       fname, scanned_count, scanned_count - count);
     fprintf(stderr, "%s: icp: %d (%d%%)\n",
        fname, icp_count, xpercentInt(icp_count, count));
     return count;
index 7b028362d77b61415dc116541c92faa89ff7e212..724564a8662fe36a13e2c8a97afc1ea0eb159be6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.76 1998/03/27 22:44:25 wessels Exp $
+ * $Id: tunnel.cc,v 1.77 1998/03/31 05:37:49 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -344,10 +344,10 @@ sslConnectDone(int fdnotused, int status, void *data)
            sslProxyConnected(sslState->server.fd, sslState);
        else
            sslConnected(sslState->server.fd, sslState);
-    commSetTimeout(sslState->server.fd,
-       Config.Timeout.read,
-       sslTimeout,
-       sslState);
+       commSetTimeout(sslState->server.fd,
+           Config.Timeout.read,
+           sslTimeout,
+           sslState);
     }
 }
 
index c5b9cc24eec5b4b9c87a27af4671431fd206a4cb..a29c17cbe11b32d908397d8a0318a90db241db53 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: url.cc,v 1.83 1998/03/07 23:43:12 rousskov Exp $
+ * $Id: url.cc,v 1.84 1998/03/31 05:37:53 wessels Exp $
  *
  * DEBUG: section 23    URL Parsing
  * AUTHOR: Duane Wessels
@@ -294,7 +294,7 @@ urnParse(method_t method, char *urn)
 #if OLD_CODE
     xstrncpy(request->urlpath, &urn[4], MAX_URL);
 #else
-    stringReset(&request->urlpath, urn+4);
+    stringReset(&request->urlpath, urn + 4);
 #endif
     request->max_age = -1;
     request->max_forwards = -1;
index 26ad088c7d02a8cfb4ff30343c21abf2171cd8cb..349a6b75d01fc987a8d536a09623d85815f243a7 100644 (file)
@@ -255,7 +255,7 @@ urnHandleReply(void *data, char *buf, ssize_t size)
     } else if (min_w) {
        httpHeaderPutStr(&rep->header, HDR_LOCATION, min_w->key);
     }
-    httpBodySet(&rep->body, mb.buf, mb.size+1, memBufFreeFunc(&mb));
+    httpBodySet(&rep->body, mb.buf, mb.size + 1, memBufFreeFunc(&mb));
     httpReplySwapOut(rep, e);
     storeComplete(e);
     memFree(MEM_4K_BUF, buf);
index 2afd2ff91566aad0ab560236e3286960b5b0f13f..8839e502e9eec0bc5f4633f3f8692894cfa64884 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.105 1998/03/28 23:24:54 wessels Exp $
+ * $Id: wais.cc,v 1.106 1998/03/31 05:37:55 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -188,7 +188,7 @@ waisReadReply(int fd, void *data)
     }
     if (len < 0) {
        debug(50, 1) ("waisReadReply: FD %d: read failure: %s.\n",
-               fd, xstrerror());
+           fd, xstrerror());
        if (ignoreErrno(errno)) {
            /* reinstall handlers */
            /* XXX This may loop forever */
@@ -360,7 +360,7 @@ waisConnectDone(int fd, int status, void *data)
        comm_close(fd);
     } else {
        commSetSelect(fd, COMM_SELECT_WRITE, waisSendRequest, waisState, 0);
-        commSetTimeout(fd, Config.Timeout.read, waisTimeout, waisState);
+       commSetTimeout(fd, Config.Timeout.read, waisTimeout, waisState);
     }
 }