]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Mon, 26 Jun 2000 04:28:42 +0000 (04:28 +0000)
committerwessels <>
Mon, 26 Jun 2000 04:28:42 +0000 (04:28 +0000)
 - gindent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl

src/cache_cf.cc
src/ftp.cc
src/globals.h
src/protos.h
src/store.cc
src/store_dir.cc
src/store_log.cc
src/store_swapout.cc
src/structs.h
src/typedefs.h

index 90016c1db5110ee5a95fc1cf61469b030dec8dee..21e05acd6f1f644a716dfc8e6b7d21165b9e1c2a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.350 2000/06/08 18:05:34 hno Exp $
+ * $Id: cache_cf.cc,v 1.351 2000/06/25 22:28:42 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -1725,7 +1725,7 @@ dump_uri_whitespace(StoreEntry * entry, const char *name, int var)
 }
 
 static void
-free_removalpolicy(RemovalPolicySettings **settings)
+free_removalpolicy(RemovalPolicySettings ** settings)
 {
     if (!*settings)
        return;
@@ -1736,7 +1736,7 @@ free_removalpolicy(RemovalPolicySettings **settings)
 }
 
 static void
-parse_removalpolicy(RemovalPolicySettings **settings)
+parse_removalpolicy(RemovalPolicySettings ** settings)
 {
     if (*settings)
        free_removalpolicy(settings);
@@ -1746,7 +1746,7 @@ parse_removalpolicy(RemovalPolicySettings **settings)
 }
 
 static void
-dump_removalpolicy(StoreEntry * entry, const char *name, RemovalPolicySettings *settings)
+dump_removalpolicy(StoreEntry * entry, const char *name, RemovalPolicySettings * settings)
 {
     wordlist *args;
     storeAppendPrintf(entry, "%s %s", name, settings->type);
@@ -1756,7 +1756,7 @@ dump_removalpolicy(StoreEntry * entry, const char *name, RemovalPolicySettings *
        args = args->next;
     }
 }
-    
+
 
 #include "cf_parser.c"
 
@@ -1859,5 +1859,3 @@ requirePathnameExists(const char *name, const char *path)
     if (stat(path, &sb) < 0)
        fatalf("%s: %s", path, xstrerror());
 }
-
-
index 53fed3d1f8554d65881eb1060cf285f99dff019b..494018c18aa5059e78f9d4434e95a78d76fbaaa0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.294 2000/05/31 10:00:24 hno Exp $
+ * $Id: ftp.cc,v 1.295 2000/06/25 22:28:42 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -1880,7 +1880,6 @@ ftpAcceptDataConnection(int fd, void *data)
        comm_close(ftpState->ctrl.fd);
        return;
     }
-
     fd = comm_accept(fd, &my_peer, &me);
     if (fd < 0) {
        debug(9, 1) ("ftpHandleDataAccept: comm_accept(%d): %s", fd, xstrerror());
index 884c91ff80c2afd9eb28e9a30adbd8ac60d94943..71afbea562d91a26e10658d313fe06faf3dc5813 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: globals.h,v 1.92 2000/06/08 18:05:35 hno Exp $
+ * $Id: globals.h,v 1.93 2000/06/25 22:28:42 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -149,5 +149,5 @@ extern storefs_entry_t *storefs_list;       /* NULL */
 extern int store_swap_low;     /* 0 */
 extern int store_swap_high;    /* 0 */
 extern int store_pages_max;    /* 0 */
-extern ssize_t store_maxobjsize; /* -1 */
+extern ssize_t store_maxobjsize;       /* -1 */
 extern RemovalPolicy *mem_policy;
index cd53a47fc992fb8a6776cd3598d7b308e9caddfd..5235c335eaef6609135b7ae8cbc2c5965db2eb80 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.371 2000/06/25 21:27:57 wessels Exp $
+ * $Id: protos.h,v 1.372 2000/06/25 22:28:43 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -1182,9 +1182,10 @@ extern void logfilePrintf(Logfile * lf, const char *fmt,...);
 extern void logfilePrintf(va_alist);
 #endif
 
-/* Removal Policies */
-RemovalPolicy *
-createRemovalPolicy(RemovalPolicySettings *settings);
+/*
+ * Removal Policies
+ */
+extern RemovalPolicy *createRemovalPolicy(RemovalPolicySettings * settings);
 
 /*
  * prototypes for system functions missing from system includes
index 6e1856b3e4815d5790719be0167a44f0318f0440..0e2bc2b520d033707a1c8f7726642d299cabee2b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.525 2000/06/08 18:05:36 hno Exp $
+ * $Id: store.cc,v 1.526 2000/06/25 22:28:43 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -218,7 +218,7 @@ storePurgeMem(StoreEntry * e)
 }
 
 static void
-storeEntryReferenced(StoreEntry *e)
+storeEntryReferenced(StoreEntry * e)
 {
     SwapDir *SD;
 
@@ -229,25 +229,25 @@ storeEntryReferenced(StoreEntry *e)
            SD->refobj(SD, e);
     }
     /* Notify the memory cache that we're referencing this object again */
-    if(e->mem_obj) {
+    if (e->mem_obj) {
        if (mem_policy->Referenced)
            mem_policy->Referenced(mem_policy, e, &e->mem_obj->repl);
     }
 }
 
 static void
-storeEntryDereferenced(StoreEntry *e)
+storeEntryDereferenced(StoreEntry * e)
 {
     SwapDir *SD;
 
     /* Notify the fs that we're not referencing this object any more */
     if (e->swap_filen > -1) {
-        SD = INDEXSD(e->swap_dirn);
+       SD = INDEXSD(e->swap_dirn);
        if (SD->unrefobj != NULL)
            SD->unrefobj(SD, e);
     }
     /* Notify the memory cache that we're not referencing this object any more */
-    if(e->mem_obj) {
+    if (e->mem_obj) {
        if (mem_policy->Dereferenced)
            mem_policy->Dereferenced(mem_policy, e, &e->mem_obj->repl);
     }
@@ -714,7 +714,7 @@ storeGetMemSpace(int size)
     debug(20, 2) ("storeGetMemSpace: Starting, need %d pages\n", pages_needed);
     /* XXX what to set as max_scan here? */
     walker = mem_policy->PurgeInit(mem_policy, 100000);
-    while((e = walker->Next(walker))) {
+    while ((e = walker->Next(walker))) {
        storePurgeMem(e);
        released++;
        if (memInUse(MEM_STMEM_BUF) + pages_needed < store_pages_max)
@@ -747,11 +747,11 @@ storeMaintainSwapSpace(void *datanotused)
     /* walk each fs */
     for (i = 0; i < Config.cacheSwap.n_configured; i++) {
        /* call the maintain function .. */
-       SD = INDEXSD(i); 
+       SD = INDEXSD(i);
        /* XXX FixMe: This should be done "in parallell" on the different
         * cache_dirs, not one at a time.
         */
-        if (SD->maintainfs != NULL)
+       if (SD->maintainfs != NULL)
            SD->maintainfs(SD);
     }
     if (store_swap_size > Config.Swap.maxSize) {
@@ -1122,8 +1122,8 @@ storeSetMemStatus(StoreEntry * e, int new_status)
        hot_obj_count++;
     } else {
        if (EBIT_TEST(e->flags, ENTRY_SPECIAL)) {
-               debug(20, 4) ("storeSetMemStatus: special entry %s\n",
-                   mem->url);
+           debug(20, 4) ("storeSetMemStatus: special entry %s\n",
+               mem->url);
        } else {
            mem_policy->Remove(mem_policy, e, &mem->repl);
            debug(20, 4) ("storeSetMemStatus: removed mem node %s\n",
index 80811197941ba002f63a8b058edd8bb8d16ab027..1ab208f9ef779ccdc82c563ce7c61ccfa76913fb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.111 2000/06/08 18:05:36 hno Exp $
+ * $Id: store_dir.cc,v 1.112 2000/06/25 22:28:43 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -387,7 +387,7 @@ storeDirWriteCleanLogs(int reopen)
            continue;
        }
     }
-    while(notdone) {
+    while (notdone) {
        notdone = 0;
        for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) {
            sd = &Config.cacheSwap.swapDirs[dirn];
@@ -419,7 +419,7 @@ storeDirWriteCleanLogs(int reopen)
     /* Flush */
     for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) {
        sd = &Config.cacheSwap.swapDirs[dirn];
-        sd->log.clean.done(sd);
+       sd->log.clean.done(sd);
     }
     if (reopen)
        storeDirOpenSwapLogs();
@@ -458,16 +458,15 @@ storeDirCallback(void)
     SwapDir *SD;
     static int ndir = 0;
     do {
-        j = 0;
-        for (i = 0; i < Config.cacheSwap.n_configured; i++) {
-            if (ndir >= Config.cacheSwap.n_configured)
-                ndir = ndir % Config.cacheSwap.n_configured;
-            SD = &Config.cacheSwap.swapDirs[ndir++];
-            if (NULL == SD->callback)
-                continue;
-            j += SD->callback(SD);
-        }
+       j = 0;
+       for (i = 0; i < Config.cacheSwap.n_configured; i++) {
+           if (ndir >= Config.cacheSwap.n_configured)
+               ndir = ndir % Config.cacheSwap.n_configured;
+           SD = &Config.cacheSwap.swapDirs[ndir++];
+           if (NULL == SD->callback)
+               continue;
+           j += SD->callback(SD);
+       }
     } while (j > 0);
     ndir++;
 }
-
index afb059305fa9ed550ada2218c1abf514fdc3169e..76c6e0df282890be1cf74216e45771b43eb7fb60 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_log.cc,v 1.16 2000/06/08 18:05:36 hno Exp $
+ * $Id: store_log.cc,v 1.17 2000/06/25 22:28:43 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Logging Functions
  * AUTHOR: Duane Wessels
@@ -55,33 +55,33 @@ storeLog(int tag, const StoreEntry * e)
     if (EBIT_TEST(e->flags, ENTRY_DONT_LOG))
        return;
     if (mem != NULL) {
-    if (mem->log_url == NULL) {
-       debug(20, 1) ("storeLog: NULL log_url for %s\n", mem->url);
-       storeMemObjectDump(mem);
-       mem->log_url = xstrdup(mem->url);
-    }
-    reply = mem->reply;
-    /*
-     * XXX Ok, where should we print the dir number here?
-     * Because if we print it before the swap file number, it'll break
-     * the existing log format.
-     */
-    logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s %4d %9d %9d %9d %s %d/%d %s %s\n",
-       (int) current_time.tv_sec,
-       (int) current_time.tv_usec / 1000,
-       storeLogTags[tag],
-       e->swap_dirn,
-       e->swap_filen,
-       storeKeyText(e->key),
-       reply->sline.status,
-       (int) reply->date,
-       (int) reply->last_modified,
-       (int) reply->expires,
-       strLen(reply->content_type) ? strBuf(reply->content_type) : "unknown",
-       reply->content_length,
-       (int) (mem->inmem_hi - mem->reply->hdr_sz),
-       RequestMethodStr[mem->method],
-       mem->log_url);
+       if (mem->log_url == NULL) {
+           debug(20, 1) ("storeLog: NULL log_url for %s\n", mem->url);
+           storeMemObjectDump(mem);
+           mem->log_url = xstrdup(mem->url);
+       }
+       reply = mem->reply;
+       /*
+        * XXX Ok, where should we print the dir number here?
+        * Because if we print it before the swap file number, it'll break
+        * the existing log format.
+        */
+       logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s %4d %9d %9d %9d %s %d/%d %s %s\n",
+           (int) current_time.tv_sec,
+           (int) current_time.tv_usec / 1000,
+           storeLogTags[tag],
+           e->swap_dirn,
+           e->swap_filen,
+           storeKeyText(e->key),
+           reply->sline.status,
+           (int) reply->date,
+           (int) reply->last_modified,
+           (int) reply->expires,
+           strLen(reply->content_type) ? strBuf(reply->content_type) : "unknown",
+           reply->content_length,
+           (int) (mem->inmem_hi - mem->reply->hdr_sz),
+           RequestMethodStr[mem->method],
+           mem->log_url);
     } else {
        /* no mem object. Most RELEASE cases */
        logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s   ?         ?         ?         ? ?/? ?/? ? ?\n",
index 2027d00a77f4e95cb4a654ae0e125e9d7749f00f..19d6cbf5c51e7c52cef3bd4d85b897bcf9b453f4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapout.cc,v 1.70 2000/06/02 17:30:48 wessels Exp $
+ * $Id: store_swapout.cc,v 1.71 2000/06/25 22:28:43 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Swapout Functions
  * AUTHOR: Duane Wessels
@@ -159,8 +159,8 @@ storeSwapOut(StoreEntry * e)
         */
        if ((on_disk = storeSwapOutObjectBytesOnDisk(mem)) - 1 < new_mem_lo)
            new_mem_lo = on_disk - 1;
-       if ( new_mem_lo == -1 )
-           new_mem_lo = 0; /* the above might become -1 */
+       if (new_mem_lo == -1)
+           new_mem_lo = 0;     /* the above might become -1 */
     } else if (new_mem_lo > 0) {
        /*
         * Its not swap-able, and we're about to delete a chunk,
index 8ae03d871095379480756cc5b79355cb960ae1ee..81b66f1ab67f3877be646a169a5b60e05a6967fe 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.339 2000/06/08 18:05:36 hno Exp $
+ * $Id: structs.h,v 1.340 2000/06/25 22:28:43 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -1280,28 +1280,28 @@ struct _RemovalPolicyNode {
 struct _RemovalPolicy {
     char *_type;
     void *_data;
-    void (*Free)(RemovalPolicy *policy);
-    void (*Add)(RemovalPolicy *policy, StoreEntry *entry, RemovalPolicyNode *node);
-    void (*Remove)(RemovalPolicy *policy, StoreEntry *entry, RemovalPolicyNode *node);
-    void (*Referenced)(RemovalPolicy *policy, const StoreEntry *entry, RemovalPolicyNode *node);
-    void (*Dereferenced)(RemovalPolicy *policy, const StoreEntry *entry, RemovalPolicyNode *node);
-    RemovalPolicyWalker *(*WalkInit)(RemovalPolicy *policy);
-    RemovalPurgeWalker *(*PurgeInit)(RemovalPolicy *policy, int max_scan);
+    void (*Free) (RemovalPolicy * policy);
+    void (*Add) (RemovalPolicy * policy, StoreEntry * entry, RemovalPolicyNode * node);
+    void (*Remove) (RemovalPolicy * policy, StoreEntry * entry, RemovalPolicyNode * node);
+    void (*Referenced) (RemovalPolicy * policy, const StoreEntry * entry, RemovalPolicyNode * node);
+    void (*Dereferenced) (RemovalPolicy * policy, const StoreEntry * entry, RemovalPolicyNode * node);
+    RemovalPolicyWalker *(*WalkInit) (RemovalPolicy * policy);
+    RemovalPurgeWalker *(*PurgeInit) (RemovalPolicy * policy, int max_scan);
 };
 
 struct _RemovalPolicyWalker {
     RemovalPolicy *_policy;
     void *_data;
-    const StoreEntry *(*Next)(RemovalPolicyWalker *walker);
-    void (*Done)(RemovalPolicyWalker *walker);
+    const StoreEntry *(*Next) (RemovalPolicyWalker * walker);
+    void (*Done) (RemovalPolicyWalker * walker);
 };
 
 struct _RemovalPurgeWalker {
     RemovalPolicy *_policy;
     void *_data;
     int scanned, max_scan, locked;
-    StoreEntry *(*Next)(RemovalPurgeWalker *walker);
-    void (*Done)(RemovalPurgeWalker *walker);
+    StoreEntry *(*Next) (RemovalPurgeWalker * walker);
+    void (*Done) (RemovalPurgeWalker * walker);
 };
 
 /* This structure can be freed while object is purged out from memory */
@@ -1909,4 +1909,3 @@ struct _Logfile {
     size_t bufsz;
     off_t offset;
 };
-
index e0684479afb1ce5e88a790ce822b3caafb69302f..780349ea26983db9067e058a3508d206ff6a9c7d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: typedefs.h,v 1.104 2000/06/08 18:05:37 hno Exp $
+ * $Id: typedefs.h,v 1.105 2000/06/25 22:28:43 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -308,5 +308,5 @@ typedef unsigned int delay_id;
 typedef struct _htcpReplyData htcpReplyData;
 #endif
 
-typedef RemovalPolicy *REMOVALPOLICYCREATE(wordlist *args);
+typedef RemovalPolicy *REMOVALPOLICYCREATE(wordlist * args);
 #endif /* _TYPEDEFS_H_ */